Summary: `arc patch` currently warns about "This diff is against commit svn+ssh://... but the commit is nowhere in the working copy" in Git SVN repository.
Test Plan:
$ arc patch # in Git SVN repository
$ svn find-rev r121212112 # invalid revision
Reviewers: epriestley
Reviewed By: epriestley
CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D3539
}
public function getCanonicalRevisionName($string) {
- list($stdout) = $this->execxLocal('show -s --format=%C %s',
- '%H', $string);
+ $match = null;
+ if (preg_match('/@([0-9]+)$/', $string, $match)) {
+ list($stdout) = $this->execxLocal(
+ 'svn find-rev r%d',
+ $match[1]);
+ } else {
+ list($stdout) = $this->execxLocal(
+ 'show -s --format=%C %s',
+ '%H',
+ $string);
+ }
return rtrim($stdout);
}
public function hasLocalCommit($commit) {
try {
- $this->getCanonicalRevisionName($commit);
+ if (!$this->getCanonicalRevisionName($commit)) {
+ return false;
+ }
} catch (CommandException $exception) {
return false;
}