]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Mark deleted paths as removed in committing
authorvrana <jakubv@fb.com>
Wed, 23 Jan 2013 21:53:30 +0000 (13:53 -0800)
committervrana <jakubv@fb.com>
Wed, 23 Jan 2013 22:42:49 +0000 (14:42 -0800)
Test Plan: Deleted file in Git, ran `arc diff`, confirmed the question, saw the file as deleted.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4603

src/repository/api/ArcanistGitAPI.php
src/repository/api/ArcanistMercurialAPI.php
src/repository/api/ArcanistSubversionAPI.php

index 23729890b9b3a75b24142137fb0c38b338bfffad..8fd29051ebec9126a4a2ab22bc92d9617055d313 100644 (file)
@@ -495,7 +495,7 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
 
   public function addToCommit(array $paths) {
     $this->execxLocal(
-      'add -- %Ls',
+      'add -A -- %Ls',
       $paths);
     $this->reloadWorkingCopy();
     return $this;
index 821661a880c01976b76f7a08b9f698d578a2cf45..6ff488f8fbf0516708be39b2c56216697b3fced4 100644 (file)
@@ -589,7 +589,7 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
 
   public function addToCommit(array $paths) {
     $this->execxLocal(
-      'add -- %Ls',
+      'addremove -- %Ls',
       $paths);
     $this->reloadWorkingCopy();
   }
index 61783db017c162e11af15f3696495bbd4c162f4d..edb71a1b89c8873c20f390ab515ead0b476274c1 100644 (file)
@@ -182,9 +182,17 @@ final class ArcanistSubversionAPI extends ArcanistRepositoryAPI {
   }
 
   public function addToCommit(array $paths) {
-    $this->execxLocal(
-      'add -- %Ls',
-      $paths);
+    $add = array_filter($paths, 'Filesystem::pathExists');
+    if ($add) {
+      $this->execxLocal(
+        'add -- %Ls',
+        $add);
+    }
+    if ($add != $paths) {
+      $this->execxLocal(
+        'delete -- %Ls',
+        array_diff($paths, $add));
+    }
   }
 
   public function getSVNProperty($path, $property) {