summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2016-08-02 14:51:32 +0100
committerThibault Saunier <tsaunier@gnome.org>2016-08-09 14:37:31 -0400
commitc96fe8be1c87195fcc9f5fe6b4be3061fbdfafc1 (patch)
treecf561386e79c4ee4a200f6d99e54551efcfd4d03
parent4b1334a665bf13ab9d31b5d51db66949bd4d55d3 (diff)
git-phab: Add some input error checking to cherry-pick mode
cherry-pick doesn’t support tasks, so improve the error message if you run `git phab cherry-pick T123`, rather than throwing a phabricator.APIError which is not especially helpful. Reviewed-by: Thibault Saunier <tsaunier@gnome.org> Differential Revision: https://phabricator.freedesktop.org/D1239
-rwxr-xr-xgit-phab3
1 files changed, 3 insertions, 0 deletions
diff --git a/git-phab b/git-phab
index 684cc92..de5be23 100755
--- a/git-phab
+++ b/git-phab
@@ -1422,6 +1422,9 @@ Paste API Token from that page and press <enter>: """ % self.phabricator_uri)
print("Checking revision:", self.differential)
did = self.differential.strip("D")
+ if not did.isdigit():
+ self.die("Invalid diff ID ‘{}’".format(self.differential))
+
revision, diff = self.get_revision_and_diff(diff=did)
if self.fetch_staging_commits(diff):