Prevent crashes when unable to get/create a ReviewRequestVisit.

Under some unknown race condition, it's possible that looking up or
creating a ReviewRequestVisit will fail when viewing a review request.
This isn't the worst thing in the world, and is likely a temporary
problem (probably due to two requests for creating the same
ReviewRequestVisit at once).

Instead of crashing, we now log the failure and continue on.

Reviewed at https://reviews.reviewboard.org/r/5959/
Merge branch 'release-1.7.x' into release-2.0.x
Allow for age-based filtering when reindexing for search.

This updates our SearchIndex to tell Haystack which field should be
considered to determine the age of a review request, in order to speed
up filtering.

Now, when running update_index with `--age=<hours>`, only review
requests that have been updated in <hours> will be updated or added to
the index.

Reviewed at https://reviews.reviewboard.org/r/5937/
Switch the default SVN backend to PySVN and require a newer Subvertpy.

While Subvertpy is easier to build, it's less complete than PySVN, and
has been the source of several bugs. Some users who have tried switching
to PySVN from Subvertpy have had issues due to a version of Subvertpy
remaining on the system.

We now default to PySVN as the backend if it's installed. It's
better-tested and likely to be more compatible.

For Subvertpy support to work, a minimum version of 0.9.1 must be
installed, since older versions have caused errors we don't want to deal
with.

I also renamed 'imported_dependency' to 'has_svn_backend', which is a
bit more clear and less likely to result in conflicts.

Reviewed at https://reviews.reviewboard.org/r/5957/
Fix the password reset URL.

The regex for extracting the token from the password reset URL was incorrect,
which resulted in an error that claimed "The password reset link was invalid,
either because it expired or has already been used."

Testing done: Went all the way through the password reset flow successfully.

Fixes bug 3395.

Reviewed at https://reviews.reviewboard.org/r/5961/
Fix the reply draft banner sticking around after a second publish.

Publishing a reply to a comment and then following it up with a second
reply would result in the reply banner sticking around, acting as if the
publish hadn't gone through.

This happened because signal handlers for the "publishing" and
"destroyed" events were registered twice on the first ReviewReply, which
would cause the state to mess up. We only really needed to register
these once.

Reviewed at https://reviews.reviewboard.org/r/5964/
Merge branch 'release-2.0.x'
Do a better job of escaping text in commentcounts tag.

If a user set their full name to include </script>, they could cause some
problems. Most of this was fixed in Djblets 0.7.30 and 0.8.3, but the
commentcounts tag in Review Board 1.7.x didn't use json_dumps, and therefore
still had the problem.

This change adds some more escaping for different parts of the commentcounts
structure that gets serialized.

Testing done:
* Tested the view_diff.html template.
* Ran unit tests

Reviewed at https://reviews.reviewboard.org/r/5955/
Add draft release notes for 1.7.26

This adds draft release notes for the bug fixes, security fixes, and one new
feature since 1.7.25.

Testing done: Built HTML docs.

Reviewed at https://reviews.reviewboard.org/r/5956/
Require Djblets 0.7.30.

This contains security fixes needed for json_dumps and gravatars.
Release Review Board 1.7.26.
Escape some more usernames and real names.

This change escapes a few more instances of usernames and real names which get
dumped into json code that gets executed.

Testing done: Ran unit tests.

Reviewed at https://reviews.reviewboard.org/r/5968/
Merge branch 'release-1.7.x' into release-2.0.x
Merge branch 'release-2.0.x'
Retry fetching a file using the base commit id if the original rev fails

When developing with Mercurial, a common workflow is to be working on a series
of patches at any one time, and push/pop them as required. So, "hg log" might
list something like:

5 qtip [mq] patch3
4 [mq] patch2
3 [mq] patch1
2 qparent second checkin
1 first checkin

When creating a review request, 'rbt post qtip' creates two diffs: from 2-4
(the parent diff) and 4-5 (diff in review). The problem occurs when a file is
changed in patch3 that's not in any of the previous patches. In this case, the
diff in review is relative to changeset 4, but "hg cat -r 4 path/to/a/file"
fails because the file isn't in the parent diff.

Work around this problem by trying to get a file from the base commit id if
fetching it via the revision recorded in the diff fails.

Testing Done:
Pushed 4 patches and ran 'rbt post qtip'; verified that the diff viewer showed
all of the changes.

Reviewed at https://reviews.reviewboard.org/r/5965/
Merge branch 'release-2.0.x'