Fix a typo in the Bitbucket team name help text.

We had an embarrassing typo where we said "hte" instead of "the".
Bitbucket post-receive hook

This is a Bitbucket post-receive hook that will automatically close review
requests as "submitted" after a push. To determine which review requests should
be closed, it scans through each commit's commit message for the following
strings (case-insensitive): "Reviewed at <reviewboard_url>/r/<id>" or "Review
request #<id>". The regex used for this can be overriden in settings_local.py.

Testing Done:
Basic testing on a git repo performed. Test passed successfully.

All tests carried out on both mercurial and git repos.

Tests:
1) Close an open review request.
2) Try to close a review request that already has been closed as submitted.
   (Logged a warning saying that the review request has already been
   submitted).
3) Try to close a discarded review request. (Marked the review request as
   submitted)
4) Push without a review request id in commit message. (Error logged that the
   request id does not exist).
5) Push with a non existent request id in the commit message. (Error logged as
   Review request id does not exist.)

Reviewed at https://reviews.reviewboard.org/r/5653/
Refactor HTTP access out of HostingService class.

This change adds a new `HostingServiceClient` class which handles the basic
details of HTTP and JSON communication with hosting service APIs. This is
primarily just extracting the functionality out of the `HostingService` class.
Individual `HostingService`s can override this class to add additional checking
(such as GitHub's checking of rate limit headers), or add higher-level API
functionality.

Testing done:
* Ran unit tests.
* Tested post-commit review request creation.

Reviewed at https://reviews.reviewboard.org/r/5691/
Add a JavaScript resource for DefaultReviewer.

This adds DefaultReviewer as a resource. It doesn't cover the full
featureset of the API, but does allow for basic interaction with the
resource (mainly, basic fetching and deletion).

This isn't used today in Review Board, but may be useful down the road,
and is being used in RBCommons. I've opted to add it here, since its
size is minimal, and it helps complete our JavaScript API support, which
will only help extensions.
Merge branch 'release-2.0.x'
Properly pass in username and password to SVN backends.

The code to initialize the SVN backends wasn't passing in the username and
password during construction (instead they were added later). This caused some
workflows to break, especially when using the PySVN backend.

Fixes bug 3303.
Fix "Need more than 1 value to unpack" with ClearCase.

When generating a clearcase diff by hand and uploading it to an existing review
request, it may not have the desired file revision information in the same
format that RBTools uses. In this case, the filenames won't split correctly.

Testing Done: Actively used.

Fixes bug 3305.

Reviewed at https://reviews.reviewboard.org/r/5713/
Fix up and improve RB.ResourceCollection.

RB.ResourceCollection was documenting and supporting the old-style way
of opting in/out of resetting the collection during fetch. Backbone.js
changed how this worked. We now support the modern way, and document it.

The modern way (Backbone.js 1.1+) is to use 'reset' instead of 'remove'.
Resetting is also opt-in in Backbone.js 1.1, though we flip that for
this collection to make it opt-out. We're not currently using
Backbone.js 1.1, but we want to stay close to this semantics to smooth
over the upgrade process.

It's also pretty useful to be able to specify the maximum number of
items to fetch in each batch. Callers could do this by passing
extraQueryData['max-results'], but that was less than ideal. There's now
a maxResults option that can be passed instead.

There's also fixes for the pagination indicators, hasNext and hasPrev,
which could appear as 'undefined' depending on the payload.
Fix error handling in review-request publish

Fix the error-callback arguments when publishing a review request.

Testing Done:
Modified web API to return an error and verified that the errorText was
displayed in the alert box upon publishing a review request. Double-checked
with BackBone docs.

Reviewed at https://reviews.reviewboard.org/r/5719/
Fix documentation for rb-site --db-name with sqlite3.

The --db-name parameter isn't "not used for sqlite3", but is rather the path to
the database file. Trivial fix.

Fixes bug 3304.
Merge branch 'release-1.7.x' into release-2.0.x
Active Directory auth: try other domain-controllers even when STARTTLS fails

When STARTTLS fails for a domain controller don't bail out: instead keep trying
the other domain controllers. E.g. it could fail for the same reason that
unencrypted binds could fail: server unavailability.

This change ensures that unavailable servers as well as servers with
unrecognized certificates are skipped while still logging a decent message for
server admins to find out what's going on.

Testing Done:
Tested this on my company's review board server. Without it I get a failure
every few login-attempts when one of our domain controllers is down (I've got
TLS enabled for active directory authentication). With this patch it only logs
a warning and goes on with the next server.

The fact that it only fails every once in a while is probably related due to
SRV order-randomisation within the same priority level (all of our domain
controllers get assigned the same priority).

Reviewed at https://reviews.reviewboard.org/r/5701/
Merge branch 'release-1.7.x' into release-2.0.x
Sandboxed ReviewRequestApprovalHook and added test cases

Added Sandbox Extension and test hook.

Testing Done:
* Unit testing, added to test suites in reviewboard/extensions/tests.py
* Ran unit tests with and without the sandboxing

Reviewed at https://reviews.reviewboard.org/r/5677/
Merge branch 'release-2.0.x'
Move some more API access methods into GitHubClient.

This change moves some higher-level API access code out of the GitHub hosting
service and into GitHubClient. As a side-effect of this change, errors when
trying to fetch branches or commits are bubbled up correctly.

Testing done:
* Ran unit tests.
* Tested post-commit review request creation.

Reviewed at https://reviews.reviewboard.org/r/5697/
Add draft 2.0 release notes.

This has everything from the 2.0 beta 1, beta 2, beta 3, RC 1, and RC 2
releases, plus the changes that have gone in since RC 2, minus the changes and
bugfixes that have been backported to 1.7.x, and minus any fixes from later
prereleases for features introduced in earlier prereleases.

Testing done:
* Built HTML and read through it.
* Did some fancy-pants grepping to check for backported bugs.

Reviewed at https://reviews.reviewboard.org/r/5717/
Sandboxing NavigationBarHook get_entries

Added unit tests to test sandboxing

Testing Done:
* Unit testing, added to test suites in reviewboard/extensions/tests.py
* Unit testing with and without the sandboxing

Reviewed at https://reviews.reviewboard.org/r/5708/
Require the latest Django 1.4.11 security release.

This fixes a number of security issues. Most importantly to us, a bug in
reverse() that could lead to importing unexpected modules, if the
attacker knows which modules are on the server.

See https://www.djangoproject.com/weblog/2014/apr/21/security/
Release Review Board 1.7.25.