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

login
register
mail settings
Submitter Jun Wu
Date July 5, 2017, 1:58 a.m.
Message ID <e7adcd5a2c5715dc9327.1499219909@x1c>
Download mbox | patch
Permalink /patch/22000/
State Accepted
Headers show

Comments

Jun Wu - July 5, 2017, 1:58 a.m.
# HG changeset patch
# User Jun Wu <quark@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".

Patch

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