Show More
@@ -43,7 +43,7 b' fast (at least faster than having to com' | |||
|
43 | 43 | |
|
44 | 44 | from mercurial.i18n import _ |
|
45 | 45 | from mercurial.node import short, nullid |
|
46 | from mercurial import cmdutil, util, commands | |
|
46 | from mercurial import cmdutil, util, commands, encoding | |
|
47 | 47 | import os, shlex, shutil, tempfile, re |
|
48 | 48 | |
|
49 | 49 | def snapshot(ui, repo, files, node, tmproot): |
@@ -254,7 +254,7 b' def uisetup(ui):' | |||
|
254 | 254 | '''use closure to save diff command to use''' |
|
255 | 255 | def mydiff(ui, repo, *pats, **opts): |
|
256 | 256 | return dodiff(ui, repo, path, diffopts, pats, opts) |
|
257 |
|
|
|
257 | doc = _('''\ | |
|
258 | 258 | use %(path)s to diff repository (or selected files) |
|
259 | 259 | |
|
260 | 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 | 265 | compared to the working directory, and, when no revisions are specified, |
|
266 | 266 | the working directory files are compared to its parent.\ |
|
267 | 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 | 276 | return mydiff |
|
269 | 277 | cmdtable[cmd] = (save(cmd, path, diffopts), |
|
270 | 278 | cmdtable['extdiff'][1][1:], |
@@ -111,7 +111,8 b' class kwtemplater(object):' | |||
|
111 | 111 | 'Revision': '{node|short}', |
|
112 | 112 | 'Author': '{author|user}', |
|
113 | 113 | 'Date': '{date|utcdate}', |
|
114 |
'RCS |
|
|
114 | 'RCSfile': '{file|basename},v', | |
|
115 | 'RCSFile': '{file|basename},v', # kept only for backwards compatibility | |
|
115 | 116 | 'Source': '{root}/{file},v', |
|
116 | 117 | 'Id': '{file|basename},v {node|short} {date|utcdate} {author|user}', |
|
117 | 118 | 'Header': '{root}/{file},v {node|short} {date|utcdate} {author|user}', |
@@ -288,7 +289,7 b' def demo(ui, repo, *args, **opts):' | |||
|
288 | 289 | ''' |
|
289 | 290 | def demoitems(section, items): |
|
290 | 291 | ui.write('[%s]\n' % section) |
|
291 | for k, v in items: | |
|
292 | for k, v in sorted(items): | |
|
292 | 293 | ui.write('%s = %s\n' % (k, v)) |
|
293 | 294 | |
|
294 | 295 | msg = 'hg keyword config and expansion example' |
@@ -336,7 +337,7 b' def demo(ui, repo, *args, **opts):' | |||
|
336 | 337 | ui.write('[extensions]\n%s\n' % extension) |
|
337 | 338 | demoitems('keyword', ui.configitems('keyword')) |
|
338 | 339 | demoitems('keywordmaps', kwmaps.iteritems()) |
|
339 | keywords = '$' + '$\n$'.join(kwmaps.keys()) + '$\n' | |
|
340 | keywords = '$' + '$\n$'.join(sorted(kwmaps.keys())) + '$\n' | |
|
340 | 341 | repo.wopener(fn, 'w').write(keywords) |
|
341 | 342 | repo.add([fn]) |
|
342 | 343 | path = repo.wjoin(fn) |
@@ -4,20 +4,22 b' hgext.keyword =' | |||
|
4 | 4 | [keyword] |
|
5 | 5 | demo.txt = |
|
6 | 6 | [keywordmaps] |
|
7 | RCSFile = {file|basename},v | |
|
8 | 7 | Author = {author|user} |
|
8 | Date = {date|utcdate} | |
|
9 | 9 | Header = {root}/{file},v {node|short} {date|utcdate} {author|user} |
|
10 | Source = {root}/{file},v | |
|
11 | Date = {date|utcdate} | |
|
12 | 10 | Id = {file|basename},v {node|short} {date|utcdate} {author|user} |
|
11 | RCSFile = {file|basename},v | |
|
12 | RCSfile = {file|basename},v | |
|
13 | 13 | Revision = {node|short} |
|
14 | $RCSFile: demo.txt,v $ | |
|
14 | Source = {root}/{file},v | |
|
15 | 15 | $Author: test $ |
|
16 | $Date: 2000/00/00 00:00:00 $ | |
|
16 | 17 | $Header: /TMP/demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $ |
|
18 | $Id: demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $ | |
|
19 | $RCSFile: demo.txt,v $ | |
|
20 | $RCSfile: demo.txt,v $ | |
|
21 | $Revision: xxxxxxxxxxxx $ | |
|
17 | 22 | $Source: /TMP/demo.txt,v $ |
|
18 | $Date: 2000/00/00 00:00:00 $ | |
|
19 | $Id: demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $ | |
|
20 | $Revision: xxxxxxxxxxxx $ | |
|
21 | 23 | [extensions] |
|
22 | 24 | hgext.keyword = |
|
23 | 25 | [keyword] |
General Comments 0
You need to be logged in to leave comments.
Login now