[PATCH 04 of 10] phabricator: abort if phabsend gets empty revs

Jun Wu quark at fb.com
Tue Jul 4 21:58:29 EDT 2017


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1499211408 25200
#      Tue Jul 04 16:36:48 2017 -0700
# Node ID e7adcd5a2c5715dc9327d03a3fc22ec65af495d5
# Parent  576b9d41cfd1177a32e0d42e134cbb689c1568a7
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r e7adcd5a2c57
phabricator: abort if phabsend gets empty revs

Previously we didn't abort. Now we abort if revs is empty. This is
consistent with "hg export" behavior. Maybe "return 1" is also a reasonable
behavior, but that's inconsistent with the existing "hg export".

diff --git a/contrib/phabricator.py b/contrib/phabricator.py
--- a/contrib/phabricator.py
+++ b/contrib/phabricator.py
@@ -272,4 +272,7 @@ def phabsend(ui, repo, *revs, **opts):
     revs = scmutil.revrange(repo, revs)
 
+    if not revs:
+        raise error.Abort(_('phabsend requires at least one changeset'))
+
     # Send patches one by one so we know their Differential Revision IDs and
     # can provide dependency relationship


More information about the Mercurial-devel mailing list