Fix replying to file attachment comments when the file attachment is removed.

Commenting on a file attachment, then removing the file attachment, then
replying to the comment was broken. This was due to looking up the
associated review_request only using the relationship for active file
attachments. We now check the inactive_review_request relationship too.
This is something that screenshot comments already do, but that fix
never made it to file attachments.

A unit test was added for this.
Show Users' fullname in review emails

When displaying the name in review emails, show the users' fullname if they have
a first name setup. Otherwise show their username. This change is made in both
html and text emails.

Testing done:
Manual. Tested with email setting on and off.

Reviewed at http://reviews.reviewboard.org/r/4104/
Fixes bug 2965
Fix overzealous file existance caching.

File existence check caching had a flaw where, if a file didn't exist,
we'd cache that it didn't exist, but if it was later pushed and then did
exist, we'd still think it didn't.

We now only cache when it exists. If it doesn't, we don't cache, and
will check again the next time get_file_exists is called.
Merge branch 'release-1.7.x'
Add a unit test for API root caching.

This adds a unit test to make sure that caching of uri_templates in the API root
takes into account the correct local site.

Testing done:
Ran all tests.
Before the djblets change, the new test failed. After, it succeeds.

Reviewed at http://reviews.reviewboard.org/r/4109/
Add an extra_data JSONField to the user profile

This will be useful for all manner of stuff, including extensions.

Testing done: Ran evolutions.

Reviewed at http://reviews.reviewboard.org/r/4137/
Merge branch 'release-1.7.x'
Fix issues with deleting comments on replies.

We've had some long-standing issues deleting comments on replies.
Deleting comments using the reviews/<id>/replies</id>/*-comments/ URLs
was supposed to work, but we didn't have any tests covering this and
never noticed we didn't have proper has_delete_permissions functions for
these resources.

The has_delete_permissions functions for comment classe have moved from
the subclasses into the base classes. This will ensure that any subclass
that enables deletion will do the right thing.

While writing tests for this, I also found that our diff comment
querying behaved differently from screenshots and file attachments. They
were only accessible for public comments or when the requester owned
them. This was unnecessary, and we really wanted to return Forbidden in
this case. Diff comments have been updated in this case to match what
the other comments do.
Merge branch 'release-1.7.x'
Move more review request editing responsibilities to the model.

While moving things into ReviewRequestEditor*, much of the logic needed
to be in the view until we were more or less complete with the transfer.

Now, draft publishing, field setting and validation live in the model.
The view listens for events and calls into the model for more things.

The ReviewRequest model and associated draft are now instantiated with
the content from the database, meaning we can now work with the raw
content in the model instead of processing data in the DOM.

This last part had an impact on load order in reviews.js, so some things
had to be shifted around.
Add "destroying" and "destroyed" signals to BaseResourceModel.

"destroying" is triggered as soon as the destroy() call is called.

"destroyed" is triggered after a successful destroy.

Note that Backbone.js provides a "destroy" signal, but this doesn't
follow the naming conventions we're otherwise using.
Add a publish function to DraftReview.

This is used to publish a review. It will emit the "publishing" signal
when called and "published" when the publish finished.
Don't require the existence of review request field elements.

The purpose of this check was to make sure the review request fields
all had their proper elements on the page, which is useful for
debugging. However, file attachments and screenshots don't have the
fields, causing them to break. The easiest thing is to just remove the
check.
Add Depends On and Blocks fields to review requests.

This feature adds the ability to link requests together by means of two
fields; depends on, and blocks. These relationships are interconnected
in the sense that, if Request A depends on Request B, then inversely
Request B's blocks field will display a link back to Request A.

This adds the ability to add, edit, and remove dependencies from both
the backend admin panel as well as in the front-end.

Blocking relationships are built as a reverse of dependency, and thus
are automatically generated upon a dependency change.

Fixes bug #281
Reviewed at http://reviews.reviewboard.org/r/3881/
Merge branch 'release-1.7.x'
Fix the review request page when not logged in.

We weren't loading all the various JavaScript objects for the review
request page if not logged in. This was a relic of old logic. It's been
removed.
Filter unwanted upstream lines from interdiffs.

Interdiffs had a long-standing problem where, after merging, any
upstream changes from a subsequent diff would get rolled up into the
display of the diff. This was annoying particularly for very active
trees, and made it hard to see exactly what was changing.

We now filter these from the interdiffs. We start off by parsing both
diff files and find the line ranges (the "@@" lines). We can then use
that information to completely filter out changes that aren't in the
ranges.

To get as close as possible to what the user actually uploaded, we
strip away some additional lines from those ranges. By default, all diff
programs we've seen generate 3 lines of context to make the diff more
readable, meaning that the ranges are extended by 6 lines on either
side. We just reduce the ranges by 6, ensuring that only the modified
lines are considered for display.

Any lines that aren't to be displayed as inserts, deletes or replaces
get turned into "equal" lines. The user may notice that they're not in
fact equal (especially when it's deleted/inserted lines), but that
should be fine as the point is to get them to focus on the changes from
the diff itself, not the upstream changes.

It's still possible that some additional upstream lines will make it in,
but only when they're right inbetween some modified lines within the
same hunk of the diff.
Tighten up some of the interdiff file mapping logic.

We have a long-standing bug where, sometimes, an interdiff will have
problems when there's a file changed in one revision of a diff and then
reverted in another. While it's supposed to show that file as reverted,
this didn't always happen.

We determine that a file should be shown as reverted if we store the
force_interdiff flag for that file (which is based on there being an
interdiffset object). We seem to do that pretty reliably, yet it
sometimes screws up anyway.

The only thing I can think of is that we were comparing against None
incorrectly. Perhaps in some weird corner case, the comparison was
providing the incorrect result. Now, we use "is not" instead of "!=" for
this comparison.

I've also changed the logic to use generators where possible. Should
be more efficient (though barely).
Update our "Use post-review" to "Use RBTools."

This updates the text and link to point to RBTools, and rewords the text
a bit.
Add support for self-hosted hosting services.

Now, hosting services an be marked as "self-hosted," which will cause a
"Domain" field to show up for the service above the account entry. Many
of the functions now take a domain.

Accounts now take a domain as well, and we filter registered accounts by
the domain.

Bug trackers have the same sort of setup as well.

GitHub's had a few more changes added to it for cleanup to use the
hosting URL and to not duplicate so much code.

Unit tests were added for all of this.