Merge branch 'release-1.7.x'
Merge branch 'release-1.7.x'
Rewrite the comment dialog using a model/view split, with unit tests.

This splits up the old commentDlg singleton and replaces it with a new
CommentEditor model and CommentDialogView view.

CommentEditor keeps track of the state of a pending comment edit. This
incudes what actions (save, delete, cancel) are allowed, the text of the
comment, the actual Comment backing it, opened issue state, and the
dirty state. It also provides the actions you can make, such as saving
the contents of the editor back to the comment and to the server, or
deleting it.

CommentDialogView replaces the old commentDlg view code, but leaves all
the state handling and operations up to the associated CommentEditor. It
also splits out the list of existing published comments into a separate
sub-view.

Unit tests are included to test the majority of this new functionality.
It should help catch any major regressions going forward.

There are improvements I want to make to this as we develop our
architecture. One is to rewrite how the existing published comments list
works. Right now, it's very unclean, since it's based on how Comments
currently work and how we handle serialization/deserialization. Later,
it should get a real backing and manage its own state better.

It also doesn't prevent editing on draft review requests, but that's not
a regression, and will be covered either in a revision to this, or in
another change.
Fix the link for the PyLucene installation docs in General Settings.

General Settings was pointing to an old, broken link for PyLucene
installation docs. This is now updated to point to the current location.
Fix Apache configuration files to explicitly use +FollowSymLinks.

The Apache configuration files we generate add a
"-Indexes FollowSymLinks," but apparently this isn't sufficient on some
installs. The "+" should be added before "FollowSymLinks". This is a
simple change to explicitly add this.
Fix a small vulnerability in the file change list in the diff viewer.

A change from a while back for some reason accidentally introduced
making entries in the file change list "safe", meaning that any HTML in
the filename would be rendered in the page instead of escaped. This was
due to these using the escapejs filter.

I can't see any reason why we'd want to use this filter in this case, so
I'm removing it, fixing the vulnerability.
Merge branch 'release-1.6.x' into release-1.7.x
Handle ssl: prefixed P4PORTs for Perforce 2012.1+

In Perforce 2012.1, they introduced actual SSL support (instead of just
requiring everyone to set up an stunnel wrapper on both ends). This wasn't
supported in Review Board for several reasons.

First of all (and this will require some thought), p4python's build will use a
useless stub ssl library unless it's built with --ssl <path-to-libssl-dir>, and
the system has OpenSSL 1.0.1. I've added some checking to print a useful message
when we hit this case, but we'll perhaps want to make some changes to
P4PythonInstaller, or at least document how to install p4python with SSL
support.

Once I had built p4python with SSL support, I started getting an error about
accepting the certificate. I've added support to do this, which required making
the existing certificate stuff handle the case where all we know is the
certificate's fingerprint (since apparently when the added ssl support they only
went so far as to verify fingerprints instead of full certificate validation).
While I was doing this, I ran into a problem where the "I trust this host" and
"Re-edit repository" buttons were getting disabled along with the rest of the
form.

This certificate gets saved to a .p4trust file in the user's home directory. I'm
not sure if that's going to cause problems or not.

Testing done:
- Ran p4d locally on my system with a port of "ssl:1667" and self-generated
  certificates. Added the repository to reviewboard using both "ssl:1667" and
  "ssl:localhost:1667" as the path. Saw the warning about the unknown
  certificate and accepted it. The repository was correctly added.

- Re-installed the standard p4python without SSL support and tried to add an
  ssl: perforce repository. Saw the warning about p4python built without SSL
  support.
Review Board Activity widget fails to remove all datasets

The issue was caused by the plot function not being called when no datasets were
selected, which meant the last dataset would always be displayed.

Testing done:
manual check
all automated tests pass

Fixes bug 2846
Reviewed at http://reviews.reviewboard.org/r/3725/
Fix the display of static media upgrade instructions in rb-site.

The static media upgrade instructions in rb-site didn't reliably work,
due to the state of the database not being what was expected at the time
when we output the instructions. So now we do the check before the
upgrade process begins.
Disallow installing on older versions of Python.

setup.py now checks if the version of Python on the system is new enough
for running Review Board. This should prevent the issue of someone
trying to upgrade or install on Python 2.4, getting the source tarball,
and then failing with confusing errors.
Add support for moved file handling for Perforce.

This adds support for representing moved files properly in Perforce.
This handles both files moved with and without changes made.

An accompanying change to post-review is needed in order to add moved
information to the diff format. Like the other fields in Perforce diffs
we respond to, this is entirely custom, as Perforce doesn't have any
useful information in p4 diff to provide.

This feature is funded by NetApp, Inc.
Properly normalize Perforce diffs with unchanged, moved files.

This was part of my original change, but got left out in the version
that was pushed upstream.

PerforceTool.normalize_patch looks to see if the diff being processed
represents an unmoved, changed file. The header we use for this isn't an
actual diff, and will make patch upset, so we normalize it to a blank
patch.
Fix timezone warnings when running search index command.

If the database has time fields which are un-annotated with a time zone, the
index management command will spew a bunch of warnings. If people have this
running via crontab, they'll get an email with all of that.

Fixes issue 2830.
Reviewed at http://reviews.reviewboard.org/r/3742/
Merge branch 'release-1.7.x'
Merge remote-tracking branch 'origrb/master' into bug2826
Update time_added of review_request when its published

Currently, the time_added of a review request is a default field that gets set
when a record is added. If there is a time difference between the creation time
and the time of actually publishing the review request, the field is not updated
and it shows the time of creation as the "Posted" time.

This addresses bug #1897