mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-25 06:50:55 +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:
parent
9d132f177b
commit
88b1ad7e92
1 changed files with 8 additions and 0 deletions
|
@ -32,6 +32,14 @@ final class DifferentialRevisionIDField
|
||||||
}
|
}
|
||||||
|
|
||||||
public function parseValueFromCommitMessage($value) {
|
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);
|
return self::parseRevisionIDFromURI($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue