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:
		@@ -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);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user