mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-03-12 04:14:59 +01:00
Provide user-friendly error in arc diff --update
Summary: If you forget to provide an argument for --update and have another argument following it (e.g. HEAD^), we should provide a nice error message instead of passing that argument through to a conduit call and then printing the conduit error. Test Plan: ran 'arc diff --update HEAD^' and got a nice error message Reviewers: epriestley, jungejason, vrana Reviewed By: epriestley CC: aran, Koolvin Differential Revision: https://secure.phabricator.com/D2468
This commit is contained in:
parent
a31fc544c8
commit
032b9b30b0
1 changed files with 7 additions and 2 deletions
|
@ -1278,7 +1278,12 @@ EOTEXT
|
||||||
return $this->getCommitMessageFromUser();
|
return $this->getCommitMessageFromUser();
|
||||||
}
|
}
|
||||||
} else if ($is_update) {
|
} else if ($is_update) {
|
||||||
return $this->getCommitMessageFromRevision($is_update);
|
$revision_id = $this->normalizeRevisionID($is_update);
|
||||||
|
if (!is_numeric($revision_id)) {
|
||||||
|
throw new ArcanistUsageException(
|
||||||
|
'Parameter to --update must be a Differential Revision number');
|
||||||
|
}
|
||||||
|
return $this->getCommitMessageFromRevision($revision_id);
|
||||||
} else {
|
} else {
|
||||||
// This is --raw without enough info to create a revision, so force just
|
// This is --raw without enough info to create a revision, so force just
|
||||||
// a diff.
|
// a diff.
|
||||||
|
@ -1484,7 +1489,7 @@ EOTEXT
|
||||||
* @task message
|
* @task message
|
||||||
*/
|
*/
|
||||||
private function getCommitMessageFromRevision($revision_id) {
|
private function getCommitMessageFromRevision($revision_id) {
|
||||||
$id = $this->normalizeRevisionID($revision_id);
|
$id = $revision_id;
|
||||||
|
|
||||||
$revision = $this->getConduit()->callMethodSynchronous(
|
$revision = $this->getConduit()->callMethodSynchronous(
|
||||||
'differential.query',
|
'differential.query',
|
||||||
|
|
Loading…
Add table
Reference in a new issue