Allow checking out branches in `arc branch`

Summary:
The main added value is loading the branch name from revision.
Sometimes I know the revision ID but I don't know the branch name.

The missing piece is the starting point of the branch.
I was thinking about using `arc.land.onto.default` but we also need to get 'origin'.

This is also the last step of a simple workflow where underlying VCS is not abstracted away.
In future, we can implement this for other APIs.

Test Plan:
  $ arc branch new_branch
  $ arc branch new_branch
  $ arc branch D4168

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4170
Refuse writing to undeclared properties in workflows

Summary: I don't know how to not be strict here plus we (Arcanist developers) don't have access to user's error log.

Test Plan:
Undeclared `ArcanistDiffWorkflow::$console`, then:

  $ arc diff

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3607
Fix `arc diff` in SVN with paths

Summary:
Recently, in D4097 or one of the precursors I refactored this. However, when $rev is null parseBaseCommitArgument() throws ("This VCS does not support commit ranges."). Shield the call so it only happens if if $rev is nonempty (we still want to make the call, so "arc lint --rev x" on SVN will throw and inform the user that "--rev" is incorrect usage).

(@vrana, this was reported by FB and might be worth pushing.)

Test Plan: Ran "arc diff --preview <path>". Grepped for other parseBaseCommitArgument() callsites and verified they don't have similar issues.

Reviewers: vrana, btrahan, chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D4241
Make caching lint default

Summary: I use it couple of weeks without troubles.

Test Plan:
Added debug output and:

  $ arc lint
  $ arc lint --cache 0

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2036

Differential Revision: https://secure.phabricator.com/D4242
Don't amend commit with the same message in `arc diff`

Summary: It makes reflog ugly

Test Plan:
# `arc diff`, made error, saw "Message saved to".
# `arc diff`, didn't edit, didn't see "Message saved to".
# `arc diff`, edited, saw "Message saved to".

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4243
Speed up SVN discovery

Summary: `svn info` takes up to 10 seconds.

Test Plan: `arc diff` inside SVN repo and outside any repo.

Reviewers: nh, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4256
Update PEP8 to 1.3.4

Summary: Primarily to avoid false positives: http://pypi.python.org/pypi/pep8#id1

Test Plan:
  $ arc lint --engine ComprehensiveLintEngine externals/pep8/pep8.py # after uncommenting externals/ check

Saw 9 errors, haha.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4260
Don't require clean working copy for `arc diff path` in SVN

Summary: If you are explicit then there is no need to ask you.

Test Plan:
  $ touch a
  $ arc diff
  $ arc diff a
  $ arc diff existing

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4186
Improve `arc land` recovery from issues with the remote.

Summary:
Fixes T2138.

  - When a pull fails, restore the original branch.
  - When a push fails, complain about it really loudly.

NOTE: No test plan for push yet since I'm not sure this is the right remedy, see T2138 for discsusion.

Test Plan:
  - Tested pull by changing "git pull" to "git xxpull" and running "arc land". Saw the pull fail and my original branch restored.

Reviewers: vrana, aran

Reviewed By: vrana

Maniphest Tasks: T2138

Differential Revision: https://secure.phabricator.com/D4265
Add a flake8 linter

Summary: flake8 is the better maintained combination of pep8 and pyflakes

Test Plan: There's a test!

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin, jack

Differential Revision: https://secure.phabricator.com/D4082
Correct description and severity on Flake8 linter

Test Plan: do it live

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4274
Correct spelling for "arc" commands

Summary:
I type "arc brnach" about 300 times per day.

  - Allow arc commands to be specified by unique prefix ("exp" for "export", "lib" for "liberate").
  - Allow arc commands to be specified by unique levenshtein edit distance <= 2 ("brnach" for "branch", "halp" for "help", "ptach" for "patch").
  - Reorganize code out of "arcanist.php".

I think this will be uncontentious because arc commands are rarely destructive, but if people complain we can either require certain commands be typed exactly (maybe "land"?) or allow this feature to be disabled in configuration.

Test Plan:
  $ arc br
  Usage Exception: Unknown command 'br'. Try 'arc help'.

  Did you mean:
      branch
      browse

  $ arc brnachh
  Usage Exception: Unknown command 'brnachh'. Try 'arc help'.
  $ arc brnach
  (Assuming 'brnach' is the British spelling of 'branch'.)
     doc-security        No Revision      security
     sms                 Needs Revision   D319: Add SMS support to Phabricator
     phxtag              No Revision      derp
     arantag             No Revision      derp
  ...

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D4305
jshint linter: add option to ignore specific error messages

*warning: very gross approach*

This commit adds the "lint.jshint.errorstoignore" option to arcconfig,
as an array, so that a user is now able to ignore any specific error
messages he wishes, by listing it there.

i.e. (in .arcconfig):

+---------------------------------------------------------------------+
| "lint.jshint.errorstoignore": [ "Missing space after 'function'." ] |
+---------------------------------------------------------------------+

will ignore the annoying "Missing space after 'function'" warning, which
complains about constructions in the form of "foo = function() {}".

I am not aware of a way to disable that checking, without also disabling
the "indent" option, which seems to be often undesirable.

Likely, the proper way of fixing that specific thing is to be implemented
in jshint itself, but it seemed interesting to have a way to supress an
arbitrary error/warning in arcanist.

Signed-off-by: Sergio Correia <sergio@correia.cc>
unit: add busterjs test unit engine

This commit adds a simple unit test wrapper for busterjs. There is
no support for coverage yet.

Signed-off-by: Sergio Correia <sergio@correia.cc>