Page MenuHomePhabricator

D9595.diff
No OneTemporary

D9595.diff

diff --git a/src/differential/ArcanistDifferentialCommitMessage.php b/src/differential/ArcanistDifferentialCommitMessage.php
--- a/src/differential/ArcanistDifferentialCommitMessage.php
+++ b/src/differential/ArcanistDifferentialCommitMessage.php
@@ -19,27 +19,20 @@
$obj = new ArcanistDifferentialCommitMessage();
$obj->rawCorpus = $corpus;
- // Parse older-style "123" fields, or newer-style full-URI fields.
- // TODO: Remove support for older-style fields.
-
$match = null;
if (preg_match('/^Differential Revision:\s*(.*)/im', $corpus, $match)) {
$revision_id = trim($match[1]);
if (strlen($revision_id)) {
- if (preg_match('/^D?\d+$/', $revision_id)) {
- $obj->revisionID = (int)trim($revision_id, 'D');
+ $uri = new PhutilURI($revision_id);
+ $path = $uri->getPath();
+ $path = trim($path, '/');
+ if (preg_match('/^D\d+$/', $path)) {
+ $obj->revisionID = (int)trim($path, 'D');
} else {
- $uri = new PhutilURI($revision_id);
- $path = $uri->getPath();
- $path = trim($path, '/');
- if (preg_match('/^D\d+$/', $path)) {
- $obj->revisionID = (int)trim($path, 'D');
- } else {
- throw new ArcanistUsageException(
- "Invalid 'Differential Revision' field. The field should have a ".
- "Phabricator URI like 'http://phabricator.example.com/D123', ".
- "but has '{$match[1]}'.");
- }
+ throw new ArcanistUsageException(
+ "Invalid 'Differential Revision' field. The field should have a ".
+ "Phabricator URI like 'http://phabricator.example.com/D123', ".
+ "but has '{$match[1]}'.");
}
}
}

File Metadata

Mime Type
text/plain
Expires
Tue, May 21, 11:21 PM (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6266098
Default Alt Text
D9595.diff (1 KB)

Event Timeline