]> khamidou — GitHub mirrors - arcanist.git/commit
Fix arc lint on working copy changes in mercurial repos
authordurham <durham@fb.com>
Wed, 27 Feb 2013 00:15:29 +0000 (16:15 -0800)
committerdurham <durham@fb.com>
Wed, 27 Feb 2013 00:15:29 +0000 (16:15 -0800)
commit0cb1b7efad98d207f3121cc2928df82ed6ff0d88
tree405388be092e0a761927639f89b7e8332e8b4d6a
parent2f09de2e798ee7b64c65af06e90d330b75a1cb3e
Fix arc lint on working copy changes in mercurial repos

Summary:
Previously, running arc lint on a set of changes that only
existed in your working copy threw an exception in mercurial repos.
It was trying to use the revset "...." (i.e. the range from . to .),
which didn't parse. Even if I fix that it still doesn't work because
getRawDiffText did not include the working copy changes (which it does
in git).  I removed the check so the function now acts the same as in
git and arc lint works on working copy changes. I've seen this error before
in other places so hopefully this change will also fix any other areas,
that depended on getRawDiffText working the same as git.

The logic I removed was added in D1954 to support diffing against
uncommited changes.  That workflow should be unchanged.  arc diff will
still prompt the user if there are uncommited changes, and the user can
still choose to abort or continue.

Let me know if I missed something important which makes this a bad idea.

Test Plan:
Edited a file in the working directory of a hg repo.
arc lint
Verified lint ran successfully.

Also ran arc diff and land with and without working copy changes to make sure
they still work.  I'd kill for some tests in this area...

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: dschleimer, bos, sid0, aran, Korvin
Maniphest Tasks: T1631

Differential Revision: https://secure.phabricator.com/D5130
src/repository/api/ArcanistMercurialAPI.php
src/workflow/ArcanistDiffWorkflow.php