Subject: Re: [sup-devel] [PATCH] sources.yaml: consistent label ordering

From: Rich Lane <[email-masked]>
Date: Tue, 18 Jan 2011 22:41:30 -0500

Applied to master.
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Sascha Silbe <[email-masked]>
Date: Tue, 18 Jan 2011 19:26:54 +0100

Sort labels in sources.yaml so the ordering doesn't change betweeen saves.
This is useful when tracking sources.yaml with a VCS (e.g. git).

Signed-off-by: Sascha Silbe <[email-masked]>
---
 lib/sup/source.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/sup/source.rb b/lib/sup/source.rb
index f2379fb..e0aa90e 100644
--- a/lib/sup/source.rb
+++ b/lib/sup/source.rb
@@ -155,7 +155,7 @@ end
 module SerializeLabelsNicely
   def before_marshal # can return an object
     c = clone
-    c.instance_eval { @labels = @labels.to_a.map { |l| l.to_s } }
+    c.instance_eval { @labels = (@labels.to_a.map { |l| l.to_s }).sort }
     c
   end
 
-- 
1.7.2.3