]> khamidou — GitHub mirrors - arcanist.git/commit
Improve handling of `--background` with `--base`
authorepriestley <git@epriestley.com>
Tue, 2 Oct 2012 18:01:49 +0000 (11:01 -0700)
committerepriestley <git@epriestley.com>
Tue, 2 Oct 2012 18:01:49 +0000 (11:01 -0700)
commitb880dfd4c89a53370a8f9f93fc4aebe5cdfce407
tree044ffcee684fb669c86ceda14e555e182fe202f1
parentf0a91a30c8856d8a069c3a35d33553d801fda218
Improve handling of `--background` with `--base`

Summary:
Currently, we run `runDiffSetupBasics()` //after// splitting off background lint and unit tests. However, this means `--base` and any explicit revision name (like "HEAD^") will not be parsed, so the call to `getRelativeCommit()` in order to generate `arc lint --rev XXX` will fail or not work as expected, because it will ignore any arguments.

Instead, parse `--base`, explicit revisions, and other repository API arguments before doing lint and unit tests.

Test Plan:
  - Set global config for `base` to `arc:amended, git:branch-unique(origin/master)`.
  - Created a commit on master.
  - Ran `arc diff HEAD^`.
    - Before this change, the command fails with "Usage Exception: None of the rules in your 'base' configuration matched a valid commit. Adjust rules or specify which commit you want to use explicitly." when it attempts to run lint, because the `HEAD^` argument is never parsed. After
    - After this change, the command succeeds.

Reviewers: vrana

Reviewed By: vrana

CC: aran
Differential Revision: https://secure.phabricator.com/D3574
src/workflow/ArcanistDiffWorkflow.php