D5477: branches: add -r option to show branch name(s) of a given rev (issue5948)

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Thu Dec 27 07:13:14 EST 2018


yuja added a comment.


  I tried to queue this, but the patch doesn't include any metadata (e.g. author
  and date.) Please check your configuration.
  
  https://www.mercurial-scm.org/wiki/Phabricator
  
  > +    revs = opts.get('rev')
  >  +    selectedbranches = None
  >  +    if revs:
  >  +        revs = scmutil.revrange(repo, revs)
  >  +        getbi = repo.revbranchcache().branchinfo
  >  +        selectedbranches = {getbi(r)[0] for r in revs}
  >  +
  > 
  >   ui.pager('branches')
  >   fm = ui.formatter('branches', opts)
  >   hexfunc = fm.hexfunc
  > 
  > @@ -1165,6 +1173,8 @@
  > 
  >   allheads = set(repo.heads())
  >   branches = []
  >   for tag, heads, tip, isclosed in repo.branchmap().iterbranches():
  > 
  > +        if selectedbranches and tag not in selectedbranches:
  
  Please update this to `selectedbranches is not None`. You can see a difference
  with `-r 'none()'`.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5477

To: navaneeth.suresh, #hg-reviewers
Cc: pulkit, yuja, mercurial-devel


More information about the Mercurial-devel mailing list