hgkw/keyword.py
branch0.9.2compat
changeset 664 c339bd5b183b
parent 658 efcbed613548
child 672 0d7642e39cfe
--- a/hgkw/keyword.py	Mon Oct 19 22:40:48 2009 +0200
+++ b/hgkw/keyword.py	Sat Nov 28 19:51:21 2009 +0000
@@ -251,7 +251,9 @@
         'Revision': '{node|short}',
         'Author': '{author|user}',
         'Date': '{date|utcdate}',
-        'RCSFile': '{file|basename},v',
+        'RCSfile': '{file|basename},v',
+        'RCSFile': '{file|basename},v', # kept for backwards compatibility
+                                        # with hg-keyword
         'Source': '{root}/{file},v',
         'Id': '{file|basename},v {node|short} {date|utcdate} {author|user}',
         'Header': '{root}/{file},v {node|short} {date|utcdate} {author|user}',
@@ -461,6 +463,7 @@
     Override current keyword template maps with "default" option.
     '''
     def demoitems(section, items):
+        items.sort()
         ui.write('[%s]\n' % section)
         for k, v in items:
             ui.write('%s = %s\n' % (k, v))
@@ -501,8 +504,10 @@
     ui.status(_('\n\tconfig using %s keyword template maps\n') % kwstatus)
     ui.write('[extensions]\n%s\n' % extension)
     demoitems('keyword', ui.configitems('keyword'))
-    demoitems('keywordmaps', kwmaps.iteritems())
-    keywords = '$' + '$\n$'.join(kwmaps.keys()) + '$\n'
+    demoitems('keywordmaps', kwmaps.items())
+    kwkeys = kwmaps.keys()
+    kwkeys.sort()
+    keywords = '$' + '$\n$'.join(kwkeys) + '$\n'
     repo.wopener(fn, 'w').write(keywords)
     repo.add([fn])
     path = repo.wjoin(fn)