From: Peng Li Date: Tue, 29 Apr 2014 21:17:35 +0000 (-0700) Subject: It should be also valid to have empty change under hg X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=c4ec22b140dbb55d3a4c2da3455d8621bc690f08;p=arcanist.git It should be also valid to have empty change under hg 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 --- diff --git a/src/workflow/ArcanistBaseWorkflow.php b/src/workflow/ArcanistBaseWorkflow.php index 86837073..e4fd4e2f 100644 --- a/src/workflow/ArcanistBaseWorkflow.php +++ b/src/workflow/ArcanistBaseWorkflow.php @@ -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;