Normalize paths for display in reviews and notifications.

This makes reviews for Clear Case contain readable filenames.

Tested on team Review Board 1.6.11 installation.
Reviewed at http://reviews.reviewboard.org/r/3302/
Don't allow all users to see a user's unpublished review replies.

Only put public reviews and non-public reviews created by the authenticated
user in the reviews_id_map, so that unpublished replies are not seen by other
users.

1. Created a review request as user A and published it.
2. As user B, made a comment on a portion of the diff and publish it.
3. As user C, replied to the comment made in step 2 but did NOT publish it.
4. Without the patch, all users could see the comment made in step 3.  With the
patch, only user C could see that comment.

Fixes bugs 2710 and 2719
Reviewed at http://reviews.reviewboard.org/r/3317/
Fix ClearCase unextend_path() on Windows.

The ntpath in Python behaves in the following manner:
  >>> ntpath.join('c:', 'dir', 'file')
  'c:dir\\file'

  >>> os.chdir('C:\\Windows')
  >>> ntpath.realpath(ntpath.join('C:', 'dir', 'file'))
  'C:\\Windows\\dir\\file'

  >>> os.chdir('C:\\Windows')
  >>> ntpath.realpath(ntpath.join('C:\\', 'dir', 'file'))
  'C:\\dir\\file'

  >>> ntpath.realpath(ntpath.join('/', 'computer', 'share', 'file'))
  'C:\\computer\\share\file'

  >>> ntpath.realpath(ntpath.join('\\\\', 'computer', 'share', 'file'))
  '\\\\computer\\share\\file'

The unextended_chunks[0] in case of repository on local drive is 'X:' where X
is the drive letter, and in case of UNC path is '/'. Change the
unextended_chunks[0] so the returned realpath is correct.

This both makes the displayed path proper and resolves the "ValueError: Cannot
mix UNC and non-UNC paths" when Clear Case repository is configured with UNC
path.

Tested on production 1.6.11 installation.

Reviewed at http://reviews.reviewboard.org/r/3321/
Fix ClearCase relpath on Windows.

ntpath.relpath() overflows and throws TypeError for paths containing atleast 520
characters (not that hard to encounter in UCM repository). Handle this problem
by falling back to the "approximation method".

Tested on Windows ReviewBoard 1.6.11 installation.

Reviewed at http://reviews.reviewboard.org/r/3323/
Add support for incremental diff expansion.

Review Board has always had the ability to let users expand collapsed
chunks of diffs, but this can produce a lot of content when dealing with
large sections of collapsed code.

This feature introduces incremental expansion. Users can expand the
diffs by 20 lines at a time, before or after the collapsed header. They
can also expand up to the nearest function listed, and of course, can
expand te entire header.

When a diff is expanded, even partially, little floating collapse
buttons will appear near the center column. They'll stay in view,
centered amongst the visible portion of the expanded region. Clicking
them will re-collapse that segment.

This feature was sponsored by NetApp, Inc.

Fixes bugs 342, 603, and 1231.
Add support for ClearCase snapshot views.

This is especially useful for Windows installations due to the pathname
limitation.

Tested on Windows ReviewBoard 1.6.11 installation.
Did some basic tests on Linux.

Reviewed at http://reviews.reviewboard.org/r/3322/
Tweak a couple styles for the review request box.

The double border between the action bar and the review request contents
is now a 1px border instead.

The right-most action's rounded corner has been fixed. The background
color was sticking out, as it was still a rectangle.
Update to jQuery 1.8.

This change updates us to jQuery 1.8. The main highlights are that we
now use on() for event binding (instead of bind() and live()) and we no
longer use removed methods for content handling in ajax requests.

We also now use the latest upstream of jquery.form.js
(https://github.com/malsup/form). We were using a very old fork that
worked around some bugs in IE and Opera, but these fixes have long been
included in jquery.form.js. This release is needed for jQuery 1.8
compatibility.

The bulk of this work was done by Yazan Medanat, with some small
changes, moving of files to the new lib directory, CSS fixes,
and jquery.form.js updating done by me.

Given how out of date we were before, it's expected that some things may
still be broken. We'll need to dogfood this carefully before release.

Reviewed at http://reviews.reviewboard.org/r/3267/
Fix the administrator add/change repository tool.

The upgrade to the UI / theme introduced a bug where some code expected
jQuery before it was made available. This fixes that bug.

This fixes Issue #2742.
Fix scrolling to diff chunks with jQuery 1.8.

The way selectors worked has changed since jQuery 1.3. This broke our
anchor selection and highlighting. We needed to quote the anchor name,
which seems to work quite well.
Fix the style for the diff section of the review request box.

The diff information section in the review request box was right up
against the border of the box. It now has padding consistent with other
elements of the box.
Fix diff line highlighting on Firefox.

jQuery removed Event.originalTarget, causing our line highlighting to
fail. Event.target seems to be more or less what we want, though, so use
that instead. This fixes it in Firefox, and things still work correctly
in Chrome.
Add Karl Leuschen to AUTHORS.
Replace the Report Bug and Bugs links with Support.

The Report Bug and Bugs links in the top header bar have been replaced
with a link to our Support page. This should provide a better support
mechanism for our users, who sometimes will file bugs for support or
file bugs thinking it's for their own product, and get them to better
content right away.
Fix linking to bug numbers when they contain "#".

Bug numbers, when prefixed with "#", included the "#" as part of the bug
URL. This is now stripped.

Fixes bug #2449
Fix Git diffs with deleted binary files.

Deleted binary files in git diffs was causing parsing problems. We'd
skip over the entry entirely, so it would never show up in the diff
viewer, and it seems the file info was ending up in another file's diff.

The parsing has changed to not bail so early with empty (no-data)
changes. Really, this code could all use a rewrite, but this seems to
work pretty well for now.

Fixes bug #2419
Fix preserving extra headers and data in diffs.

A long-standing bug in our diffs, which especially affects Git users, is
that our diff parser would lose information before the diffs and even
lose some within the diffs.

Diffs formatted with 'git format-patch' contained headers on the
author, description, diffstats, and more, prior to the first
'diff --git' line. We just ignored this, meaning that users who then
tried to get their patch out of Review Board would find it all missing.

That has been changed in both the standard diff parser and Git's pretty
custom parser. We now store this "preamble" and make sure the first file
contains it at the beginning of its payload.

We also no longer hide the "Binary files have changed" part of a Git
diff, which was accidentally being left out.

As part of this, we're no longer trying so hard to remove stuff we're
afraid patch can't handle. patch can handle a lot of things, so we're
just going to include it all. The thought being that if some tool is
generating content in a diff, at some point they'd have to have tested
that with patch. If it turns out something breaks as a result of this,
we can incrementally bring back filtering.

Unit tests have been updated for this change, as many of them were
expecting not to see certain things, or for smaller payloads. A new unit
test testing all the headers in a standard git format-patch has also
been added.

Fixes bug #929
Fix a regression with rendering comment fragments.

The recent incremental expansion work introduced an occasional breakage
with diff comment fragments. The code wasn't updated for the new
headers, and sometimes broke, depending on what was in them.
Improve the usability of the incremental expansion feature.

Every expansion link (icon and text) now has a tooltip saying what will
happen when clicked.

The expansion icons on the left now show how many lines they'll expand,
and at the same time they give a wider hit box. The tooltip says that
they'll expand 20 lines above or below, depending on the icon.
Don't perform syntax highlighting for very large files.

It's very expensive to perform syntax highlighting on very large files.
Especially certain file types, like XML files, which can take minutes
and actually fail to return within the browser timeout.

We now only highlight if the file is under 200KB.