Merge with stable
authorMartin Geisler <mg@lazybytes.net>
Thu, 26 Nov 2009 20:59:35 +0100
changeset 9944 15a1fe1fee5c
parent 9940 2d0f1cde217b (current diff)
parent 9943 f8d779791161 (diff)
child 9945 5e4ef56b4d42
Merge with stable
--- a/hgext/extdiff.py	Wed Nov 25 21:54:47 2009 -0600
+++ b/hgext/extdiff.py	Thu Nov 26 20:59:35 2009 +0100
@@ -43,7 +43,7 @@
 
 from mercurial.i18n import _
 from mercurial.node import short, nullid
-from mercurial import cmdutil, util, commands
+from mercurial import cmdutil, util, commands, encoding
 import os, shlex, shutil, tempfile, re
 
 def snapshot(ui, repo, files, node, tmproot):
@@ -254,7 +254,7 @@
             '''use closure to save diff command to use'''
             def mydiff(ui, repo, *pats, **opts):
                 return dodiff(ui, repo, path, diffopts, pats, opts)
-            mydiff.__doc__ = _('''\
+            doc = _('''\
 use %(path)s to diff repository (or selected files)
 
     Show differences between revisions for the specified files, using the
@@ -265,6 +265,14 @@
     compared to the working directory, and, when no revisions are specified,
     the working directory files are compared to its parent.\
 ''') % dict(path=util.uirepr(path))
+
+            # We must translate the docstring right away since it is
+            # used as a format string. The string will unfortunately
+            # be translated again in commands.helpcmd and this will
+            # fail when the docstring contains non-ASCII characters.
+            # Decoding the string to a Unicode string here (using the
+            # right encoding) prevents that.
+            mydiff.__doc__ = doc.decode(encoding.encoding)
             return mydiff
         cmdtable[cmd] = (save(cmd, path, diffopts),
                          cmdtable['extdiff'][1][1:],
--- a/hgext/keyword.py	Wed Nov 25 21:54:47 2009 -0600
+++ b/hgext/keyword.py	Thu Nov 26 20:59:35 2009 +0100
@@ -111,7 +111,8 @@
         'Revision': '{node|short}',
         'Author': '{author|user}',
         'Date': '{date|utcdate}',
-        'RCSFile': '{file|basename},v',
+        'RCSfile': '{file|basename},v',
+        'RCSFile': '{file|basename},v', # kept only for backwards compatibility
         'Source': '{root}/{file},v',
         'Id': '{file|basename},v {node|short} {date|utcdate} {author|user}',
         'Header': '{root}/{file},v {node|short} {date|utcdate} {author|user}',
@@ -288,7 +289,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 +337,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	Wed Nov 25 21:54:47 2009 -0600
+++ b/tests/test-keyword.out	Thu Nov 26 20:59:35 2009 +0100
@@ -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]