Correctly store base revision for Mercurial diffs with parent diffs.

Mercurial diffs with parent diffs do not work at all in RB 1.7.7.1 if there is
no overlap between the files in the diff and those in the parent diff.

This change fixes the issue and improves the method of dealing with Mercurial
diffs that was introduced changeset 6b1f537b4cf9. The old method was somewhat
fragile and was broken by changeset 562a8b4a21a9.

Testing done:
Tested using a local repo on which the problem was originally seen.
Added a unit test that tests this scenario.

Fixes bug 2971.
Reviewed at https://reviews.reviewboard.org/r/4121/
Add javascript for a new pre-commit review request creation UI.

This change adds a model and view for pre-commit review request creation. This
replaces the old form-based UI with one which is more interactive, and does a
lot more checking and guidance.

The basic workflow is that users are asked first to select their diff file,
either through a file picker or drag-and-drop. For the most basic case, this is
all that's required--the frontend will test that the diff is valid (parses +
upstream files exist) and create the review request.

In the case of perforce, the user will be prompted for a change number. In the
case of SVN, the user will be prompted for a basedir. At the moment, this does
not do parent diffs. I'm kind of conflicted about whether or not we should add
it, since it does complicate things pretty significantly. My instinct here is to
say no for now and defer people to the command-line tools if they want something
fancy.

This is massively improved in the case where a user tries to upload a git diff
that was generated with partial SHAs--we'll detect that case and ask the user to
use --full-index.

Testing done:
- Created lots of different review requests for SVN and Git.
- Tested various error conditions (wrong basedir, partial shas, badly
  formatted diff, etc).
- Ran jshint

Reviewed at https://reviews.reviewboard.org/r/4391/
Added support for authentication against Active Directory subdomains.

This patch enables authentication against specific AD subdomain extracted from
the username. E.g. for configured domain name "example.com" user "north\tom"
will be authenticated as "tom" against "north.example.com".

Testing done:
I have this running fine with multiple AD subdomains configured in my
organization.

Reviewed at https://reviews.reviewboard.org/r/2838/
Fix the gitweb URL format in the docs.

The example for a raw file URL using gitweb said to use hb=<revision>, but the
correct format is h=<revision>

Fixes bug 3027.
Tell users to back up their database before upgrading their sites.

We do this when we're answering people's questions on the mailing list, so we
should probably do so in the docs as well.
Remove executable bit from static and templates files.

Some files (mostly ones which were extracted from a third-party archive) had
the executable bit set. Remove it.

Fixes bug 3038.
Fix ValueError when the user enters a bad cache host.

If the user enters a cache hostname which doesn't split properly, it makes the
admin site unavailable. This is because the cache stats code was just blindly
trying to unpack the values without any error handling. I've updated it to
cache this case, log, and continue.

Fixes bug 3049.
Reviewed at https://reviews.reviewboard.org/r/4402/
Make issue_opened and issue_status more consistent.

If a user creates a comment with an issue, and later removes that issue before
publishing, we end up in a weird state where the issue_status is still 'O' but
issue_opened is false. This change fixes it to clear out issue_status when
removing the issue_opened bit.

Testing done: Ran unit tests.
Fixes bug 2984.
Reviewed at https://reviews.reviewboard.org/r/4404/
Set the cwd of 'patch' to be the tempdir.

This isn't usually necessary, but at least one person reported an instance
where it was (probably depending on their version of the `patch` command), and
it doesn't hurt anything.

Fixes bug 2065.
Merge branch 'release-1.7.x'
Merge branch 'release-1.7.x'