Changeset View
Changeset View
Standalone View
Standalone View
src/differential/ArcanistDifferentialCommitMessage.php
Context not available. | |||||
$pattern = '/^git-svn-id:\s*([^@]+)@(\d+)\s+(.*)$/m'; | $pattern = '/^git-svn-id:\s*([^@]+)@(\d+)\s+(.*)$/m'; | ||||
$match = null; | $match = null; | ||||
if (preg_match($pattern, $corpus, $match)) { | if (@preg_match($pattern, $corpus, $match)) { | ||||
$obj->gitSVNBaseRevision = $match[1].'@'.$match[2]; | $obj->gitSVNBaseRevision = $match[1].'@'.$match[2]; | ||||
$obj->gitSVNBasePath = $match[1]; | $obj->gitSVNBasePath = $match[1]; | ||||
$obj->gitSVNUUID = $match[3]; | $obj->gitSVNUUID = $match[3]; | ||||
Context not available. | |||||
*/ | */ | ||||
private function parseRevisionIDFromRawCorpus($corpus) { | private function parseRevisionIDFromRawCorpus($corpus) { | ||||
$match = null; | $match = null; | ||||
if (!preg_match('/^Differential Revision:\s*(.+)/im', $corpus, $match)) { | if (!@preg_match('/^Differential Revision:\s*(.+)/im', $corpus, $match)) { | ||||
return null; | return null; | ||||
} | } | ||||
Context not available. | |||||
$revision_pattern = '/^[dD]([1-9]\d*)\z/'; | $revision_pattern = '/^[dD]([1-9]\d*)\z/'; | ||||
// Accept a bare revision ID like "D123". | // Accept a bare revision ID like "D123". | ||||
if (preg_match($revision_pattern, $revision_value, $match)) { | if (@preg_match($revision_pattern, $revision_value, $match)) { | ||||
return (int)$match[1]; | return (int)$match[1]; | ||||
} | } | ||||
Context not available. | |||||
$uri = new PhutilURI($revision_value); | $uri = new PhutilURI($revision_value); | ||||
$path = $uri->getPath(); | $path = $uri->getPath(); | ||||
$path = trim($path, '/'); | $path = trim($path, '/'); | ||||
if (preg_match($revision_pattern, $path, $match)) { | if (@preg_match($revision_pattern, $path, $match)) { | ||||
return (int)$match[1]; | return (int)$match[1]; | ||||
} | } | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0