Add DIFF_PARSE_ERROR to the ValidateDiffResource.create error list.

This corrects the errors listed in the docs.
Don't expose child resources in ValidateDiffResource.

For convenience, ValidateDiffResource inherited from DiffResource.
This brought along the child resources, which weren't valid to have.
That ended up breaking docs, which tried to traverse them.
Fixed the bug number for the blacktriangledown bug.
Merge branch 'release-1.7.x'
Fix optional file fields with RB.BaseResource.

In change 624e56e I gave BaseResource the ability to upload multiple files as
part of an API request. This worked, but wasn't able to cope with file fields
that are optional. In the case where one or more of the fields pointed to by
payloadFileKeys was undefined, it would raise a TypeError.

Testing done: Used this in conjunction with my pre-commit WIP, which can
sometimes upload only one file to a resource that takes two.
Add a branch to the svn testdata.

I'm going to be adding some plumbing to have reviewboard query for branches and
commits in repos, which means I need some test data to write tests against. Our
svn repo that we bundle only had a trunk with no branches. This change adds a
branch with a couple commits.

Testing done: ran unit tests
Fix a typo in a comment.

s/cna/can/
Fix starring review requests in a local site.

The data-object-id attribute of the star in the dashboard column and review
request box was using the pk, instead of the display_id. This broke the starring
functionality, since the API uses the local_id when there's a local site.

Reviewed at http://reviews.reviewboard.org/r/4273/
Fix an issue with validating against repos that don't use basedir.

The UploadDiffForm had a buried case where it set the basedir to the empty
string in cases where the repository uses absolute paths, and it turns out that
this is necessary because we pass the value to os.path.join(), which really
doesn't like getting None for its first argument. I had missed this when
implementing ValidateDiffResource, which meant it worked for svn but didn't for
git.

Testing done: validated some diffs against a git repository.
Reviewed at http://reviews.reviewboard.org/r/4268/
Merge branch 'release-1.7.x'
Ensure the local_id update is committed to the server.

When we create a ReviewRequest on a server using a LocalSite, we set a
local_id based on previous IDs. This has worked in the past, but
something subtle broke it. We need to ensure this change is committed to
the server before any further use. We now commit the transaction and
then continue. This will prevent ReviewRequests that have a LocalSite
without a Local ID set from showing up in the database.
Merge branch 'release-1.7.x'
Add repositories/<id>/branches/ and repositories/<id>/commits resources.

This change adds APIs for getting a list of all branches on a repository, and a
(paginated) list of commits backwards in time from a given starting point. These
are currently implemented for the SVN SCMTool and the GitHub hosting service.

Testing done:
- Ran unit tests.
- Used these in conjunction with my post-commit implementation.

Reviewed at http://reviews.reviewboard.org/r/4265/
Add javascript models for Repository, Branch, and Commit.

This change adds models and collections for repositories, branches, and commits,
along with basic tests for the fetching and parsing logic. This implements the
client side of the new commits and branches resources.

Testing done:
Ran unit tests. Used these models in my larger post-commit changes.

Reviewed at http://reviews.reviewboard.org/r/4266/
Add a generic CollectionView for handling live-updating collections.

This adds a utility view for rendering collections of things. To use this, one
extends this view with a new one that defines the itemViewType attribute. Items
can be added to the collection before or after the view is rendered, and the
results in the DOM will always match the current state of the collection.

Testing done: Ran js-tests, used this in my post-commit view.
Reviewed at http://reviews.reviewboard.org/r/4269/
Fix broken/missing docs and behavior for the new validation API.

The new validation API was missing documentation. While adding it, I
noticed a few problems with how the API was being represented.

The resource name "diffs" collided with the other "diffs" resource, and
overwrote the URI template in the root resource. Resource names should
be unique, and more specific, so I renamed this to "diff_validation." I
also got rid of the mimetype, letting it build upon the new name (and
fixing some oddity with the resource not properly encoding in XML, for
some reason).

I also noticed any client following the link from /validation/ to
/validation/diffs/ would get an error, since there's no GET handler. A
proper REST resource should provide some representation. So, we provide
a payload containing the typical links for getting/posting to the
resource.

I also fixed up some documentation issues, some doc generation
issues with singletons, and added the pages for the validation resource.

Note that this does change the payload key for the diff validation
response.
Move diff expand/collapse support into the new DiffReviewableView.

The resulting code is actually cleaner than the old code, because we
have more context to work from, instead of having to embed a bunch of
stuff inside the links.

There's now unit tests that ensure our expand/collapse logic works
correctly.

It also fixes a regression in collapsing that was introduced in the
original DiffReviewable model that was pulled out early on in the
JavaScript refactoring.

This is the last work needed before we can move the DiffComment
support over.
Provide ReviewRequests and Reviews to reviewables and comment blocks.

Reviewables and CommentBlocks now take 'reviewRequest' and 'review'
attributes, instead of having to call out to gReviewRequest.

The 'reviewRequest' attribute is required, but 'review' is not. If not
provided, AbstractReviewable will get/create a draft Review object from
the ReviewRequest. These two parameters are now required.

Reviewables also now have a convenience function for creating
CommentBlock and adding them. This will do the work of passing along the
ReviewRequest and Review to the CommentBlock instance.

Existing Reviewables and CommentBlocks have been updated to work with
these changes. External ones will need to be changed.
Add a $.fn.bindClass function for mapping an attribute to a class.

bindClass is used when you want to toggle whether a class is on an
element based on the value of a boolean attribute. It adds or removes
the class initially based on the attribute at the time of binding, and
responds to all updates to the property.

Like the other binding functions, it also supports an 'inverse' option
for flipping when the class will be present.
Update DiffCommentBlock to be an AbstractCommentBlock in DiffReviewable.

DiffCommentBlock is now based on the AbstractCommentBlock{View}, which
allows us to eliminate the majority of the code and take advantage of
all the niceties that the Reviewable infrastructure gives us.

Some of the AbstractCommentBlockView code had to be made more flexible
with regard to positioning of tooltips and update bubbles, but otherwise
it's basically unmodified.

This also ends up fixing a long-standing bug where a comment in an
expanded region would not show up again if the chunk is collapsed and
then re-expanded.

Most of the code from diffviewer.js is now gone with this change.