changeset 33266:5b2391b46906

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".
author Jun Wu <quark@fb.com>
date Tue, 04 Jul 2017 16:36:48 -0700
parents 95f658b558a3
children dba9f88659a3
files contrib/phabricator.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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