From d2915d8c5f20bd9d7a62c7167cc6ce1a4b935bee Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 10 Apr 2012 16:06:57 -0700 Subject: [PATCH] Don't let "arc which" identify the working copy as belonging to a different project Summary: If you have two projects (say, libphutil and arcanist) and you prepare a patch for one of them on branch "master", run "arc diff", and then prepare a patch for the other one on the same branch, "arc diff" will try to update the first revision when you run it. Instead, make it smart enough to stay within arc projects. Test Plan: Ran "arc which" in circumstances where it previously generated a false positive, no false positive. Reviewers: btrahan, vrana, jungejason Reviewed By: jungejason CC: aran Maniphest Tasks: T1100 Differential Revision: https://secure.phabricator.com/D2199 --- src/repository/api/git/ArcanistGitAPI.php | 4 +++- src/repository/api/subversion/ArcanistSubversionAPI.php | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/repository/api/git/ArcanistGitAPI.php b/src/repository/api/git/ArcanistGitAPI.php index 27182235..bd2163f1 100644 --- a/src/repository/api/git/ArcanistGitAPI.php +++ b/src/repository/api/git/ArcanistGitAPI.php @@ -745,10 +745,12 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI { } // If we still didn't succeed, try to find revisions by branch name. + $project = $this->getWorkingCopyIdentity()->getProjectID(); $results = $conduit->callMethodSynchronous( 'differential.query', $query + array( - 'branches' => array($this->getBranchName()), + 'branches' => array($this->getBranchName()), + 'arcanistProjects' => array($project), )); return $results; diff --git a/src/repository/api/subversion/ArcanistSubversionAPI.php b/src/repository/api/subversion/ArcanistSubversionAPI.php index 9c0c3ae6..6c8fe232 100644 --- a/src/repository/api/subversion/ArcanistSubversionAPI.php +++ b/src/repository/api/subversion/ArcanistSubversionAPI.php @@ -534,11 +534,14 @@ EODIFF; array $query) { // We don't have much to go on in SVN, look for revisions that came from - // this directory. + // this directory and belong to the same project. + $project = $this->getWorkingCopyIdentity()->getProjectID(); $results = $conduit->callMethodSynchronous( 'differential.query', - $query); + $query + array( + 'arcanistProjects' => $project, + )); foreach ($results as $key => $result) { if ($result['sourcePath'] != $this->getPath()) {