WSGI: Fix capitalization typo

Testing Done:
Manually edited the installed .wsgi file and proved that it still loads properly.

Reviewed at https://reviews.reviewboard.org/r/5546/
rb-site upgrade: do not throw error if no sites are configured

Previously, if 'rb-site upgrade --all-sites' was called and the site file
either did not exist or contained no valid entries (such as all sites having
been removed but the sitelist being missed), it would return with error code 1.

This breaks scripts such as that on an upcoming Fedora release of Review Board
that will be running the --all-sites upgrade as part of the Apache start-up. In
order for it to be possible for Review Board to be installed on the system,
unconfigured and not break Apache, we need to treat this exit code as success.

Testing Done:
Verified that running 'rb-site upgrade --all-sites' with no
/etc/reviewboard/sites file printed the message "No Review Board sites listed
in /etc/reviewboard/sites" and exited with code 0 (success).

Reviewed at https://reviews.reviewboard.org/r/5547/
Merge branch 'release-1.7.x' into release-2.0.x
Fix more unicode issues in diff parsing.

A bug came in about parsing hg diffs with unicode characters, which prompted me
to audit all of our scmtools. There were a bunch of issues lurking, most of
which were exposed when I added unit tests.

Testing done: Ran unit tests.

Fixes bug 3261.

Reviewed at https://reviews.reviewboard.org/r/5540/
Fix unicode and style issues in the markdown review UI.

The fix I did for markdown to properly handle unicode objects failed if the
object we were trying to iterate over was already encoded to utf-8. The
exception was caught and logged, but the resulting rendered view was empty.

I've changed the markdown UI to pass the error through to the user, so they at
least see something.

Once I got the file displaying, I noticed that there were a few issues with the
style rules. First, lists had their bullets overlapping with the line numbers
(because of the all-elements rule to get rid of padding). Second, we have a
bare 'h1' rule in common.less that made h1 smaller than h2. I've restored it to
the same size it should have been, but we should probably make the common.less
rule much more specific.

Testing done:
* Verified that without the encoding fix, I saw an error in the "Rendered" tab
  instead of nothing.
* Checked that with the encoding fix, I could see the page.
* Checked that the style changes fixed the issues I saw with this particular
  document.

Reviewed at https://reviews.reviewboard.org/r/5548/
User manual part 3: Update "Reviewing Diffs"

This change adds a bunch of new content for the "Reviewing Diffs" page to
explain several of our coolest diff viewer features. This also rewrites some of
the text to be clearer, and replaces all of the old screenshots with both 1x
and 2x screenshots of the modern UI.

Testing done:
Built the HTML manual and looked at all the pretty things.

Reviewed at https://reviews.reviewboard.org/r/5545/
User manual part 4: Reviewing Images and Reviewing Markdown Files pages.

This change makes some small text changes (mostly updating the notes about
replies), and adds pretty screenshots of each of the UIs.

Testing done: Built HTML docs.

Reviewed at https://reviews.reviewboard.org/r/5549/
User manual part 5: Replace screenshots on the "Issue Tracking" page.

Trivial replacement of screenshots with new versions, including @2x versions.
Don't use six on release-1.7.x.

A change I crossported used six.text_type. Since this doesn't exist here, don't
use it.
Merge branch 'release-1.7.x' into release-2.0.x
Allow auth backends to act on a user-list query before it's executed.

Added an overrideable function to AuthBackend which is called at the beginning
of UserResource.get_query_set(), which in turn is called by the GET /users/
WebAPI call.  The default function does nothing.  This allows backends to add
their own logic to fetch users from an external source and add them to the
local user database (or update existing users) before the db query is executed.

I added docs and fixed the doc for another AuthBackend overrideable function
while I was there.

Testing Done:
All tests pass aside from a few VCS-dependent ones, which are skipped.

Reviewed at https://reviews.reviewboard.org/r/5521/
Fix get_auth_backends usage.

The patch I just pushed was based on an older revision, and used
get_auth_backends, which Christian recently renamed. This changes it to use
get_enabled_auth_backends instead.
Fix move ranges spanning different remove groups.

When a move range for inserts spanned remove groups on the left-hand
side, the resulting move ranges would appear to be offset in weird ways.

What was happening was that, while determining the range, we'd keep
seeing new remove groups on the left-hand side, which would cause us to
reset our ranges. The final remove group on the left-hand side would
account for the range length, and the range would appear to start on
that side at the top of that group. However, on the right-hand side,
it'd start at the correct place, but have the truncated range.

To fix this, we need to do a few things:

1. We need to glue the remove groups together better. When we see a
   new group (such as when going from a delete to a replace), we now
   check if it immediately follows the last move range we were working
   with. If so, we use that instead.

2. We then needed to terminate those ranges by resetting prev_key when
   we know we're not going to be continuing a range.

3. We need to store all groups within the range, and set the move
   opcodes on all of them. We were previously only dealing with the
   first (or sometimes last -- depending on the code path) group,
   which would prevent us from being able to show the range in the
   diff viewer.

4. Upon encountering a blank line, we need to be sure to add that
   line's opcode group to the list of groups. Even if it's an "equal"
   (which will now show up in a move range, but only where it's
   appropriately bridging two consecutive ranges).

5. When drawing the move ranges, we can't rely on computations from
   the previous line, because we only have the previous line within
   that chunk. So now we store info on the start of a range along
   with the to/from line number. That lets us simplify the move
   range drawing quite nicely, and guarantees it reflects what's
   computed.

To make all this a lot nicer, I've added a container for move ranges,
called MoveRange. This keeps track of the start and end, and the
affected groups. It's cleaner than rebuilding and indexing tuples
everywhere.
Fix a ton of PEP-8 issues.

Since ReviewBot has been slacking off, a bunch of issues have slipped in (plus
there are a lot that we just never fixed up). This change fixes almost
everything, with the exception that a few things PEP-8 thinks are problems are
actually preferred.

Testing done: Ran unit tests.

Reviewed at https://reviews.reviewboard.org/r/5509/
Fix usage of 'apache_auth' field for templates.

If deploying with lighttpd, there won't be any definition for 'apache_auth'. We
should therefore avoid trying to use it. Trivial change.

Fixes bug 3263.

Reviewed at https://reviews.reviewboard.org/r/5561/
Fix user profile form saving.

The profile form only saved values if the backend *didn't* support changing
them. This looks like a copy/paste-o.

Testing done: Changed my real name and email address successfully.

Fixes bug 3268.

Reviewed at https://reviews.reviewboard.org/r/5559/
Fixed the alignment of line numbers on moved rows in diffs.

A couple fixes were attempted in the past to fix alignment of line
numbers whne moved rows came into play. The reason they didn't work was
the (fairly reasonable) assumption that every moved row had the
'.moved-row' CSS class. This was only set for the rows with move flags,
though.

Since that's a pretty decent assumption to make, let's make it true.
Every moved row now has the '.moved-row' class applied.