Mercurial > public > mercurial-scm > hg
diff hgext/phabricator.py @ 45152:b3b0cd8b9366
phabricator: clarify the multiple heads/roots error message for phabsend
As pointed out in followup feedback for c1c922391314, it's confusing to say
there are multiple items and then only list one.
Differential Revision: https://phab.mercurial-scm.org/D8761
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Thu, 16 Jul 2020 14:16:53 -0400 |
parents | c59e7bed8924 |
children | b1f2659c1c34 |
line wrap: on
line diff
--- a/hgext/phabricator.py Tue Jul 14 13:35:54 2020 -0700 +++ b/hgext/phabricator.py Thu Jul 16 14:16:53 2020 -0400 @@ -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: