Patchwork D11559: phase: avoid a no-op resolution of revset from revnums

login
register
mail settings
Submitter phabricator
Date Oct. 1, 2021, 7:51 p.m.
Message ID <differential-rev-PHID-DREV-dawb3y42qcywq6stdho6-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49883/
State Superseded
Headers show

Comments

phabricator - Oct. 1, 2021, 7:51 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  I was surprised that `scmutil.revrange()` supports integers in the
  list of revsets. I think it's clearer to not pass a list that's known
  to contain only integers into the function.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5219,13 +5219,13 @@ 
     # look for specified revision
     revs = list(revs)
     revs.extend(opts[b'rev'])
-    if not revs:
+    if revs:
+        revs = scmutil.revrange(repo, revs)
+    else:
         # display both parents as the second parent phase can influence
         # the phase of a merge commit
         revs = [c.rev() for c in repo[None].parents()]
 
-    revs = scmutil.revrange(repo, revs)
-
     ret = 0
     if targetphase is None:
         # display