Autocomplete branches to "arc land"

Summary:
  - Add branch name tab completion to "arc land".
  - Default to landing the current branch.
  - This is a little bit hacky but not too terrible. I'm planning to move the whole thing to PhutilArgumentParser at some point so that'll be an opportunity for a big refactor.

Test Plan: Hit tab, landed this branch.

Reviewers: zeeg, btrahan, vrana, jungejason

Reviewed By: btrahan

CC: aran, kdeggelman

Differential Revision: https://secure.phabricator.com/D2293
Lint libraries without __init__

Summary: After D2207.

Test Plan:
`arc lint` on D2208.
`arc lint` on mistyped class name.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Maniphest Tasks: T1103

Differential Revision: https://secure.phabricator.com/D2306
Allow tests to be skipped

Summary:
Allow tests to be skipped by calling assertSkipped().  It's not really
an assertion of anything tangible; more like "assert that we can't
really assert anything right now".

Test Plan: Added a new test to the PhutilUnitTestEngineTestCase.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2312
Fix PhutilUnitTest issue with symlinks that point into a libphutil library

Summary: Currently, if you change a symlink outside a libphutil library and the link target is something inside a libphutil library, we may enter an inifite loop in the "do { ... } while(...)" later. Just bail if the loop won't resolve.

Test Plan: Ran arc unit, Airtime reported the issue resolved by a similar fix.

Reviewers: cpiro, btrahan

Reviewed By: cpiro

CC: aran

Differential Revision: https://secure.phabricator.com/D2318
Wrapper for 'nose' unittest and code coverage tools.

Summary:
Wrapper for Python 'nose' (http://readthedocs.org/docs/nose/en/latest/)
testing tool.

Test Plan:
Install latest 'nose' v1.1.3. Currently it is available through
Github only (``pep install git+https://github.com/nose-devs/nose.git``).

Create a Python project with following structure:

  /package_name/module_name.py
  /tests/package_name/test_module_name.py

Write some tests

Run ``arc unit``

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Koolvin, zeeg

Differential Revision: https://secure.phabricator.com/D2322
Use Filesystem::getMimeType() in Arcanist

Summary: Missed this when getting rid of all the 'file' calls.

Test Plan: Meta.

Reviewers: btrahan, vrana, jungejason

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1159

Differential Revision: https://secure.phabricator.com/D2327
add support for using Arcanist with git's log.decorate setting enabled

Summary:
Arcanist fails to find git's 'commit <hash>' header when log.decorate is
set in one of git's config files. git adds the named refs that point to
the commit in parentheses following the hash. This changes the regex
used by arcanist to match git commit headers to optionally match the
branch names in parentheses following the hash.

Test Plan:
Run `git config --global log.decorate short` and check that `arc diff`
runs successfully.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2344
Show text of moved files in Differential

Summary:
"git diff -M -C" generates useful metadata (moves/copies) but (for a pure move) no diff text. Synthetically build the diff text after the fact so this information is available in Differential.

This patch is kind of nasty but I couldn't see a cleaner way to do it. :/

This also needs some UI changes in Differential: we get a full-green new file right now, but it would be better to default-hide it with "This file was moved. Show More" or similar.

Test Plan: Moved a file, ran "arc diff", got textual diff.

Reviewers: aran, tuomaspelkonen, jungejason, btrahan, vrana

Reviewed By: vrana

CC: aran, epriestley, vrana

Maniphest Tasks: T230

Differential Revision: https://secure.phabricator.com/D479
Remove "--no-decorate"

Summary: Apparently my advice here was terrible, and `--no-decorate` and `--decorate=no` are both very recent additions to Git which a bunch of users don't have. Get rid of them since D2344 allows us to parse all decorate levels anyway.

Test Plan: Tried to google "git changelog", got a bunch of pages about managing changelogs with git.

Reviewers: zeeg, ehren

Reviewed By: ehren

CC: ehren, aran, NorthIsUp

Differential Revision: https://secure.phabricator.com/D2354
Don't check working copy status for "arc commit --show"

Summary:
We do unnecessary working copy checks under "--show", even though the working copy isn't relevant.

Also, 'sourcePath' may not be set (e.g., "arc commit --show --revision X" where X is some "--only" revision).

Test Plan: Ran "arc commit --show --revision 1" against some test data, got clean output.

Reviewers: vrana, btrahan, jungejason

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D2353
Help the analyzer find phutil_is_hiphop_runtime

Summary:
rPHUf9ba25d188c1dcf39e4454b2c6bb058e0beeaa3e adds
global function phutil_is_hiphop_runtime() to
__phutil_library_init__.php.  This diff helps lint files that call that
function.

Test Plan: Lint D2365.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2366
Using a temp file for git commit --amend instead of passing multi-line message to the shell. Avoids escaping issue on windows.

Test Plan: Run arc diff locally, verify via git log that the commit is amended afterwards (using the mutable history paradigm)

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2369
Fix "HGPLAIN" environmental variable in Windows

Summary: In Windows, you can't use `X=y cmd` syntax to set variables. Use "set X=y & cmd" instead.

Test Plan:
  - Ran "arc diff" in a Mercurial repo in Windows, created D2367.
  - Verified this does //not// cause 'HGPLAIN' to be set in the outer shell (where you type "arc diff").

Reviewers: Makinde, tido, indiefan, btrahan

Reviewed By: tido

CC: aran

Maniphest Tasks: T1179

Differential Revision: https://secure.phabricator.com/D2368
Updated arc land workflow to use temp file approach for messages to avoid newline escaping issue in windows.

Test Plan: Ran arc land locally with both the mutable default option and with the --merge flag to ensure that messages are set properly.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2372
Warn before parse errors in `arc diff --verbatim`

Summary: With `--verbatim` flag, notes created from parse errors are never displayed to user resulting in blank fields.

Test Plan:
- `arc diff --verbatim` with invalid Cc
- `arc diff --verbatim` with all fields correct

Reviewers: epriestley, jungejason

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2395
Don't ask user to use saved message in `arc diff --verbatim`

Test Plan:
Cancel `arc diff`.
Verify that the message is created.
Run `arc diff --verbatim` and see no reuse message question.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2390
Document first line behavior in update message

Test Plan: (This diff)

Reviewers: epriestley, jungejason

Reviewed By: jungejason

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2389
Clean up some "arc" edge cases in Mercurial

Summary:
  - We no longer need color options since we fake our way through parsing ANSI colorized diffs and use HGPLAIN (on Windows, too!). Drop 'em.
  - In the case where you have nothing outgoing, we don't cache the relative commit and thus run "hg outgoing" too many times, which is fairly slow (even if you have nothing outgoing). Cache it.

Test Plan: Ran "arc diff --trace" in a mercurial working copy with nothing outgoing; verified we run "hg outgoing" only once.

Reviewers: Makinde, csilvers, btrahan

Reviewed By: Makinde

CC: aran

Differential Revision: https://secure.phabricator.com/D2399
Explicitly check for cURL in "arc"

Summary: We do this in Windows, but it's not available by default in Ubuntu

Test Plan: Ran "arc" after faking the function name, got a reasonable error.

Reviewers: btrahan, jungejason

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D2404
Remove git commit template from Arcanist

Summary: Out of date an no longer referenced.

Test Plan: Grepped for references.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

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