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

Yuya Nishihara yuya at tcha.org
Thu Dec 27 07:12:13 EST 2018


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()'`.


More information about the Mercurial-devel mailing list