Reduce query counts when querying API resources.

We previously introduced a prefetch_related() optimization for list
resources, helping to get the query counts down for any referenced
ManyToManyFields.

We also had a select_related() call, but this wasn't good enough.
Calling select_related() without parameters will only operate on
ForeignKeys that don't allow for NULL values.

Now, we build a list of fields to explicitly pass to select_related().
This has the benefit of working with fields that allow NULL values, and
prevents looking up fields we're not going to return in the payload.

Reviewed at https://reviews.reviewboard.org/r/6411/
Merge branch 'release-0.8.x'
Reduce the frequency of dirty calculations in inlineEditor.

inlineEditor no longer calculates the dirty state on every single key
press. Instead, it calculates it at most once every 200ms. This helps to
improve performance when the text field is large.

When it does calculate, the default behavior is now to first compare the
lengths of the strings. If those differ, then there's no need to compare
the string contents.

Reviewed at https://reviews.reviewboard.org/r/6426/
Fix dirty state calculation in inlineEditor.

The recent optimization for inlineEditor resulted in fields that could
not be saved, due to the dirty state not yet being updated.

Now, we force a calculation when we need the value. It will result in an
extra calculation, since a _.throttle can't be canceled, but it
shouldn't have any noticeable impact, as it occurs only on save/cancel
or when specifically requesting the dirty state.

Reviewed at https://reviews.reviewboard.org/r/6433/
Merge branch 'release-0.8.x'
Fix dirty calculation on cancellation of an inline editor.

cancel() was updating the dirty state in order to determine if it should
show a prompt. However, unlike save(), we don't want to unconditionally
do this, as we can end up in a state where the initial and current
fields don't match, but the user hasn't actually changed anything
(depending on the initial value set in an edited field).

We now call dirty() instead, which will properly handle forcing a
computation only if necessary.

Reviewed at https://reviews.reviewboard.org/r/6442/
Improve $.autoSizeTextArea with padded textareas and different fonts.

$.autoSizeTextArea worked very well when the proxy element and
<textarea> matched up perfectly (in terms of margins/padding and fonts)
and padding wasn't used in the text area. However, if one of these
conditions weren't true, incorrect heights would end up being
calculated.

We now assume that a minimum height is the full height of the field,
which may include padding. Since we are setting using height(), which
expects a content height without padding, we need to subtract any
padding that may be there. This helps to provide the heights that the
caller would expect.

We also set some sane defaults for the proxy element, removing any
margins, padding, and borders that may be there, and ensuring the font
is the same as the textarea.

This also updates setMinHeight() to trigger an auto-size. It was strange
that it didn't before, and that it was up to the caller to explicitly
trigger an auto-size.

Reviewed at https://reviews.reviewboard.org/r/6464/
Merge branch 'release-0.8.x'
Merge branch 'master' into release-0.8.x
Add a cache backend that can forward to other cache backends.

In Django, when you set a cache backend, you're stuck with it. Changing
backends after-the-fact doesn't really work without restarting the
application. This is because the 'cache' variable that gets imported is
an instance of the backend computed when django.core.cache loaded.

While we didn't used to have any issues from this in Review Board, some
new imports resulted in the cache backend being computed before we could
set the proper settings.CACHES entries.

This change gives us some flexibility by introducing
ForwardingCacheBackend. Projects can set this as the default cache and
then specify the real desired cache backend as another named backend,
and point ForwardingCacheBackend to it. All requests and operations will
go through there.

The siteconfig support has been updated to work with this. Nothing
really changes for consumers. Projects not suffering from the early
import problem will get the correct settings automatically, and projects
that do suffer from it will just need to make a change in settings
anyway (since prior to this, that was the only reliable way to set cache
in that situation).

Reviewed at https://reviews.reviewboard.org/r/6480/
Automatically transition away from older memcached backends.

Historically, the memcached backend used the class name 'CacheClass',
which we've been setting and many people have stored. While many
backends in Django do still have their CacheClass equivalent, memcached
does not.

We now fix up the name when normalizing the cache backend, which happens
on site settings load. This guarantees nobody will break.

Reviewed at https://reviews.reviewboard.org/r/6481/
Add draft release notes for 0.8.12

This adds release notes containing all of the changes since 0.8.11. This also
fixes an error in the 0.8.10 release notes that was breaking the index page.

Testing done: Built and reviewed HTML docs.

Reviewed at https://reviews.reviewboard.org/r/6488/
Merge branch 'release-0.8.x'
Release Djblets 0.8.12.
Bump to 0.8.13 dev.
Merge branch 'release-0.8.x'
Adding support for alphabetic pagination to the datagrid.

Updating the paginator in datagrid to allow alphabetic querying to be turned on
by providing the DataGrid object with the current_letter parameter (default
none).

If the current_letter is provided to the datagrid (usually by some child grid
calling the super initializer) the datagrid will simply load a second template
case added paginator.html.

It is the job of the child class (UserGrid in reviewboard) to process the URI,
perform filtering on the queryset, and handle errors.

Testing Done:
- Unit tests all pass
- All button cases manually tested. (Forward, back, first and last arrows,
  each letter).
- Verified that  changes to not affect any other module that inherits from
  datagrid (such as the groups list, or the all review requests list, the
  current 'master' of reviewboard with no changes to the userGrid).

Bugs closed: 829

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