Catch SCMErrors in repository resource.

When RepositoryResaurce._check_repository would encounter an SCMError, it would
just blindly throw the exception up higher, returning a bare 500 error to the
client. It's not unexpected that we might hit SCMError, so here we go: return it
to the client as REPO_INFO_ERROR.
Remove https->http URL rewriting for hg repositories.

Nobody seems to remember why this is here, and users report that removing this
line seems to work fine.

Fixes bug 2555.
Fix an issue with mercurial on google code.

Google Code's hgweb-like thing uses "hg-history" instead of "raw-file". Simple
fix.

Fixes bug 2585.
Fix the name of the Hosting Service Account resource.

The Hosting Service Account resource name was incorrect, using '-'
instead of '_', which broke the payloads. Nobody's really using this
yet, so it's not a huge deal, but needed to be fixed.
Fix issues in the Mercurial Google Code change.

Some issues were introduced when merging in the change. A comma was
missing and a variable was being overwritten. This should resolve those
breakages.
Don't grind to a halt when encountering files with very long lines.

Files with very long lines would cause Review Board to sit processing
for a very, very long time. This happened both when styling the
orig/modified files using Pygments (which operates per-line, and is
really slow when there's just one giant line), and when attempting to
highlight changes between replaced lines.

Now we determine if there's a line over our limit (set to 1000
characters). If so, we turn off pygments, and we don't highlight changes
for that line (if it's a "replace").

This helps a great deal when people are putting up minified
JavaScript/CSS or large single-line data sets up for review.
Merge branch 'diffviewer/fix-long-lines'
Don't grind to a halt when encountering files with very long lines.

Files with very long lines would cause Review Board to sit processing
for a very, very long time. This happened both when styling the
orig/modified files using Pygments (which operates per-line, and is
really slow when there's just one giant line), and when attempting to
highlight changes between replaced lines.

Now we determine if there's a line over our limit (set to 1000
characters). If so, we turn off pygments, and we don't highlight changes
for that line (if it's a "replace").

This helps a great deal when people are putting up minified
JavaScript/CSS or large single-line data sets up for review.
Merge branch 'release-1.6.x'
Link the Djblets media to djblets/static/.

In Djblets, the media files are now located in djblets/static/. Link to
those instead of the old media/ files.
Collect static media for unit tests in the test directory.

This helps prevent pollution of the source tree when running unit tests.
Fix replying to comments.

The JavaScript comment contexts for comments were all renamed. They went
from singular to plural, and "comment" became "diff_comments". Not all
the JavaScript code was updated for this, so some functions ended up
bailing early.

Now the proper names are checked. Documentation for those functions have
been updated, and logging has been added for when unexpected context
names come up. This should make it much easier to spot the problems.
Fix replying to comments.

The JavaScript comment contexts for comments were all renamed. They went
from singular to plural, and "comment" became "diff_comments". Not all
the JavaScript code was updated for this, so some functions ended up
bailing early.

Now the proper names are checked. Documentation for those functions have
been updated, and logging has been added for when unexpected context
names come up. This should make it much easier to spot the problems.
Fix regressions with anonymous users and pending reviews.

The recent optimizations broke anonymous users, as we had some checks
that assumed that the user had a primary key. It also caused a variable
to be overwritten, making it appear as if the user had a draft of a
review on the diff viewer page.
Fix the Updates Required page for extensions.

The Updates Required page for extensions was trying to store the data in
the old _updates_required variable instead of the new updates_required
variable. This fixes it.
Don't assume all non-reply comments are on public reviews.

There was a bug in the new optimization code where non-reply comments
were assumed to be on public reviews, which triggered an assertion
check. We're now more explicit in the check.
Merge branch 'release-1.6.x'
Don't set gUserURL for anonymous users.

gUserURL was being set to a bogus value for anonymous users. We don't
actually ever use this for anonymous users anyway, so don't even set it.
Any code requiring it without checking gUserAuthenticated would be doing
it wrong.
Merge branch 'release-1.6.x'
Don't assume the existence of a public diff on the diff viewer page.

The new optimizations were assuming the existence of a diff when on the
diff viewer page. However, if the diff is a draft, the check we were
using would fail. We now check for that.