Fix the broken diff link in the plain text email template.

The link to the diff was broken for plain text emails. Trivial fix.

Fixes bugs 2340 and 2366.
Fix a comment vulnerability allowing scripts to be loaded.

Due to the way that comments were loaded in, it was possible to
terminate a script and inject a new one while loading the diff viewer.
This isn't believed to have been a problem in the wild, but is certainly
an important one to fix.

We now ensure that the text is escaped at the point where it's being fed
into the JavaScript. It's no longer possible to inject scripts.

Thanks to Damian Johnson for the heads up and for the fix that this
change is based on.

This will be going into 1.5.7 and 1.6.3 releases.
Release Review Board 1.5.7.
Merge branch 'release-1.5.x' into release-1.6.x
Release Review Board 1.6.3.
Merge branch 'release-1.6.x'
Fix unit tests with newer versions of Django.

Newer versions of Django broke our unit tests by changing how the
permissions were created. This broke us because we stored the
auto-generated permissions in our test fixtures, but there's very little
reason for us to do that. They've been removed.

There was also some issue with our Mercurial tests. We included the
hg.json fixture before test_scmtools.json, which meant that the
Mercurial tool definition was created after the repository. Django
appears to be more strict now, so we broke. This was silly anyway, so
now the hg.json repository entry has just been moved into
test_scmtools.json.
Fix the import path for the fallback PIL Image.

It seems easy for PIL to be installed wrong. When it is installed wrong,
you need to insert Image instead of PIL.Image. Our unit tests attempted
this, but failed, as we tried to import Image from Image. Clearly,
nobody has hit this before now, but I have on my new deployment. This is
now fixed.
Merge branch 'release-1.6.x'
Enhance the Issue Summary table.

The Issue Summary table now uncollapses and navigates to the reviews
when the appropriate link is clicked.

The CSS has been converted to use lesscss format.

Reviewed at http://reviews.reviewboard.org/r/2709/
Fix SPF compliance.

Currently Reviewboard sends emails with a Return-Path of the current
user. This is not SPF compliant, and as a result review emails will be
rejected if a user's domain implements SPF with a reject all failed
messages policy and a reciever checks SPF.

This corrects this by setting the From header directly instead, and
passing the site default from email address as the Return-Path address.
This is needed on the KDE Reviewboard instance to ensure email delivery
runs well.

Reviewed at http://http://reviews.reviewboard.org/r/2702/
Add some initial release notes for 1.7 beta 1.

We'll keep adding to these as we make changes leading up to beta 1.
Fix the parameters for DashboardHook.

DashboardHook was taking entries as the first parameter, but it needed
an extension instance. This fixes that so we don't error out.
Switch to using django-pipeline and change our versioning.

This moves from django-compress, which is deprecated, to
django-pipeline. We only do pipeline work when we're on a production
system, or DEBUG is off. We fall back to using the less runtime on a
non-production DEBUG setup.

Rather than using MEDIA_SERIAL, we're now using Pipeline to version the
generated files. This will slightly reduce startup time, since we won't
have to stat the media files, and it also means we can version the files
individually instead of as a group. We'll have more fine-grained caching
as a result.

A future change will remove our use of MEDIA_SERIAL.
Merge branch 'release-1.6.x'
Raise NotImplementedError, not NotImplemented.

We weren't being consistent with returning NotImplementedError vs.
NotImplemented. This is a bit confusing as Python has both, but the
latter is intended as a return value for operators rather than an
exception.

This never seemed to have bit us in practice, but in theory we'd fail to
catch exceptions in some cases, so fix it.
Merge branch 'release-1.6.x'
Use NotImplementedError in hooks.

We introduced NotImplemented usage in the extension hooks, but should
have been using NotImplementedError instead.
Merge remote-tracking branch 'origin/release-1.6.x' into release-1.6.x
Update the issue summary table when issue states are changed.

When the user changes the status of an issue (resolve, drop, reopen), this will
update the issue summary table to match, as well as update the counts shown in
the summary of the block.

Reviewed at http://reviews.reviewboard.org/r/2726/