changeset 37356:004e5c5821b2

heads: add support for specifying branches by revset Before this commit, e.g. "hg heads .^" would fail with: abort: unknown revision '.^'! Like the previous patch, I don't care about the command itself (I don't think I had ever used it before), I'm just cleaning up uses of repo[<string>]. Differential Revision: https://phab.mercurial-scm.org/D3084
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 04 Apr 2018 15:08:26 -0700
parents 5bcd5859b505
children 7c8524efd847
files mercurial/commands.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Apr 04 15:06:32 2018 -0700
+++ b/mercurial/commands.py	Wed Apr 04 15:08:26 2018 -0700
@@ -2648,7 +2648,8 @@
         heads = [repo[h] for h in heads]
 
     if branchrevs:
-        branches = set(repo[br].branch() for br in branchrevs)
+        branches = set(repo[r].branch()
+                       for r in scmutil.revrange(repo, branchrevs))
         heads = [h for h in heads if h.branch() in branches]
 
     if opts.get('active') and branchrevs: