Fix double file content in files in new subdirectories in Subversion

Summary:
Fixes T5555. Normally, when we `svn diff subdir/`, we use `--depth empty` to get only changes for the directory itself (usually, property changes).

However, this flag has no effect if the directory is newly added.

Adjust the diff parser so that if two sets of hunks are specified for a single file in a raw diff, we let the last one win instead of including both. This approach is a broadly more reasonable interpretation of these diffs.

Test Plan:
  - Added a new file in a new subdirectory in Subversion.
  - Ran `arc diff --only`.
  - No double file content in resulting diff.
  - Added unit test.
  - There's fairly comprehensive unit test coverage for this stuff.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T5555

Differential Revision: https://secure.phabricator.com/D9921
Reformat README as Remarkup

Summary: We have Remarkup, so why not use it?

Test Plan: See D9946.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9949
Add a newline to `externals/includes/README`

Summary: For consistency, add a trailing newline to `externals/includes/README`. See D9940.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9950
Remove duplicate newline

Summary: Remove a duplicate newline from end-of-file.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9951
Add Phrequent workflows to Arcanist

Summary:
Depends on D9906.

This adds `arc start`, `arc stop` and `arc tracking` for tracking tasks, diffs and other objects in Phrequent.

Test Plan: Tested this against a local install.

Reviewers: skyronic, #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: maxhodak, hach-que, aran, epriestley, Korvin

Maniphest Tasks: T3569, T3969

Differential Revision: https://secure.phabricator.com/D7327
Remove "Stopped" logic from Phrequent workflows

Summary: We can remove this "Stopped" code as per feedback on D7327.  I think having the full text of "In Progress" and "Suspended" is much clearer than just a '*' though, so I've only removed the ongoing check.

Test Plan: Ran a combination of `arc start`, `arc stop` and `arc time` and it all worked.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9955
Use have/need data in ArcanistPhutilLibraryLinter

Summary: Ref T5640. In D9864, the data this linter pulls out of the map was changed, breaking "use of undeclared function" warnings.

Test Plan:
```
>>> Lint for src/future/FutureProxy.php:

   Error  (PHL1) Unknown Symbol
    Use of unknown function 'qqqqqq'. Common causes are:

      - Your libphutil/ is out of date.
        This is the most common cause.
        Update this copy of libphutil: /INSECURE/devtools/libphutil

      - Some other library is out of date.
        Update the library this symbol appears in.

      - This symbol is misspelled.
        Spell the symbol name correctly.
        Symbol name spelling is case-sensitive.

      - This symbol was added recently.
        Run `arc liberate` on the library it was added to.

      - This symbol is external. Use `@phutil-external-symbol`.
        Use `grep` to find usage examples of this directive.

    *** ALTHOUGH USUALLY EASY TO FIX, THIS IS A SERIOUS ERROR.
    *** THIS ERROR IS YOUR FAULT. YOU MUST RESOLVE IT.

              15       $this->setProxiedFuture($proxied);
              16     }
              17
    >>>       18     qqqqqq();
              19   }
              20
              21   public function setProxiedFuture(Future $proxied) {
```

Reviewers: joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Maniphest Tasks: T5640

Differential Revision: https://secure.phabricator.com/D9954
Don't explicitly name abstract base classes

Summary:
Ref T5655. It is superfluous to include "base" in the name of an abstract base class. Furthermore, it is not done consistently within the code base.

In order to retain compatibility with external code, I have kept the `ArcanistBaseWorkflow` class (which trivially extends from `ArcanistWorkflow`), but it is now deprecated and should output a warning message. Similarly for `ArcanistBaseUnitTestEngine`.

Test Plan: Created a workflow which extends from `ArcanistBaseWorkflow`. Executed the workflow and saw a deprecation warning.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin, aurelijus

Maniphest Tasks: T5655

Differential Revision: https://secure.phabricator.com/D9983
Restore the old "history.immutable" default behavior

Summary: See rARC104219dd. Per the explanatory text, this should default to `true` in Mercurial and `false` in Git.

Test Plan: Ran `arc get-config` in Mercurial repo.

Reviewers: btrahan, joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D10021
Rename `ArcanistLintRenderer` subclasses

Summary: Ref T5655.

Test Plan: `arc lint` and `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T5655

Differential Revision: https://secure.phabricator.com/D10011
Use GIT tracked branches for arc land targets when reasonable

Summary:
See T5690.
-arc land now respects tracked branch when choosing 'onto'; '--onto' option remains as an override.
-arc land now respects tracked branch when choosing a remote; the remote is taken from 'onto's upstream unless the '--remote' option is present; when 'onto' branch has no upstream the '--remote' option must be provided as before.

Since 'arc feature' branches are (already) created as tracking branches, 'arc.land.onto.default' if present, is only used as the default when a non-tracking branch created by some other means is landed with out explicit '--onto'.  This may be surprising but is probably the correct go-forward behavior and is inline with the description in T5690.

Test Plan:
-checked having no arc.land.onto.default still assumes 'master'
-checked 'arc.land.onto.default' still overrides 'master'
-checked upstream branch (of feature branch) overrides 'master' and 'arc.land.onto.default'
-checked '--onto' overrides all
-checked origin is default for non-tracking branches
-checked the land onto branch's upstream remote is used instead of 'origin'
-checked '--remote' overrides 'origin' and the tracked upstream
-tested several crazy branch names including 'something/like/this' for both the upstream and tracking branches
-tested on linux and OS X
-rinse and repeat on Windows

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T5690

Differential Revision: https://secure.phabricator.com/D10058
Allow "arc browse" to browse objects

Summary: Ref T5781. This implements `arc browse T234`, for any monogrammed object.

Test Plan:
  - Ran `arc browse T234` outside of a working copy (does not require repository API).
  - Ran `arc browse T234` in a working copy, got task.
  - Ran `arc browse PATH` in a working copy.
  - Ran `arc browse nonpath` with and without `--force`.

Reviewers: csilvers, btrahan

Reviewed By: btrahan

Subscribers: epriestley, spicyj

Maniphest Tasks: T5781

Differential Revision: https://secure.phabricator.com/D10140
Add a --browse flag to `arc diff`, to open objects in a browser after creating them

Summary: Ref T5781. Add a flag to optionally open a web browser after creating a diff or revision.

Test Plan: Created //this revision// with `arc diff --browse` // !!! //

Reviewers: csilvers, btrahan

Reviewed By: btrahan

Subscribers: epriestley, spicyj

Maniphest Tasks: T5781

Differential Revision: https://secure.phabricator.com/D10141
Add a --browse flag to `arc todo`

Summary: Ref T5781. Like D10141, but for `arc todo`. Fixes T5787.

Test Plan: See T5787.

Reviewers: btrahan, csilvers

Reviewed By: csilvers

Subscribers: epriestley, spicyj

Maniphest Tasks: T5781, T5787

Differential Revision: https://secure.phabricator.com/D10142
Allow "arc browse <symbol>" to resolve symbolic commits

Summary: Ref T5781. This makes things like `arc browse master` work (but they open the commit, not a revision).

Test Plan: Ran `arc browse master`.

Reviewers: csilvers, btrahan

Reviewed By: btrahan

Subscribers: epriestley, spicyj

Maniphest Tasks: T5781

Differential Revision: https://secure.phabricator.com/D10143
Add a linter rule for parentheses being used with PHP language constructs

Summary: Fixes T5648.

Test Plan: Added some test cases.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T5648

Differential Revision: https://secure.phabricator.com/D10122
Rename a test class

Summary: Rename `ArcanistPHPCSLinterTestCase` to `ArcanistPhpcsLinterTestCase` for consistency with the class being tested.

Test Plan: `arc unit`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D10145
Don't interpret `arc browse .` as a commit

Summary: Ref T5781. `git show .` works like HEAD, but that isn't what `arc browse .` means.

Test Plan: Ran `arc browse .` with a repository at a published commit.

Reviewers: chad, btrahan, avive, avivey

Reviewed By: avivey

Subscribers: epriestley, avivey

Maniphest Tasks: T5781

Differential Revision: https://secure.phabricator.com/D10197
Remove --background flag to prevent `arc` from hanging

Summary:
Ref T4281. A long time ago, we added a `--background` flag to let `arc lint` and `arc unit` run while you're typing a commit message, in some situations.

This code is only moderately beneficial and is way too complicated. Particularly, it has a long history of causing hangs (T4281, T2463), doesn't work on Windows, and is impossible to debug.

It's also running into a serious PHP bug with EAGAIN/EPIPE being indistinguishable that I haven't been able to find a reasonable workaround for in ~3-4 hours of trying.

All the pathways forward that I can see make this already-complex system more complex.

The major reason that this stuff is so complex is that the subprocess may need to prompt the user (notably, to apply patches from lint).

Instead, I'm going to simplify how `arc diff` interacts with `arc lint` and `arc unit`, so we can just fire-and-forget a background process, let it do as much work as it can without needing user input, and then pick up wherever it left off. This will be slightly less cool/magical, but it won't hang bizarrely and I will be able to debug it.

For now, simply remove the `--background` flag and behavior so `arc` works for everyone.

Test Plan: Ran `arc diff` to create this diff.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T4281

Differential Revision: https://secure.phabricator.com/D10198
Merge in latest from upstream arcanist primarily so we pull in the fix for the hang on running arc diff(commit 54bea946c120fe9a2c0be834b2299bcb97c8584b)