From c53a43f54d51965df8b6769dd27f90506a75e88f Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 1 Nov 2011 17:10:48 -0700 Subject: [PATCH] Don't flag "Untracked" files in Mercurial as "Uncommitted" 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/repository/api/mercurial/ArcanistMercurialAPI.php b/src/repository/api/mercurial/ArcanistMercurialAPI.php index f63b9432..0dc251f1 100644 --- a/src/repository/api/mercurial/ArcanistMercurialAPI.php +++ b/src/repository/api/mercurial/ArcanistMercurialAPI.php @@ -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; -- 2.43.0