]> khamidou — GitHub mirrors - arcanist.git/commitdiff
In Subversion, treat missing files similarly to conflicted files
authorepriestley <git@epriestley.com>
Fri, 3 Jan 2014 20:23:34 +0000 (12:23 -0800)
committerepriestley <git@epriestley.com>
Fri, 3 Jan 2014 20:23:34 +0000 (12:23 -0800)
Summary: See <https://github.com/facebook/arcanist/issues/133>. Treat "!" files like "C" and "?" files and make the user deal with them.

Test Plan:
  >>> orbital ~/repos/INIS $ svn st
  !       README
  >>> orbital ~/repos/INIS $ arc diff
  Usage Exception: You have missing files in this working copy. Revert or formally remove them (with `svn rm`) before proceeding.

    Working copy: /INSECURE/repos/INIS/

    Missing files in working copy:
      README

Reviewers: btrahan

Reviewed By: btrahan

CC: aran
Differential Revision: https://secure.phabricator.com/D7886

src/repository/api/ArcanistRepositoryAPI.php
src/workflow/ArcanistBaseWorkflow.php

index c9ace4865d53f3069b893838378a50aa5ec2e492..a3e810eb9a43eb025300b08bba9e151a5616fd2a 100644 (file)
@@ -184,6 +184,14 @@ abstract class ArcanistRepositoryAPI {
   }
 
 
+  /**
+   * @task status
+   */
+  final public function getMissingChanges() {
+    return $this->getUncommittedPathsWithMask(self::FLAG_MISSING);
+  }
+
+
   /**
    * @task status
    */
index 2be6c7daafd49bd63b22d8c244c9a7387d6a33c3..bcfbda8633f15f56ab6d6db67640ef1f4b3e3f98 100644 (file)
@@ -847,6 +847,18 @@ abstract class ArcanistBaseWorkflow extends Phobject {
         "    ".implode("\n    ", $conflicts)."\n");
     }
 
+    $missing = $api->getMissingChanges();
+    if ($missing) {
+      throw new ArcanistUsageException(
+        pht(
+          "You have missing files in this working copy. Revert or formally ".
+          "remove them (with `svn rm`) before proceeding.\n\n".
+          "%s".
+          "  Missing files in working copy:\n%s\n",
+          $working_copy_desc,
+          "    ".implode("\n    ", $missing)));
+    }
+
     $unstaged = $api->getUnstagedChanges();
     if ($unstaged) {
       echo "You have unstaged changes in this working copy.\n\n".