Fix sample usage instructions for post-commit hooks on Local Sites.

The usage instructions were showing review request URLs off the root of
the site, rather than ones from a Local Site. We now generate a URL (and
a sample ID, for consistency) and send it off to the template for
rendering.

There's also a fix for some non-localized usage text ("Or:").

Reviewed at https://reviews.reviewboard.org/r/6353/
Merge branch 'release-2.0.x'
Fix a couple trailing commas in javascript.

A couple small trailing comma errors snuck in since the last time we ran jshint
on all our code. Trivial fix.
Merge branch 'release-2.0.x'
Fix a few more trivial jshint problems.

This fixes a couple variable which were defined but not used, and comments out
an unused argument in an abstract base class. Trivial changes.
Require Python Markdown 2.4.1.

Python Markdown 2.5 was recently released, and doens't support Python
2.6. This broke some users on upgrade. We need to use 2.4.1 instead.
Merge branch 'release-2.0.x'
Only include unpublished review requests in the API when requested.

Recently, a change was added that resulted in /api/review-requests/
returning all unpublished review requests for all users, when requested
by an admin. This could impact existing scripts, and potentially make
things harder for day-to-day work by users who happen to also be admins.

Now, the caller must pass ?show-all-unpublished=1 to get this new
behavior. That allows scripts to opt-in to this only when needed.

The flag on ReviewRequestManager was also renamed to
show_all_unpublished. If set, the resulting query is actually
simplified and doesn't do any public= or submitter= checks. Previously,
it resulted in a query like "public = true OR submitter = <user> OR
public = false", which was unnecessary.

The renaming of the flag also helps clear up confusion about its
relation to accessing private review requests (private by way of
group/repository settings).

Reviewed at https://reviews.reviewboard.org/r/6360/
Fix some validation issues and error display on Bitbucket.

It was common for people to put invalid repository names or usernames
into the Bitbucket repository config form. When this happened, we'd
either end up storing bad account information, fail with a cryptic
error, or crash.

Some of the most common problems here have been fixed.

We now check the the validity of the username and password prior to
storage. We fetch the user session API, using the credentials provided
by the user. The credential data is only stored if this succeeds.

If any API request results in an HTTP 401, we raise an
AuthorizationError. All other errors result in a HostingServiceError
(previously, we'd raise an Exception, which wouldn't always be caught
correctly). If the data from the server was a valid error payload, we
now parse that and display the error message.

Repositories are now validated properly as well. A repository name that
looks like a path (has a '/') or contains '.git' will immediately result
in an error instructing the user to provide just the name. If a name
meets the criteria, but is not found, a suitable error will also be
shown instead of a JSON payload.

Reviewed at https://reviews.reviewboard.org/r/6359/
Merge branch 'release-2.0.x'
Fix KeyError: u'message' in SVN commits backend.

Not every commit we get has a message, which can cause exceptions to be thrown
from the repository commits resource. We already had one fix for this sort of
error with the author fields. This change fixes it up to do the same for
message and author everywhere.

Testing done:
Ran unit tests.

Addresses part of bug 3579.

Reviewed at https://reviews.reviewboard.org/r/6361/
Merge branch 'release-2.0.x'
Normalize the hooks_uuid field before saving the repository.

The hooks_uuid field would become a blank string after editing in the
admin UI. This resulted in a collision as soon as there was more than
one entry with a blank string.

We now normalize this to None if blank prior to saving.

Reviewed at https://reviews.reviewboard.org/r/6362/
Bullet-proof pre-commit UI a bit.

When receiving an unexpected error from the server, the frontend code for the
pre-commit upload would hit a TypeError, preventing it from completing the
process and leaving the browser with a forever "Loading..." message. This
change updates it to check when the response can't be parsed as JSON and show
"Unknown error" instead.

While I was in here I fixed up some of the nearby localization to be more
correct.

Testing done:
- Checked that uploading a diff through the pre-commit UI still worked as
  expected.
- Ran js-tests.

Reviewed at https://reviews.reviewboard.org/r/6365/
Fix the handling of binary data when reading in diff files in javascript.

Our drop-in replacement for File.readAsBinaryString wasn't entirely drop-in, in
that if it encountered any bytes > 127, it would fail with an
InvalidCharacterError, which would get translated into a fake ajax error that
said "HTTP 0" (which I don't have to tell you is completely useless). The
problem here was that we were using Int8Array instead of Uint8Array to convert
each byte into a String.

Testing done:
Made a diff that added a BOM to a utf-8 file. Tried to upload that diff and got
the same mysterious HTTP errors that appeared before any HTTP request got made.
After this change, the diff uploads correctly and I can see the added BOM in
the diff viewer.

Reviewed at https://reviews.reviewboard.org/r/6364/

Fixes bug 3579.
Merge branch 'release-2.0.x'
Add debugging and a script for issue count calculation.

There have been some reports of issue counts failing to calculate
correctly. The cause is not obvious, so we need better debugging.

This adds some debug logging to show all the calculation state for a
given review request's issues, which users can send us when they
encounter problems.

It also adds a reset-issue-counts management command, which will reset
issue counts for particular review requests, or all review requests if
passing --all.

Reviewed at https://reviews.reviewboard.org/r/6366/
Add help output for the rb-site manage command.

This includes some basic help output for rb-site's 'manage' command that
explains how to get the list of commands and execute them.

Reviewed at https://reviews.reviewboard.org/r/6367/
Add release notes for Review Board 2.0.8.

This covers all the fixes made since 2.0.7, and adds several new
contributors to the AUTHORS list.
Update the minimum versions of our dependencies.

This adds minimum versions of Haystack and Whoosh, in order to resolve
some version issues. It also updates the minimum versions of Djblets and
Django Evolution.