D3084: heads: add support for specying branches by revset

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Wed Apr 4 22:54:05 UTC 2018


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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>].

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -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:



To: martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list