]> khamidou — GitHub mirrors - arcanist.git/commitdiff
It should be also valid to have empty change under hg
authorPeng Li <pengli@fb.com>
Tue, 29 Apr 2014 21:17:35 +0000 (14:17 -0700)
committerepriestley <git@epriestley.com>
Tue, 29 Apr 2014 21:17:35 +0000 (14:17 -0700)
Summary: Like git, it is also valid to have empty net change under hg. Should not throw if that is the case.

Test Plan: Tried on a hg repo.

Reviewers: lifeihuang, #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D8888

src/workflow/ArcanistBaseWorkflow.php

index 868370739c643baeb4d162cef540a6969d65d6c6..e4fd4e2f3f13b923cd3185529f7b1bd7fd2ad72c 100644 (file)
@@ -1124,10 +1124,10 @@ abstract class ArcanistBaseWorkflow extends Phobject {
     }
 
     if (empty($this->changeCache[$path])) {
-      if ($is_git) {
-        // This can legitimately occur under git if you make a change, "git
-        // commit" it, and then revert the change in the working copy and run
-        // "arc lint".
+      if ($is_git || $is_hg) {
+        // This can legitimately occur under git/hg if you make a change,
+        // "git/hg commit" it, and then revert the change in the working copy
+        // and run "arc lint".
         $change = new ArcanistDiffChange();
         $change->setCurrentPath($path);
         return $change;