]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Don't let "arc which" identify the working copy as belonging to a different project
authorepriestley <git@epriestley.com>
Tue, 10 Apr 2012 23:06:57 +0000 (16:06 -0700)
committerepriestley <git@epriestley.com>
Tue, 10 Apr 2012 23:06:57 +0000 (16:06 -0700)
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
src/repository/api/subversion/ArcanistSubversionAPI.php

index 271822358b1889f93e6c6b68502efdf5b060efeb..bd2163f1e2acad4951a8a98ab6f41e2bd681c77b 100644 (file)
@@ -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;
index 9c0c3ae6a9321df0c6671fab169a24cb18f2973f..6c8fe232715a040d6768ea5104e068225616a870 100644 (file)
@@ -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()) {