phabricator: abort if phabsend gets empty revs
authorJun Wu <quark@fb.com>
Tue, 04 Jul 2017 16:36:48 -0700
changeset 33266 5b2391b46906
parent 33265 95f658b558a3
child 33267 dba9f88659a3
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".
contrib/phabricator.py
--- a/contrib/phabricator.py	Tue Jul 04 16:36:48 2017 -0700
+++ b/contrib/phabricator.py	Tue Jul 04 16:36:48 2017 -0700
@@ -271,6 +271,9 @@
     revs = list(revs) + opts.get('rev', [])
     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
     lastrevid = None