1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Allow Phabricator to parse bare revision IDs from "Differential Revision:" fields

Summary: Fixes T8087. Depends on D12748.

Test Plan: See D12748.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: cburroughs, epriestley

Maniphest Tasks: T8087

Differential Revision: https://secure.phabricator.com/D12749
This commit is contained in:
epriestley 2015-05-07 11:10:23 -07:00
parent 9d132f177b
commit 88b1ad7e92

View file

@ -32,6 +32,14 @@ final class DifferentialRevisionIDField
}
public function parseValueFromCommitMessage($value) {
// If the value is just "D123" or similar, parse the ID from it directly.
$value = trim($value);
$matches = null;
if (preg_match('/^[dD]([1-9]\d*)\z/', $value, $matches)) {
return (int)$matches[1];
}
// Otherwise, try to extract a URI value.
return self::parseRevisionIDFromURI($value);
}