##// END OF EJS Templates
Merge with stable
Martin Geisler -
r9944:15a1fe1f merge default
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:],
@@ -111,7 +111,8 b' class kwtemplater(object):'
111 'Revision': '{node|short}',
111 'Revision': '{node|short}',
112 'Author': '{author|user}',
112 'Author': '{author|user}',
113 'Date': '{date|utcdate}',
113 'Date': '{date|utcdate}',
114 'RCSFile': '{file|basename},v',
114 'RCSfile': '{file|basename},v',
115 'RCSFile': '{file|basename},v', # kept only for backwards compatibility
115 'Source': '{root}/{file},v',
116 'Source': '{root}/{file},v',
116 'Id': '{file|basename},v {node|short} {date|utcdate} {author|user}',
117 'Id': '{file|basename},v {node|short} {date|utcdate} {author|user}',
117 'Header': '{root}/{file},v {node|short} {date|utcdate} {author|user}',
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 def demoitems(section, items):
290 def demoitems(section, items):
290 ui.write('[%s]\n' % section)
291 ui.write('[%s]\n' % section)
291 for k, v in items:
292 for k, v in sorted(items):
292 ui.write('%s = %s\n' % (k, v))
293 ui.write('%s = %s\n' % (k, v))
293
294
294 msg = 'hg keyword config and expansion example'
295 msg = 'hg keyword config and expansion example'
@@ -336,7 +337,7 b' def demo(ui, repo, *args, **opts):'
336 ui.write('[extensions]\n%s\n' % extension)
337 ui.write('[extensions]\n%s\n' % extension)
337 demoitems('keyword', ui.configitems('keyword'))
338 demoitems('keyword', ui.configitems('keyword'))
338 demoitems('keywordmaps', kwmaps.iteritems())
339 demoitems('keywordmaps', kwmaps.iteritems())
339 keywords = '$' + '$\n$'.join(kwmaps.keys()) + '$\n'
340 keywords = '$' + '$\n$'.join(sorted(kwmaps.keys())) + '$\n'
340 repo.wopener(fn, 'w').write(keywords)
341 repo.wopener(fn, 'w').write(keywords)
341 repo.add([fn])
342 repo.add([fn])
342 path = repo.wjoin(fn)
343 path = repo.wjoin(fn)
@@ -4,20 +4,22 b' hgext.keyword ='
4 [keyword]
4 [keyword]
5 demo.txt =
5 demo.txt =
6 [keywordmaps]
6 [keywordmaps]
7 RCSFile = {file|basename},v
8 Author = {author|user}
7 Author = {author|user}
8 Date = {date|utcdate}
9 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
9 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
10 Source = {root}/{file},v
11 Date = {date|utcdate}
12 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
10 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
11 RCSFile = {file|basename},v
12 RCSfile = {file|basename},v
13 Revision = {node|short}
13 Revision = {node|short}
14 $RCSFile: demo.txt,v $
14 Source = {root}/{file},v
15 $Author: test $
15 $Author: test $
16 $Date: 2000/00/00 00:00:00 $
16 $Header: /TMP/demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $
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 $Source: /TMP/demo.txt,v $
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 [extensions]
23 [extensions]
22 hgext.keyword =
24 hgext.keyword =
23 [keyword]
25 [keyword]
General Comments 0
You need to be logged in to leave comments. Login now