comparison mercurial/commands.py @ 1907:7718885070b1

let commands that show changesets use templates. mechanism is same as hgweb templates. old show_changeset code is still used for now if no template given, because it is faster than template code when verbose or debug. simple template can be given on command line using -t, --template. example: hg log -t '{author|person}\n' complex template can be put in template map file, given on command line using --map-file. we give two example map files: map-log.compact prints 3 lines of output for every change. map-log.verbose prints exact same output as default "hg log -v". map files are searched where user says, then in template path as backup. example: hg log --map-file map-log.compact defaults can be set in hgrc with ui.logtemplate and ui.logmap.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Mon, 27 Feb 2006 13:18:57 -0800
parents 414e81ae971f
children be71c04d62c0
comparison
equal deleted inserted replaced
1906:9dec2479622d 1907:7718885070b1
7 7
8 from demandload import demandload 8 from demandload import demandload
9 from node import * 9 from node import *
10 from i18n import gettext as _ 10 from i18n import gettext as _
11 demandload(globals(), "os re sys signal shutil imp urllib pdb") 11 demandload(globals(), "os re sys signal shutil imp urllib pdb")
12 demandload(globals(), "fancyopts ui hg util lock revlog") 12 demandload(globals(), "fancyopts ui hg util lock revlog templater")
13 demandload(globals(), "fnmatch hgweb mdiff random signal time traceback") 13 demandload(globals(), "fnmatch hgweb mdiff random signal time traceback")
14 demandload(globals(), "errno socket version struct atexit sets bz2") 14 demandload(globals(), "errno socket version struct atexit sets bz2")
15 15
16 class UnknownCommand(Exception): 16 class UnknownCommand(Exception):
17 """Exception raised if command is not in the command table.""" 17 """Exception raised if command is not in the command table."""
335 user = revcache.get(rev) 335 user = revcache.get(rev)
336 if user is None: 336 if user is None:
337 user = revcache[rev] = ui.shortuser(name) 337 user = revcache[rev] = ui.shortuser(name)
338 return user 338 return user
339 339
340 def show_changeset(ui, repo, rev=0, changenode=None, brinfo=None): 340 class changeset_templater(object):
341 """show a single changeset or file revision""" 341 def __init__(self, ui, repo, mapfile):
342 log = repo.changelog 342 self.t = templater.templater(mapfile, templater.common_filters)
343 if changenode is None: 343 self.ui = ui
344 changenode = log.node(rev) 344 self.repo = repo
345 elif not rev: 345
346 rev = log.rev(changenode) 346 def use_template(self, t):
347 347 self.t.cache['template'] = t
348 if ui.quiet: 348
349 ui.write("%d:%s\n" % (rev, short(changenode))) 349 def write(self, thing):
350 return 350 for t in thing:
351 351 if hasattr(t, '__iter__'):
352 changes = log.read(changenode) 352 self.write(t)
353 date = util.datestr(changes[2]) 353 else:
354 354 self.ui.write(t)
355 parents = [(log.rev(p), ui.verbose and hex(p) or short(p)) 355
356 for p in log.parents(changenode) 356 def show(self, rev=0, changenode=None, brinfo=None):
357 if ui.debugflag or p != nullid] 357 """show a single changeset or file revision"""
358 if not ui.debugflag and len(parents) == 1 and parents[0][0] == rev-1: 358 log = self.repo.changelog
359 parents = [] 359 if changenode is None:
360 360 changenode = log.node(rev)
361 if ui.verbose: 361 elif not rev:
362 ui.write(_("changeset: %d:%s\n") % (rev, hex(changenode))) 362 rev = log.rev(changenode)
363
364 changes = log.read(changenode)
365
366 def showlist(name, values, plural=None, **args):
367 if plural: names = plural
368 else: names = name + 's'
369 if not values:
370 noname = 'no_' + names
371 if noname in self.t:
372 yield self.t(noname, **args)
373 return
374 vargs = args.copy()
375 if name not in self.t:
376 yield ' '.join(values)
377 return
378 startname = 'start_' + names
379 if startname in self.t:
380 yield self.t(startname, **args)
381 def one(v):
382 try:
383 vargs.update(v)
384 except ValueError:
385 vargs.update([(name, v)])
386 return self.t(name, **vargs)
387 lastname = 'last_' + name
388 if lastname in self.t:
389 last = values.pop()
390 else:
391 last = None
392 for v in values:
393 yield one(v)
394 if last is not None:
395 name = lastname
396 yield one(last)
397 endname = 'end_' + names
398 if endname in self.t:
399 yield self.t(endname, **args)
400
401 if brinfo:
402 def showbranches(**args):
403 if changenode in brinfo:
404 for x in showlist('branch', brinfo[changenode],
405 plural='branches', **args):
406 yield x
407 else:
408 showbranches = ''
409
410 def showmanifest(**args):
411 args = args.copy()
412 args.update(rev=self.repo.manifest.rev(changes[0]),
413 node=hex(changes[0]))
414 yield self.t('manifest', **args)
415
416 def showparents(**args):
417 parents = [[('rev', log.rev(p)), ('node', hex(p))]
418 for p in log.parents(changenode)
419 if self.ui.debugflag or p != nullid]
420 if (not self.ui.debugflag and len(parents) == 1 and
421 parents[0][0][1] == rev - 1):
422 return
423 for x in showlist('parent', parents, **args):
424 yield x
425
426 def showtags(**args):
427 for x in showlist('tag', self.repo.nodetags(changenode), **args):
428 yield x
429
430 if self.ui.debugflag:
431 files = self.repo.changes(log.parents(changenode)[0], changenode)
432 def showfiles(**args):
433 for x in showlist('file', files[0], **args): yield x
434 def showadds(**args):
435 for x in showlist('file_add', files[1], **args): yield x
436 def showdels(**args):
437 for x in showlist('file_del', files[2], **args): yield x
438 else:
439 def showfiles(**args):
440 for x in showlist('file', changes[3], **args): yield x
441 showadds = ''
442 showdels = ''
443
444 props = {
445 'author': changes[1],
446 'branches': showbranches,
447 'date': changes[2],
448 'desc': changes[4],
449 'file_adds': showadds,
450 'file_dels': showdels,
451 'files': showfiles,
452 'manifest': showmanifest,
453 'node': hex(changenode),
454 'parents': showparents,
455 'rev': rev,
456 'tags': showtags,
457 }
458
459 try:
460 self.write(self.t('template', **props))
461 except KeyError, inst:
462 raise util.Abort(_("%s: no key named '%s'") % (self.t.mapfile,
463 inst.args[0]))
464 except SyntaxError, inst:
465 raise util.Abort(_('%s: %s') % (self.t.mapfile, inst.args[0]))
466
467 class changeset_printer(object):
468 def __init__(self, ui, repo):
469 self.ui = ui
470 self.repo = repo
471
472 def show(self, rev=0, changenode=None, brinfo=None):
473 """show a single changeset or file revision"""
474 log = self.repo.changelog
475 if changenode is None:
476 changenode = log.node(rev)
477 elif not rev:
478 rev = log.rev(changenode)
479
480 if self.ui.quiet:
481 self.ui.write("%d:%s\n" % (rev, short(changenode)))
482 return
483
484 changes = log.read(changenode)
485 date = util.datestr(changes[2])
486
487 parents = [(log.rev(p), self.ui.verbose and hex(p) or short(p))
488 for p in log.parents(changenode)
489 if self.ui.debugflag or p != nullid]
490 if (not self.ui.debugflag and len(parents) == 1 and
491 parents[0][0] == rev-1):
492 parents = []
493
494 if self.ui.verbose:
495 self.ui.write(_("changeset: %d:%s\n") % (rev, hex(changenode)))
496 else:
497 self.ui.write(_("changeset: %d:%s\n") % (rev, short(changenode)))
498
499 for tag in self.repo.nodetags(changenode):
500 self.ui.status(_("tag: %s\n") % tag)
501 for parent in parents:
502 self.ui.write(_("parent: %d:%s\n") % parent)
503
504 if brinfo and changenode in brinfo:
505 br = brinfo[changenode]
506 self.ui.write(_("branch: %s\n") % " ".join(br))
507
508 self.ui.debug(_("manifest: %d:%s\n") %
509 (self.repo.manifest.rev(changes[0]), hex(changes[0])))
510 self.ui.status(_("user: %s\n") % changes[1])
511 self.ui.status(_("date: %s\n") % date)
512
513 if self.ui.debugflag:
514 files = self.repo.changes(log.parents(changenode)[0], changenode)
515 for key, value in zip([_("files:"), _("files+:"), _("files-:")],
516 files):
517 if value:
518 self.ui.note("%-12s %s\n" % (key, " ".join(value)))
519 else:
520 self.ui.note(_("files: %s\n") % " ".join(changes[3]))
521
522 description = changes[4].strip()
523 if description:
524 if self.ui.verbose:
525 self.ui.status(_("description:\n"))
526 self.ui.status(description)
527 self.ui.status("\n\n")
528 else:
529 self.ui.status(_("summary: %s\n") %
530 description.splitlines()[0])
531 self.ui.status("\n")
532
533 def show_changeset(ui, repo, opts):
534 tmpl = opts.get('template')
535 if tmpl:
536 tmpl = templater.parsestring(tmpl, quoted=False)
363 else: 537 else:
364 ui.write(_("changeset: %d:%s\n") % (rev, short(changenode))) 538 tmpl = ui.config('ui', 'logtemplate')
365 539 if tmpl: tmpl = templater.parsestring(tmpl)
366 for tag in repo.nodetags(changenode): 540 mapfile = opts.get('map_file') or ui.config('ui', 'logmap')
367 ui.status(_("tag: %s\n") % tag) 541 if tmpl or mapfile:
368 for parent in parents: 542 if mapfile:
369 ui.write(_("parent: %d:%s\n") % parent) 543 if not os.path.isfile(mapfile):
370 544 mapname = templater.templatepath(mapfile)
371 if brinfo and changenode in brinfo: 545 if mapname: mapfile = mapname
372 br = brinfo[changenode] 546 try:
373 ui.write(_("branch: %s\n") % " ".join(br)) 547 t = changeset_templater(ui, repo, mapfile)
374 548 except SyntaxError, inst:
375 ui.debug(_("manifest: %d:%s\n") % (repo.manifest.rev(changes[0]), 549 raise util.Abort(inst.args[0])
376 hex(changes[0]))) 550 if tmpl: t.use_template(tmpl)
377 ui.status(_("user: %s\n") % changes[1]) 551 return t
378 ui.status(_("date: %s\n") % date) 552 return changeset_printer(ui, repo)
379
380 if ui.debugflag:
381 files = repo.changes(log.parents(changenode)[0], changenode)
382 for key, value in zip([_("files:"), _("files+:"), _("files-:")], files):
383 if value:
384 ui.note("%-12s %s\n" % (key, " ".join(value)))
385 else:
386 ui.note(_("files: %s\n") % " ".join(changes[3]))
387
388 description = changes[4].strip()
389 if description:
390 if ui.verbose:
391 ui.status(_("description:\n"))
392 ui.status(description)
393 ui.status("\n\n")
394 else:
395 ui.status(_("summary: %s\n") % description.splitlines()[0])
396 ui.status("\n")
397 553
398 def show_version(ui): 554 def show_version(ui):
399 """output version and copyright information""" 555 """output version and copyright information"""
400 ui.write(_("Mercurial Distributed SCM (version %s)\n") 556 ui.write(_("Mercurial Distributed SCM (version %s)\n")
401 % version.get_version()) 557 % version.get_version())
1407 else: 1563 else:
1408 heads = repo.heads() 1564 heads = repo.heads()
1409 br = None 1565 br = None
1410 if opts['branches']: 1566 if opts['branches']:
1411 br = repo.branchlookup(heads) 1567 br = repo.branchlookup(heads)
1568 displayer = show_changeset(ui, repo, opts)
1412 for n in heads: 1569 for n in heads:
1413 show_changeset(ui, repo, changenode=n, brinfo=br) 1570 displayer.show(changenode=n, brinfo=br)
1414 1571
1415 def identify(ui, repo): 1572 def identify(ui, repo):
1416 """print information about the working copy 1573 """print information about the working copy
1417 1574
1418 Print a short summary of the current state of the repo. 1575 Print a short summary of the current state of the repo.
1535 if not o: 1692 if not o:
1536 return 1693 return
1537 o = other.changelog.nodesbetween(o)[0] 1694 o = other.changelog.nodesbetween(o)[0]
1538 if opts['newest_first']: 1695 if opts['newest_first']:
1539 o.reverse() 1696 o.reverse()
1697 displayer = show_changeset(ui, other, opts)
1540 for n in o: 1698 for n in o:
1541 parents = [p for p in other.changelog.parents(n) if p != nullid] 1699 parents = [p for p in other.changelog.parents(n) if p != nullid]
1542 if opts['no_merges'] and len(parents) == 2: 1700 if opts['no_merges'] and len(parents) == 2:
1543 continue 1701 continue
1544 show_changeset(ui, other, changenode=n) 1702 displayer.show(changenode=n)
1545 if opts['patch']: 1703 if opts['patch']:
1546 prev = (parents and parents[0]) or nullid 1704 prev = (parents and parents[0]) or nullid
1547 dodiff(ui, ui, other, prev, n) 1705 dodiff(ui, ui, other, prev, n)
1548 ui.write("\n") 1706 ui.write("\n")
1549 1707
1636 if limit <= 0: raise util.Abort(_('limit must be positive')) 1794 if limit <= 0: raise util.Abort(_('limit must be positive'))
1637 else: 1795 else:
1638 limit = sys.maxint 1796 limit = sys.maxint
1639 count = 0 1797 count = 0
1640 1798
1799 displayer = show_changeset(ui, repo, opts)
1641 for st, rev, fns in changeiter: 1800 for st, rev, fns in changeiter:
1642 if st == 'window': 1801 if st == 'window':
1643 du = dui(ui) 1802 du = dui(ui)
1803 displayer.ui = du
1644 elif st == 'add': 1804 elif st == 'add':
1645 du.bump(rev) 1805 du.bump(rev)
1646 changenode = repo.changelog.node(rev) 1806 changenode = repo.changelog.node(rev)
1647 parents = [p for p in repo.changelog.parents(changenode) 1807 parents = [p for p in repo.changelog.parents(changenode)
1648 if p != nullid] 1808 if p != nullid]
1665 1825
1666 br = None 1826 br = None
1667 if opts['branches']: 1827 if opts['branches']:
1668 br = repo.branchlookup([repo.changelog.node(rev)]) 1828 br = repo.branchlookup([repo.changelog.node(rev)])
1669 1829
1670 show_changeset(du, repo, rev, brinfo=br) 1830 displayer.show(rev, brinfo=br)
1671 if opts['patch']: 1831 if opts['patch']:
1672 prev = (parents and parents[0]) or nullid 1832 prev = (parents and parents[0]) or nullid
1673 dodiff(du, du, repo, prev, changenode, match=matchfn) 1833 dodiff(du, du, repo, prev, changenode, match=matchfn)
1674 du.write("\n\n") 1834 du.write("\n\n")
1675 elif st == 'iter': 1835 elif st == 'iter':
1716 other = hg.repository(ui, dest) 1876 other = hg.repository(ui, dest)
1717 o = repo.findoutgoing(other) 1877 o = repo.findoutgoing(other)
1718 o = repo.changelog.nodesbetween(o)[0] 1878 o = repo.changelog.nodesbetween(o)[0]
1719 if opts['newest_first']: 1879 if opts['newest_first']:
1720 o.reverse() 1880 o.reverse()
1881 displayer = show_changeset(ui, repo, opts)
1721 for n in o: 1882 for n in o:
1722 parents = [p for p in repo.changelog.parents(n) if p != nullid] 1883 parents = [p for p in repo.changelog.parents(n) if p != nullid]
1723 if opts['no_merges'] and len(parents) == 2: 1884 if opts['no_merges'] and len(parents) == 2:
1724 continue 1885 continue
1725 show_changeset(ui, repo, changenode=n) 1886 displayer.show(changenode=n)
1726 if opts['patch']: 1887 if opts['patch']:
1727 prev = (parents and parents[0]) or nullid 1888 prev = (parents and parents[0]) or nullid
1728 dodiff(ui, ui, repo, prev, n) 1889 dodiff(ui, ui, repo, prev, n)
1729 ui.write("\n") 1890 ui.write("\n")
1730 1891
1731 def parents(ui, repo, rev=None, branches=None): 1892 def parents(ui, repo, rev=None, branches=None, **opts):
1732 """show the parents of the working dir or revision 1893 """show the parents of the working dir or revision
1733 1894
1734 Print the working directory's parent revisions. 1895 Print the working directory's parent revisions.
1735 """ 1896 """
1736 if rev: 1897 if rev:
1739 p = repo.dirstate.parents() 1900 p = repo.dirstate.parents()
1740 1901
1741 br = None 1902 br = None
1742 if branches is not None: 1903 if branches is not None:
1743 br = repo.branchlookup(p) 1904 br = repo.branchlookup(p)
1905 displayer = show_changeset(ui, repo, opts)
1744 for n in p: 1906 for n in p:
1745 if n != nullid: 1907 if n != nullid:
1746 show_changeset(ui, repo, changenode=n, brinfo=br) 1908 displayer.show(changenode=n, brinfo=br)
1747 1909
1748 def paths(ui, search=None): 1910 def paths(ui, search=None):
1749 """show definition of symbolic path names 1911 """show definition of symbolic path names
1750 1912
1751 Show definition of symbolic path name NAME. If no name is given, show 1913 Show definition of symbolic path name NAME. If no name is given, show
2244 """ 2406 """
2245 n = repo.changelog.tip() 2407 n = repo.changelog.tip()
2246 br = None 2408 br = None
2247 if opts['branches']: 2409 if opts['branches']:
2248 br = repo.branchlookup([n]) 2410 br = repo.branchlookup([n])
2249 show_changeset(ui, repo, changenode=n, brinfo=br) 2411 show_changeset(ui, repo, opts).show(changenode=n, brinfo=br)
2250 if opts['patch']: 2412 if opts['patch']:
2251 dodiff(ui, ui, repo, repo.changelog.parents(n)[0], n) 2413 dodiff(ui, ui, repo, repo.changelog.parents(n)[0], n)
2252 2414
2253 def unbundle(ui, repo, fname, **opts): 2415 def unbundle(ui, repo, fname, **opts):
2254 """apply a changegroup file 2416 """apply a changegroup file
2289 ineffective. 2451 ineffective.
2290 """ 2452 """
2291 repo.undo() 2453 repo.undo()
2292 2454
2293 def update(ui, repo, node=None, merge=False, clean=False, force=None, 2455 def update(ui, repo, node=None, merge=False, clean=False, force=None,
2294 branch=None): 2456 branch=None, **opts):
2295 """update or merge working directory 2457 """update or merge working directory
2296 2458
2297 Update the working directory to the specified revision. 2459 Update the working directory to the specified revision.
2298 2460
2299 If there are no outstanding changes in the working directory and 2461 If there are no outstanding changes in the working directory and
2316 if branch in br[x]: 2478 if branch in br[x]:
2317 found.append(x) 2479 found.append(x)
2318 if len(found) > 1: 2480 if len(found) > 1:
2319 ui.warn(_("Found multiple heads for %s\n") % branch) 2481 ui.warn(_("Found multiple heads for %s\n") % branch)
2320 for x in found: 2482 for x in found:
2321 show_changeset(ui, repo, changenode=x, brinfo=br) 2483 show_changeset(ui, repo, opts).show(changenode=x, brinfo=br)
2322 return 1 2484 return 1
2323 if len(found) == 1: 2485 if len(found) == 1:
2324 node = found[0] 2486 node = found[0]
2325 ui.warn(_("Using head %s for branch %s\n") % (short(node), branch)) 2487 ui.warn(_("Using head %s for branch %s\n") % (short(node), branch))
2326 else: 2488 else:
2460 ('u', 'user', None, _('print user who committed change'))], 2622 ('u', 'user', None, _('print user who committed change'))],
2461 _('hg grep [OPTION]... PATTERN [FILE]...')), 2623 _('hg grep [OPTION]... PATTERN [FILE]...')),
2462 "heads": 2624 "heads":
2463 (heads, 2625 (heads,
2464 [('b', 'branches', None, _('show branches')), 2626 [('b', 'branches', None, _('show branches')),
2465 ('r', 'rev', '', _('show only heads which are descendants of rev'))], 2627 ('', 'map-file', '', _('display using template map file')),
2628 ('r', 'rev', '', _('show only heads which are descendants of rev')),
2629 ('t', 'template', '', _('display with template'))],
2466 _('hg heads [-b] [-r <rev>]')), 2630 _('hg heads [-b] [-r <rev>]')),
2467 "help": (help_, [], _('hg help [COMMAND]')), 2631 "help": (help_, [], _('hg help [COMMAND]')),
2468 "identify|id": (identify, [], _('hg identify')), 2632 "identify|id": (identify, [], _('hg identify')),
2469 "import|patch": 2633 "import|patch":
2470 (import_, 2634 (import_,
2475 _('skip check for outstanding uncommitted changes')), 2639 _('skip check for outstanding uncommitted changes')),
2476 ('b', 'base', '', _('base path'))], 2640 ('b', 'base', '', _('base path'))],
2477 _('hg import [-f] [-p NUM] [-b BASE] PATCH...')), 2641 _('hg import [-f] [-p NUM] [-b BASE] PATCH...')),
2478 "incoming|in": (incoming, 2642 "incoming|in": (incoming,
2479 [('M', 'no-merges', None, _('do not show merges')), 2643 [('M', 'no-merges', None, _('do not show merges')),
2644 ('', 'map-file', '', _('display using template map file')),
2645 ('n', 'newest-first', None, _('show newest record first')),
2480 ('p', 'patch', None, _('show patch')), 2646 ('p', 'patch', None, _('show patch')),
2481 ('n', 'newest-first', None, _('show newest record first'))], 2647 ('t', 'template', '', _('display with template'))],
2482 _('hg incoming [-p] [-n] [-M] [SOURCE]')), 2648 _('hg incoming [-p] [-n] [-M] [SOURCE]')),
2483 "^init": (init, [], _('hg init [DEST]')), 2649 "^init": (init, [], _('hg init [DEST]')),
2484 "locate": 2650 "locate":
2485 (locate, 2651 (locate,
2486 [('r', 'rev', '', _('search the repository as it stood at rev')), 2652 [('r', 'rev', '', _('search the repository as it stood at rev')),
2498 ('b', 'branches', None, _('show branches')), 2664 ('b', 'branches', None, _('show branches')),
2499 ('k', 'keyword', [], _('search for a keyword')), 2665 ('k', 'keyword', [], _('search for a keyword')),
2500 ('l', 'limit', '', _('limit number of changes displayed')), 2666 ('l', 'limit', '', _('limit number of changes displayed')),
2501 ('r', 'rev', [], _('show the specified revision or range')), 2667 ('r', 'rev', [], _('show the specified revision or range')),
2502 ('M', 'no-merges', None, _('do not show merges')), 2668 ('M', 'no-merges', None, _('do not show merges')),
2669 ('', 'map-file', '', _('display using template map file')),
2503 ('m', 'only-merges', None, _('show only merges')), 2670 ('m', 'only-merges', None, _('show only merges')),
2504 ('p', 'patch', None, _('show patch'))], 2671 ('p', 'patch', None, _('show patch')),
2672 ('t', 'template', '', _('display with template'))],
2505 _('hg log [-I] [-X] [-r REV]... [-p] [FILE]')), 2673 _('hg log [-I] [-X] [-r REV]... [-p] [FILE]')),
2506 "manifest": (manifest, [], _('hg manifest [REV]')), 2674 "manifest": (manifest, [], _('hg manifest [REV]')),
2507 "outgoing|out": (outgoing, 2675 "outgoing|out": (outgoing,
2508 [('M', 'no-merges', None, _('do not show merges')), 2676 [('M', 'no-merges', None, _('do not show merges')),
2509 ('p', 'patch', None, _('show patch')), 2677 ('p', 'patch', None, _('show patch')),
2510 ('n', 'newest-first', None, _('show newest record first'))], 2678 ('', 'map-file', '', _('display using template map file')),
2679 ('n', 'newest-first', None, _('show newest record first')),
2680 ('t', 'template', '', _('display with template'))],
2511 _('hg outgoing [-p] [-n] [-M] [DEST]')), 2681 _('hg outgoing [-p] [-n] [-M] [DEST]')),
2512 "^parents": 2682 "^parents":
2513 (parents, 2683 (parents,
2514 [('b', 'branches', None, _('show branches'))], 2684 [('b', 'branches', None, _('show branches')),
2685 ('', 'map-file', '', _('display using template map file')),
2686 ('t', 'template', '', _('display with template'))],
2515 _('hg parents [-b] [REV]')), 2687 _('hg parents [-b] [REV]')),
2516 "paths": (paths, [], _('hg paths [NAME]')), 2688 "paths": (paths, [], _('hg paths [NAME]')),
2517 "^pull": 2689 "^pull":
2518 (pull, 2690 (pull,
2519 [('u', 'update', None, 2691 [('u', 'update', None,
2600 _('hg tag [-r REV] [OPTION]... NAME')), 2772 _('hg tag [-r REV] [OPTION]... NAME')),
2601 "tags": (tags, [], _('hg tags')), 2773 "tags": (tags, [], _('hg tags')),
2602 "tip": 2774 "tip":
2603 (tip, 2775 (tip,
2604 [('b', 'branches', None, _('show branches')), 2776 [('b', 'branches', None, _('show branches')),
2605 ('p', 'patch', None, _('show patch'))], 2777 ('', 'map-file', '', _('display using template map file')),
2778 ('p', 'patch', None, _('show patch')),
2779 ('t', 'template', '', _('display with template'))],
2606 _('hg [-b] [-p] tip')), 2780 _('hg [-b] [-p] tip')),
2607 "unbundle": 2781 "unbundle":
2608 (unbundle, 2782 (unbundle,
2609 [('u', 'update', None, 2783 [('u', 'update', None,
2610 _('update the working directory to tip after unbundle'))], 2784 _('update the working directory to tip after unbundle'))],
2611 _('hg unbundle [-u] FILE')), 2785 _('hg unbundle [-u] FILE')),
2612 "undo": (undo, [], _('hg undo')), 2786 "undo": (undo, [], _('hg undo')),
2613 "^update|up|checkout|co": 2787 "^update|up|checkout|co":
2614 (update, 2788 (update,
2615 [('b', 'branch', '', _('checkout the head of a specific branch')), 2789 [('b', 'branch', '', _('checkout the head of a specific branch')),
2790 ('', 'map-file', '', _('display using template map file')),
2616 ('m', 'merge', None, _('allow merging of branches')), 2791 ('m', 'merge', None, _('allow merging of branches')),
2617 ('C', 'clean', None, _('overwrite locally modified files')), 2792 ('C', 'clean', None, _('overwrite locally modified files')),
2618 ('f', 'force', None, _('force a merge with outstanding changes'))], 2793 ('f', 'force', None, _('force a merge with outstanding changes')),
2794 ('t', 'template', '', _('display with template'))],
2619 _('hg update [-b TAG] [-m] [-C] [-f] [REV]')), 2795 _('hg update [-b TAG] [-m] [-C] [-f] [REV]')),
2620 "verify": (verify, [], _('hg verify')), 2796 "verify": (verify, [], _('hg verify')),
2621 "version": (show_version, [], _('hg version')), 2797 "version": (show_version, [], _('hg version')),
2622 } 2798 }
2623 2799