mercurial/commands.py
changeset 1550 ccb9b62de892
parent 1547 4dea10839201
child 1551 e793cbc8be00
equal deleted inserted replaced
1547:4dea10839201 1550:ccb9b62de892
  1284 
  1284 
  1285     Repository "heads" are changesets that don't have children
  1285     Repository "heads" are changesets that don't have children
  1286     changesets. They are where development generally takes place and
  1286     changesets. They are where development generally takes place and
  1287     are the usual targets for update and merge operations.
  1287     are the usual targets for update and merge operations.
  1288     """
  1288     """
  1289     heads = repo.changelog.heads()
  1289     if opts['rev']:
       
  1290         heads = repo.heads(repo.lookup(rev))
       
  1291     else:
       
  1292         heads = repo.heads()
  1290     br = None
  1293     br = None
  1291     if opts['branches']:
  1294     if opts['branches']:
  1292         br = repo.branchlookup(heads)
  1295         br = repo.branchlookup(list(heads))
  1293     for n in repo.changelog.heads():
  1296     for n in heads:
  1294         show_changeset(ui, repo, changenode=n, brinfo=br)
  1297         show_changeset(ui, repo, changenode=n, brinfo=br)
  1295 
  1298 
  1296 def identify(ui, repo):
  1299 def identify(ui, repo):
  1297     """print information about the working copy
  1300     """print information about the working copy
  1298 
  1301 
  2235           ('r', 'rev', [], _('search in given revision range')),
  2238           ('r', 'rev', [], _('search in given revision range')),
  2236           ('u', 'user', None, _('print user who committed change'))],
  2239           ('u', 'user', None, _('print user who committed change'))],
  2237          "hg grep [OPTION]... PATTERN [FILE]..."),
  2240          "hg grep [OPTION]... PATTERN [FILE]..."),
  2238     "heads":
  2241     "heads":
  2239         (heads,
  2242         (heads,
  2240          [('b', 'branches', None, _('find branch info'))],
  2243          [('b', 'branches', None, _('find branch info')),
  2241          _('hg heads [-b]')),
  2244           ('r', 'rev', None, _('show only heads descendants from rev'))],
       
  2245          _('hg heads [-b] [-r <rev>]')),
  2242     "help": (help_, [], _('hg help [COMMAND]')),
  2246     "help": (help_, [], _('hg help [COMMAND]')),
  2243     "identify|id": (identify, [], _('hg identify')),
  2247     "identify|id": (identify, [], _('hg identify')),
  2244     "import|patch":
  2248     "import|patch":
  2245         (import_,
  2249         (import_,
  2246          [('p', 'strip', 1, _('directory strip option for patch. This has the same\n') +
  2250          [('p', 'strip', 1, _('directory strip option for patch. This has the same\n') +