]> git.cworth.org Git - sup/commitdiff
sort labels in the dump
authorMichael Hamann <michael@content-space.de>
Sun, 6 Sep 2009 21:04:22 +0000 (23:04 +0200)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Wed, 9 Sep 2009 14:38:06 +0000 (10:38 -0400)
Sorting labels in the dump is useful when you e.g. want to keep track of
your dump using an incremental backup system that records diffs, with
this patch lines in the dump will only change when there is a real
change and no longer just because the random order of the labels
changes.

bin/sup-dump

index 8b5bf07f07be990e49ffdb96ff90b623e69a1a9a..7b33be5d583b925da8241854f423f74f10bf0245 100755 (executable)
@@ -26,5 +26,5 @@ Redwood::SourceManager.init
 index.load
 
 index.each_message :load_spam => true, :load_deleted => true, :load_killed => true do |m|
-  puts "#{m.id} (#{m.labels.to_a * ' '})"
+  puts "#{m.id} (#{m.labels.to_a.sort_by { |l| l.to_s } * ' '})"
 end