From: epriestley Date: Fri, 3 Jan 2014 20:23:34 +0000 (-0800) Subject: In Subversion, treat missing files similarly to conflicted files X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=488b8e365a272791ab4671126906d839cb114cb1;p=arcanist.git In Subversion, treat missing files similarly to conflicted files Summary: See . 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 --- diff --git a/src/repository/api/ArcanistRepositoryAPI.php b/src/repository/api/ArcanistRepositoryAPI.php index c9ace486..a3e810eb 100644 --- a/src/repository/api/ArcanistRepositoryAPI.php +++ b/src/repository/api/ArcanistRepositoryAPI.php @@ -184,6 +184,14 @@ abstract class ArcanistRepositoryAPI { } + /** + * @task status + */ + final public function getMissingChanges() { + return $this->getUncommittedPathsWithMask(self::FLAG_MISSING); + } + + /** * @task status */ diff --git a/src/workflow/ArcanistBaseWorkflow.php b/src/workflow/ArcanistBaseWorkflow.php index 2be6c7da..bcfbda86 100644 --- a/src/workflow/ArcanistBaseWorkflow.php +++ b/src/workflow/ArcanistBaseWorkflow.php @@ -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".