keyword: sort demo output to ensure deterministic output stable
authorMartin Geisler <mg@lazybytes.net>
Thu, 26 Nov 2009 20:50:16 +0100
branchstable
changeset 660 583a0371249c
parent 657 fcd29bd314be
child 661 55e769bd66f7
child 663 059f0563d1f8
keyword: sort demo output to ensure deterministic output [ original upstream message ]
hgkw/keyword.py
tests/test-keyword.out
--- a/hgkw/keyword.py	Fri Oct 16 23:57:34 2009 +0200
+++ b/hgkw/keyword.py	Thu Nov 26 20:50:16 2009 +0100
@@ -288,7 +288,7 @@
     '''
     def demoitems(section, items):
         ui.write('[%s]\n' % section)
-        for k, v in items:
+        for k, v in sorted(items):
             ui.write('%s = %s\n' % (k, v))
 
     msg = 'hg keyword config and expansion example'
@@ -336,7 +336,7 @@
     ui.write('[extensions]\n%s\n' % extension)
     demoitems('keyword', ui.configitems('keyword'))
     demoitems('keywordmaps', kwmaps.iteritems())
-    keywords = '$' + '$\n$'.join(kwmaps.keys()) + '$\n'
+    keywords = '$' + '$\n$'.join(sorted(kwmaps.keys())) + '$\n'
     repo.wopener(fn, 'w').write(keywords)
     repo.add([fn])
     path = repo.wjoin(fn)
--- a/tests/test-keyword.out	Fri Oct 16 23:57:34 2009 +0200
+++ b/tests/test-keyword.out	Thu Nov 26 20:50:16 2009 +0100
@@ -4,20 +4,20 @@
 [keyword]
 demo.txt = 
 [keywordmaps]
-RCSFile = {file|basename},v
 Author = {author|user}
+Date = {date|utcdate}
 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
-Source = {root}/{file},v
-Date = {date|utcdate}
 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
+RCSFile = {file|basename},v
 Revision = {node|short}
-$RCSFile: demo.txt,v $
+Source = {root}/{file},v
 $Author: test $
+$Date: 2000/00/00 00:00:00 $
 $Header: /TMP/demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $
+$Id: demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $
+$RCSFile: demo.txt,v $
+$Revision: xxxxxxxxxxxx $
 $Source: /TMP/demo.txt,v $
-$Date: 2000/00/00 00:00:00 $
-$Id: demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $
-$Revision: xxxxxxxxxxxx $
 [extensions]
 hgext.keyword = 
 [keyword]