Submitter | phabricator |
---|---|
Date | Dec. 26, 2018, 2:39 p.m. |
Message ID | <811f5fe8cce7833c0854ff2b906f33d2@localhost.localdomain> |
Download | mbox | patch |
Permalink | /patch/37351/ |
State | Not Applicable |
Headers | show |
Comments
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()'`.
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
Patch
diff --git a/tests/test-completion.t b/tests/test-completion.t --- a/tests/test-completion.t +++ b/tests/test-completion.t @@ -238,7 +238,7 @@ bisect: reset, good, bad, skip, extend, command, noupdate bookmarks: force, rev, delete, rename, inactive, list, template branch: force, clean, rev - branches: active, closed, template + branches: active, closed, rev, template bundle: force, rev, branch, base, all, type, ssh, remotecmd, insecure cat: output, rev, decode, include, exclude, template clone: noupdate, updaterev, rev, branch, pull, uncompressed, stream, ssh, remotecmd, insecure diff --git a/tests/test-branches.t b/tests/test-branches.t --- a/tests/test-branches.t +++ b/tests/test-branches.t @@ -157,6 +157,18 @@ summary: Adding b branch +---- going to test branch listing by rev + $ hg branches -r0 + default 0:19709c5a4e75 (inactive) + $ hg branches -qr0 + default +--- now more than one rev + $ hg branches -r2:5 + b 4:aee39cd168d0 + a 5:d8cbc61dbaa6 (inactive) + $ hg branches -qr2:5 + b + a ---- going to test branch closing $ hg branches diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1129,6 +1129,7 @@ [('a', 'active', False, _('show only branches that have unmerged heads (DEPRECATED)')), ('c', 'closed', False, _('show normal and closed branches')), + ('r', 'rev', [], _('show branch name(s) of the given rev')) ] + formatteropts, _('[-c]'), helpcategory=command.CATEGORY_CHANGE_ORGANIZATION, @@ -1158,6 +1159,13 @@ """ opts = pycompat.byteskwargs(opts) + 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: + continue isactive = False if not isclosed: openheads = set(repo.branchmap().iteropen(heads))