diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -240,8 +240,7 @@ def backout(ui, repo, rev, **opts): if op1 != node: if opts['merge']: ui.status(_('merging with changeset %s\n') % nice(op1)) - n = _lookup(repo, hex(op1)) - hg.merge(repo, n) + hg.merge(repo, hex(op1)) else: ui.status(_('the backout changeset is a new head - ' 'do not forget to merge\n')) @@ -1698,7 +1697,6 @@ def log(ui, repo, *pats, **opts): if opts["date"]: df = util.matchdate(opts["date"]) - displayer = cmdutil.show_changeset(ui, repo, opts, True, matchfn) for st, rev, fns in changeiter: if st == 'add': @@ -1763,7 +1761,7 @@ def manifest(ui, repo, rev=None): ui.write("%3s " % (m.execf(f) and "755" or "644")) ui.write("%s\n" % f) -def merge(ui, repo, node=None, force=None, branch=None): +def merge(ui, repo, node=None, force=None): """Merge working directory with another revision Merge the contents of the current working directory and the @@ -1777,9 +1775,7 @@ def merge(ui, repo, node=None, force=Non revision to merge with must be provided. """ - if node or branch: - node = _lookup(repo, node, branch) - else: + if not node: heads = repo.heads() if len(heads) > 2: raise util.Abort(_('repo has %d heads - ' @@ -2478,7 +2474,7 @@ def unbundle(ui, repo, fname, **opts): modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname) return postincoming(ui, repo, modheads, opts['update']) -def update(ui, repo, node=None, clean=False, branch=None, date=None): +def update(ui, repo, node=None, clean=False, date=None): """update or merge working directory Update the working directory to the specified revision. @@ -2498,36 +2494,11 @@ def update(ui, repo, node=None, clean=Fa raise util.Abort(_("you can't specify a revision and a date")) node = cmdutil.finddate(ui, repo, date) - node = _lookup(repo, node, branch) if clean: return hg.clean(repo, node) else: return hg.update(repo, node) -def _lookup(repo, node, branch=None): - if branch: - repo.ui.warn(_("the --branch option is deprecated, " - "please use 'hg branch' instead\n")) - br = repo.branchlookup(branch=branch) - found = [] - for x in br: - if branch in br[x]: - found.append(x) - if len(found) > 1: - repo.ui.warn(_("Found multiple heads for %s\n") % branch) - for x in found: - cmdutil.show_changeset(ui, repo, {}).show(changenode=x) - raise util.Abort("") - if len(found) == 1: - node = found[0] - repo.ui.warn(_("Using head %s for branch %s\n") - % (short(node), branch)) - else: - raise util.Abort(_("branch %s not found") % branch) - else: - node = node and repo.lookup(node) or repo.changelog.tip() - return node - def verify(ui, repo): """verify the integrity of the repository @@ -2733,8 +2704,7 @@ table = { _('hg grep [OPTION]... PATTERN [FILE]...')), "heads": (heads, - [('b', 'branches', None, _('show branches (DEPRECATED)')), - ('', 'style', '', _('display using template map file')), + [('', 'style', '', _('display using template map file')), ('r', 'rev', '', _('show only heads which are descendants of rev')), ('', 'template', '', _('display with template'))], _('hg heads [-r REV]')), @@ -2745,7 +2715,7 @@ table = { [('p', 'strip', 1, _('directory strip option for patch. This has the same\n' 'meaning as the corresponding patch option')), - ('b', 'base', '', _('base path (DEPRECATED)')), + ('b', 'base', '', _('base path')), ('f', 'force', None, _('skip check for outstanding uncommitted changes'))] + commitopts, _('hg import [-p NUM] [-m MESSAGE] [-f] PATCH...')), @@ -2775,8 +2745,7 @@ table = { _('hg locate [OPTION]... [PATTERN]...')), "^log|history": (log, - [('b', 'branches', None, _('show branches (DEPRECATED)')), - ('f', 'follow', None, + [('f', 'follow', None, _('follow changeset history, or file history across copies and renames')), ('', 'follow-first', None, _('only follow the first parent of merge changesets')), @@ -2797,8 +2766,7 @@ table = { "manifest": (manifest, [], _('hg manifest [REV]')), "merge": (merge, - [('b', 'branch', '', _('merge with head of a specific branch (DEPRECATED)')), - ('f', 'force', None, _('force a merge with outstanding changes'))], + [('f', 'force', None, _('force a merge with outstanding changes'))], _('hg merge [-f] [REV]')), "outgoing|out": (outgoing, [('M', 'no-merges', None, _('do not show merges')), @@ -2813,8 +2781,7 @@ table = { _('hg outgoing [-M] [-p] [-n] [-r REV]... [DEST]')), "^parents": (parents, - [('b', 'branches', None, _('show branches (DEPRECATED)')), - ('r', 'rev', '', _('show parents from the specified rev')), + [('r', 'rev', '', _('show parents from the specified rev')), ('', 'style', '', _('display using template map file')), ('', 'template', '', _('display with template'))], _('hg parents [-r REV] [FILE]')), @@ -2916,8 +2883,7 @@ table = { "tags": (tags, [], _('hg tags')), "tip": (tip, - [('b', 'branches', None, _('show branches (DEPRECATED)')), - ('', 'style', '', _('display using template map file')), + [('', 'style', '', _('display using template map file')), ('p', 'patch', None, _('show patch')), ('', 'template', '', _('display with template'))], _('hg tip [-p]')), @@ -2928,9 +2894,7 @@ table = { _('hg unbundle [-u] FILE')), "^update|up|checkout|co": (update, - [('b', 'branch', '', - _('checkout the head of a specific branch (DEPRECATED)')), - ('C', 'clean', None, _('overwrite locally modified files')), + [('C', 'clean', None, _('overwrite locally modified files')), ('d', 'date', '', _('tipmost revision matching date'))], _('hg update [-C] [REV]')), "verify": (verify, [], _('hg verify')),