Support invalid commit message in "arc branch"

Summary:
when a commit message contains error which fails the parsing, we 'arc branch' fails. One sample commit message we saw contains

  Differential Revision: 363812, 367983, 370452

The author manually committed the code without a real revision.

Test Plan: ran on the repo with problem commit and it succeeded.

Reviewers: epriestley

Reviewed By: epriestley

CC: malmond, aran, Korvin

Differential Revision: https://secure.phabricator.com/D2944
Create an arc todo workflow for quickly creating a task.

Summary:
Run `arc todo o rly?` to create a Maniphest task
titled 'o rly?'. Pass --cc to add CCs besides yourself.

Test Plan: Ran `arc todo o rly?`. Behaved as expected.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T749, T1325

Differential Revision: https://secure.phabricator.com/D2952
Support an 'editor' config in arc

Summary: See D2955. Allow "arc set-config editor ..." to override all other editor settings.

Test Plan: Ran "arc set-config editor 'mate -w'", am typing this in textmate.

Reviewers: btrahan, ezfoxie

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1309

Differential Revision: https://secure.phabricator.com/D2956
Add mb_* functions to the external function list

Summary: The mbstring extension is common but not part of the PHP core, and we have a soft dependency on it but generally guard calls with function_exists(). Add the mbstring functions to the whitelist of known extension functions so lint doesn't raise errors about them if you don't have mbstring installed.

Test Plan: @ffx, can you verify this fixes the lint issue for you? Probably faster than recompiling my PHP without mbstring.

Reviewers: ffx, btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D2961
Fix "arc branch" performance regression

Summary: See discussion in T1467. This `log` logs everything in the repo. The old command was `show -s`, I just unthinkingly converted it and it doesn't matter for non-Facebook-sized repositories.

Test Plan: Ran "arc branch".

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1467

Differential Revision: https://secure.phabricator.com/D2963
arcanist: add postponed linter support

Summary:
This uses a similiar approach as with postponed unittests, allowing
the lint workflow/engine to report postponed linter names.  After
the lint engine is run, a separate method is used to collect any
postponed linters and these are reposted to the diff via the
"arc:lint-postponed" property.

Also, a ##diff.wasCreated## was added allowing hooks to be called
immediately after the call ##differential.creatediff## with the
returned diff ID.

Test Plan:
Created diffs with a dummy lint engine which always reports a
postponed linter.

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1332

Differential Revision: https://secure.phabricator.com/D2933
Improve Arcanist + Windows + SVN compatibility

Summary: From "cmd.exe" with, e.g. SilkSVN, there are some issues getting arc to do anything useful. Resolve enough of them so that it's at least usable.

Test Plan: Created a revision from Windows / cmd.exe / arc / SVN.

Reviewers: btrahan, jungejason, vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D2984
Fix some arc/mercurial issues

Summary:
  - In "arc which", we recommend "--rev x --rev ." to show changes. This is not accurate if there are uncommitted changes in the working copy. Just "--rev x" shows the correct changes (implicitly, the other end of the range is the working copy state).
  - When you diff only working copy changes, we currently incorrectly identify all your open revisions as belonging to the working copy. Instead, correctly identify none of them as belonging to the working copy (in theory, we could go farther than this and do path-based identification like SVN, but with --amend in hg 2.2+ this workflow should be going away in the long run).
  - If you have uncommitted working copy changes, never try to amend.

Test Plan: Ran "arc which .", "arc diff ." in a working copy with dirty changes, got better results than before.

Reviewers: dschleimer, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1507

Differential Revision: https://secure.phabricator.com/D2980
Dump problematic parser patches to temp files in "arc diff"

Summary: I'm trying to get a repro for a Windows + SVN patch issue. Dump patches which fail to a temp file so there's less bewilderment in getting the right patch handed over for analysis.

Test Plan: Forced a parse failure, ran "arc diff", inspected temp file.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D2997
Fix arc handling of "\n" files on Windows in SVN

Summary:
On Windows, a diff may have "\n" newlines (from the file itself) but "\r\n" blocks (from svn).

NOTE: indents are funky since I edited this with Notepad++, I'll fix before landing.

Test Plan: Diffed an edit to a "\n" newline file on Windows in SVN.

Reviewers: btrahan, vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D2998
Speedup `arc branch`

Summary:
This reduces time of `arc branch` from 13s to 7s in my repo which is faster than `git branch --verbose` (10s).

The price for this speedup is that we loose the information [ahead 1, behind 21242] but we showed it only in branches with no revision so it's not a big deal.

Test Plan:
  $ arc branch

Reviewers: epriestley

Reviewed By: epriestley

CC: ahupp, aran, Korvin

Differential Revision: https://secure.phabricator.com/D3005
Specify error message for some pyflakes messages
Merge pull request #43 from rafikk/master

Specify error severity for some PyFlakes messages
Allow running phpunit tests from any directory

Test Plan: Run `arc unit` anywhere.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D3017
Adding confirmation message to 'arc todo' with information about the task created

Summary: 'arc todo' now logs a message with the task title and URI when run.

Test Plan: Run 'arc todo test' and see that it logs a message with the form 'Created task <task number>: '<task title' at <task URI>

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3016
Merge pull request #44 from ifraimow/master

Adding confirmation message to 'arc todo' with information about the task created
Show "Fnnn" number in "arc upload"

Summary: We don't show the "Fnnn" number, but should.

Test Plan:
```$ arc upload README --conduit-uri=http://local.aphront.com:8080/
Uploading 'README'...
  F121 README: http://local.aphront.com:8080/file/data/fnu76irnwftin4akjpxv/PHID-FILE-yrjeblelwq6rv5a5gjko/README

Done.```

Reviewers: phleet, btrahan, vrana

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D3023
Fix ambiguous argument where a branch has the same name as a file

Summary: Currently, if you have a branch named "docs" and a local file named "docs", `git show -s docs` complains because it's ambiguous. Use `--` to unambiguously mark branches as revisions, not files.

Test Plan: Ran `arc branch` in a working copy with a "docs" branch and a "docs" file, got expected results.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3030
Enable raising lint warnings for mulitple lines at once

Summary:
We have a lint rule checking if some string is too long.
This string can span multiple lines.
If we report a warning at the first line then it is muted if the first line wasn't modified.
We need to say that this whole block is wrong and report it when at least one line from the block was modified.

Test Plan: Changed a lint rule to call `raiseLintAtLines()` and verified that the warning is reported even if the changed line isn't first.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3029
Create a mysterious new workflow

Summary:
Phabricator, as we all know, is marketed as a fun adventure game. However, while it is occasionally fun and often an adventure, it's so far been sorely deficient in the game aspect. This patch aims to rectify that oversight. (Presence of the first two qualities is not guaranteed.)

Note: In case there's any doubt, this is not a serious suggestion. I was bored.

Test Plan: Seriously?

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

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