]> khamidou — GitHub mirrors - arcanist.git/commit
Allow arc to be run in arcanist/ or libphutil/
authorepriestley <git@epriestley.com>
Tue, 18 Dec 2012 00:35:03 +0000 (16:35 -0800)
committerepriestley <git@epriestley.com>
Tue, 18 Dec 2012 00:35:03 +0000 (16:35 -0800)
commitb9fa71f7e1985502907cd7344dd4cb38a11ef369
tree8c8db4ad9240fe9e702ba2f28eb1dedfa41442d6
parent6823706c76d49c3b1c85139f392e4be48dd43bf9
Allow arc to be run in arcanist/ or libphutil/

Summary:
Currently, if you run `arc` in arcanist/ or libphutil/ and your PATH and on-disk configuration are set up so a different version of arc or libphutil are the ones that actually load, we fail with an exception like "running arcanist in a different copy of arcanist is not supported".

This causes problems for Harbormaster, since we'd like to be able to run 'arc' in a copy of libphutil/ and have it execute unit tests for that copy rather than failing abruptly. So, if we detect that we're in arcanist/ or libphutil/, execute 'arc' again with the same arguments but force it to load the working copy in place of either the 'arcanist/' or the 'libphutil/' that it decided to load.

This is pretty much horrible black magic.

Test Plan: Ran 'arc list --trace' inside copies of libphutil/ and arcanist/ outside of the normal include chain. Saw it detect these, emit a message, and re-execute itself correctly.

Reviewers: btrahan, vrana

Reviewed By: vrana

CC: aran
Maniphest Tasks: T1049

Differential Revision: https://secure.phabricator.com/D4225
scripts/__init_script__.php
scripts/arcanist.php