Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 3649:e50891e461e4
Consolidate brinfo handling
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 15 Nov 2006 15:51:58 -0600 |
parents | b984dcb1df71 |
children | 731e739b8659 |
line wrap: on
line diff
--- a/mercurial/commands.py Wed Nov 15 15:51:58 2006 -0600 +++ b/mercurial/commands.py Wed Nov 15 15:51:58 2006 -0600 @@ -703,7 +703,7 @@ # create the right base # XXX: nodesbetween / changegroup* should be "fixed" instead o = [] - has = {nullid: None} + has = {nullid: None} for n in base: has.update(repo.changelog.reachable(n)) if revs: @@ -1434,14 +1434,9 @@ heads = repo.heads(repo.lookup(opts['rev'])) else: heads = repo.heads() - br = None - if opts['branches']: - ui.warn(_("the --branches option is deprecated, " - "please use 'hg branches' instead\n")) - br = repo.branchlookup(heads) displayer = cmdutil.show_changeset(ui, repo, opts) for n in heads: - displayer.show(changenode=n, brinfo=br) + displayer.show(changenode=n) def identify(ui, repo): """print information about the working copy @@ -1672,10 +1667,6 @@ getchange = util.cachefunc(lambda r:repo.changectx(r).changeset()) changeiter, matchfn = walkchangerevs(ui, repo, pats, getchange, opts) - if opts['branches']: - ui.warn(_("the --branches option is deprecated, " - "please use 'hg branches' instead\n")) - if opts['limit']: try: limit = int(opts['limit']) @@ -1745,10 +1736,6 @@ if miss: continue - br = None - if opts['branches']: - br = repo.branchlookup([repo.changelog.node(rev)]) - copies = [] if opts.get('copies') and rev: mf = getchange(rev)[0] @@ -1756,7 +1743,7 @@ rename = getrenamed(fn, rev, mf) if rename: copies.append((fn, rename[0])) - displayer.show(rev, changenode, brinfo=br, copies=copies) + displayer.show(rev, changenode, copies=copies) elif st == 'iter': if count == limit: break if displayer.flush(rev): @@ -1850,7 +1837,7 @@ continue displayer.show(changenode=n) -def parents(ui, repo, file_=None, rev=None, branches=None, **opts): +def parents(ui, repo, file_=None, rev=None, **opts): """show the parents of the working dir or revision Print the working directory's parent revisions. @@ -1875,15 +1862,10 @@ else: p = repo.dirstate.parents() - br = None - if branches is not None: - ui.warn(_("the --branches option is deprecated, " - "please use 'hg branches' instead\n")) - br = repo.branchlookup(p) displayer = cmdutil.show_changeset(ui, repo, opts) for n in p: if n != nullid: - displayer.show(changenode=n, brinfo=br) + displayer.show(changenode=n) def paths(ui, repo, search=None): """show definition of symbolic path names @@ -2501,13 +2483,7 @@ Show the tip revision. """ - n = repo.changelog.tip() - br = None - if opts['branches']: - ui.warn(_("the --branches option is deprecated, " - "please use 'hg branches' instead\n")) - br = repo.branchlookup([n]) - cmdutil.show_changeset(ui, repo, opts).show(changenode=n, brinfo=br) + cmdutil.show_changeset(ui, repo, opts).show(repo.changelog.count()-1) def unbundle(ui, repo, fname, **opts): """apply a changegroup file @@ -2574,8 +2550,7 @@ 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, brinfo=br) + cmdutil.show_changeset(ui, repo, {}).show(changenode=x) raise util.Abort("") if len(found) == 1: node = found[0]