]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Don't flag "Untracked" files in Mercurial as "Uncommitted"
authorepriestley <git@epriestley.com>
Wed, 2 Nov 2011 00:10:48 +0000 (17:10 -0700)
committerepriestley <git@epriestley.com>
Wed, 2 Nov 2011 00:23:29 +0000 (17:23 -0700)
Summary: We incorrectly add the "Uncommitted" flag to untracked files, which
causes them to raise various prompts and not respect "--allow-untracked".

Test Plan: Ran "arc diff --allow-untracked" in a clean working copy with
untracked files, was not fatally error'd.

Reviewers: Makinde, jungejason, nh, tuomaspelkonen, aran

Reviewed By: Makinde

CC: aran, Makinde, epriestley
Differential Revision: 1073

src/repository/api/mercurial/ArcanistMercurialAPI.php

index f63b9432311a0d9bf08e569c60c9a4c9abe36894..0dc251f1557c637c57611851e03c52dbdb3aac34 100644 (file)
@@ -205,6 +205,10 @@ class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
 
       $working_status = ArcanistMercurialParser::parseMercurialStatus($stdout);
       foreach ($working_status as $path => $status) {
+        if ($status & ArcanistRepositoryAPI::FLAG_UNTRACKED) {
+          // If the file is untracked, don't mark it uncommitted.
+          continue;
+        }
         $status |= self::FLAG_UNCOMMITTED;
         if (!empty($status_map[$path])) {
           $status_map[$path] |= $status;