##// END OF EJS Templates
extdiff: prevent exception on double-translation...
Martin Geisler -
r9941:11d7ee94 stable
parent child Browse files
Show More
@@ -43,7 +43,7 b' fast (at least faster than having to com'
43
43
44 from mercurial.i18n import _
44 from mercurial.i18n import _
45 from mercurial.node import short, nullid
45 from mercurial.node import short, nullid
46 from mercurial import cmdutil, util, commands
46 from mercurial import cmdutil, util, commands, encoding
47 import os, shlex, shutil, tempfile, re
47 import os, shlex, shutil, tempfile, re
48
48
49 def snapshot(ui, repo, files, node, tmproot):
49 def snapshot(ui, repo, files, node, tmproot):
@@ -254,7 +254,7 b' def uisetup(ui):'
254 '''use closure to save diff command to use'''
254 '''use closure to save diff command to use'''
255 def mydiff(ui, repo, *pats, **opts):
255 def mydiff(ui, repo, *pats, **opts):
256 return dodiff(ui, repo, path, diffopts, pats, opts)
256 return dodiff(ui, repo, path, diffopts, pats, opts)
257 mydiff.__doc__ = _('''\
257 doc = _('''\
258 use %(path)s to diff repository (or selected files)
258 use %(path)s to diff repository (or selected files)
259
259
260 Show differences between revisions for the specified files, using the
260 Show differences between revisions for the specified files, using the
@@ -265,6 +265,14 b' use %(path)s to diff repository (or sele'
265 compared to the working directory, and, when no revisions are specified,
265 compared to the working directory, and, when no revisions are specified,
266 the working directory files are compared to its parent.\
266 the working directory files are compared to its parent.\
267 ''') % dict(path=util.uirepr(path))
267 ''') % dict(path=util.uirepr(path))
268
269 # We must translate the docstring right away since it is
270 # used as a format string. The string will unfortunately
271 # be translated again in commands.helpcmd and this will
272 # fail when the docstring contains non-ASCII characters.
273 # Decoding the string to a Unicode string here (using the
274 # right encoding) prevents that.
275 mydiff.__doc__ = doc.decode(encoding.encoding)
268 return mydiff
276 return mydiff
269 cmdtable[cmd] = (save(cmd, path, diffopts),
277 cmdtable[cmd] = (save(cmd, path, diffopts),
270 cmdtable['extdiff'][1][1:],
278 cmdtable['extdiff'][1][1:],
General Comments 0
You need to be logged in to leave comments. Login now