Patchwork D8761: phabricator: clarify the multiple heads/roots error message for phabsend

login
register
mail settings
Submitter phabricator
Date July 16, 2020, 6:19 p.m.
Message ID <differential-rev-PHID-DREV-7vku5t5otdwsqvcerivr-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46767/
State Superseded
Headers show

Comments

phabricator - July 16, 2020, 6:19 p.m.
mharbison72 created this revision.
Herald added subscribers: mercurial-patches, Kwan.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  As pointed out in followup feedback for c1c922391314 <https://phab.mercurial-scm.org/rHGc1c92239131419b3144c5717ba5442cbf493ab12>, it's confusing to say
  there are multiple items and then only list one.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/phabricator.py
  tests/test-phabricator.t

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: Kwan, mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-phabricator.t b/tests/test-phabricator.t
--- a/tests/test-phabricator.t
+++ b/tests/test-phabricator.t
@@ -596,7 +596,7 @@ 
 Phabsend requires a linear range of commits
 
   $ hg phabsend -r 0+2+3
-  abort: cannot phabsend multiple head revisions: c44b38f24a45
+  abort: cannot phabsend multiple head revisions: c44b38f24a45 aaef04066140
   (the revisions must form a linear chain)
   [255]
 
diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -1311,8 +1311,8 @@ 
     # --fold option implies this, and the auto restacking of orphans requires
     # it.  Otherwise A+C in A->B->C will cause B to be orphaned, and C' to
     # get A' as a parent.
-    def _fail_nonlinear_revs(revs, skiprev, revtype):
-        badnodes = [repo[r].node() for r in revs if r != skiprev]
+    def _fail_nonlinear_revs(revs, revtype):
+        badnodes = [repo[r].node() for r in revs]
         raise error.Abort(
             _(b"cannot phabsend multiple %s revisions: %s")
             % (revtype, scmutil.nodesummaries(repo, badnodes)),
@@ -1321,11 +1321,11 @@ 
 
     heads = repo.revs(b'heads(%ld)', revs)
     if len(heads) > 1:
-        _fail_nonlinear_revs(heads, heads.max(), b"head")
+        _fail_nonlinear_revs(heads, b"head")
 
     roots = repo.revs(b'roots(%ld)', revs)
     if len(roots) > 1:
-        _fail_nonlinear_revs(roots, roots.min(), b"root")
+        _fail_nonlinear_revs(roots, b"root")
 
     fold = opts.get(b'fold')
     if fold: