# HG changeset patch # User Christian Ebert # Date 1259437881 0 # Node ID c339bd5b183b0d9c042a3e8ccfca6aad3c442fb8 # Parent efcbed6135480f654e0c82423788131f4f596285 (0.9.2compat) add correct $RCSfile$ default keyword; sort kwdemo output Keep $RCSFile$ for backwards compatibility. diff -r efcbed613548 -r c339bd5b183b hgkw/keyword.py --- 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) diff -r efcbed613548 -r c339bd5b183b tests/test-keyword.out --- a/tests/test-keyword.out Mon Oct 19 22:40:48 2009 +0200 +++ b/tests/test-keyword.out Sat Nov 28 19:51:21 2009 +0000 @@ -4,20 +4,22 @@ [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 +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 $ +$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]