Handle binary file moves in `arc patch` under Git

Summary: We don't store old file PHID for binary file moves here.

Test Plan: `arc patch` on revision with binary file moves which was failing earlier.

Reviewers: epriestley, btrahan

Reviewed By: btrahan

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3521
Mark moved binary file as image

Test Plan: Moved image, verified that the source file is marked as image: https://secure.phabricator.com/differential/diff/6924/

Reviewers: epriestley, btrahan

Reviewed By: btrahan

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3520
Build correct corpus in copied or moved files

Summary:
This problem shows very far away.
One of the symptomps is that the contents of a moved file is displayed as added in Differential but it is not a big deal.

The real trouble happens when you try to `arc patch` this diff.
It tries to both copy the file and to add a new contents (which fails).

Fixes T1709.

Test Plan:
  $ git mv a b
  $ git commit -m.
  $ arc diff --only
  $ git reset --hard HEAD^
  $ arc patch --diff # of the created diff

  $ arc unit src/parser/__tests__

Reviewers: epriestley, btrahan

Reviewed By: btrahan

CC: aran, Korvin, boris, mroch, slawekbiel

Maniphest Tasks: T1709

Differential Revision: https://secure.phabricator.com/D3524
Properly handle file moves in `arc patch` under SVN

Summary:
If the file has no changes (probably because it has been moved or copied) then we fail.

Fixes T1708, fixes T1559.

Test Plan:
  $ svn mv a b
  $ arc diff --only
  $ svn revert a b
  $ arc patch --diff # of created diff

Reviewers: epriestley, btrahan

Reviewed By: btrahan

CC: aran, Korvin

Maniphest Tasks: T1559, T1708

Differential Revision: https://secure.phabricator.com/D3526
Handle empty file add in Git export

Summary: Fixes T1555.

Test Plan: Added empty file, diffed it, exported and patched. Also manually created diff in Differential.

Reviewers: btrahan, epriestley

Reviewed By: btrahan

CC: aran, Korvin

Maniphest Tasks: T1555

Differential Revision: https://secure.phabricator.com/D3536
Add git-repo-based bundle tests

Summary:
Adds a test which goes through a git repository commit by commit and applies them (in effect) via "arc patch", verifying that the results match the actual commit.

See D3439 for the fixture stuff.

The git repo archive has a couple of trivial commits in it:

  $ ../libphutil/scripts/utils/directory_fixture.php src/parser/__tests__/bundle.git.tgz
  Spawning an interactive shell. Exit when complete.

  sh-3.2$ git log
  commit f19fb9fa1385c01b53bdb6d8842dd154e47151ec
  Author: epriestley <git@epriestley.com>
  Date:   Wed Sep 5 14:30:28 2012 -0700

      Edit a text file.

  commit 228d7be4840313ed805c25c15bba0f7b188af3e6
  Author: epriestley <git@epriestley.com>
  Date:   Wed Sep 5 14:30:11 2012 -0700

      Add a text file.

Test Plan: Ran tests.

Reviewers: edward

Reviewed By: edward

CC: aran

Maniphest Tasks: T866

Differential Revision: https://secure.phabricator.com/D3440
Reformat lint severities for readability

Summary: See D3482.

Test Plan: `arc lint`

Reviewers: vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3501
fix a bug in ArcanistXHPLinter

Summary: $param is null here. it should be $node.

Test Plan: arc lint no longer barfed on me!

Reviewers: vrana, epriestley

Reviewed By: vrana

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3540
Make `arc diff --background 1` default and disable it on Windows

Summary:
I am using it for about a month.
It works even in Facebook www.

Test Plan:
  $ arc diff --background 1 # hundreds of times

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3495
Flush output before printing lint and unit results in diff

Summary:
Under HPHP, output buffer size is ignored.
Flush any buffered output before printing anything from `arc diff` to reduce user's confusion.

Test Plan:
  $ arc diff --preview --background 1
  $ arc diff --preview --background 0

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3543
Step towards working `arc diff --background 1` on Windows

Summary:
Running `a.php` from command line doesn't work on Windows, we need to run `php a.php`.
This shouldn't break other OSes.

Test Plan:
  $ arc diff --background 1

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3544
Unuse $argv in `arc diff --background`

Test Plan: This diff.

Reviewers: epriestley

Reviewed By: epriestley

CC: zeeg, aran, Korvin

Differential Revision: https://secure.phabricator.com/D3550
Merge branch 'master' of http://github.com/facebook/arcanist