Initial backend support for review requests with commit history.
Review Request #6779 — Created Jan. 15, 2015 and discarded — Latest diff uploaded
Add the
DiffCommitResourceandDraftDiffCommitResourceresources.
TheDiffCommitResourceis a resource for retrieving the information
about theCommitsunder a particular DiffSet. The
DraftDiffCommitResourceinherits from theDiffCommitResourceand
modifies it to allow for the creation ofCommits and associated
FileDiffs. TheDraftDiffCommitResourcehandles the uploading of
FileDiffs forCommits instead of theDiffSetResource.Register the
Commitmodel for bothDiffCommitResourceand
DraftDiffCommitResourcein the API. They are item child resources of
theDiffSetResourceandDraftDiffSetResourceresources,
respectively.The
DiffSetResource.createmethod now takes an extra optional field,
create_empty, that determines if theDiffSetthat is created is
created without uploading a.difffile. This is used in the creation
of review requests with commit histories.The
FileDiffResourceandDraftFileDiffResourceclasses now filter
their results based on thecommitquery parameter. If nocommit
query parameter is given, only thoseFileDiffs unattached to a
Commitwill be return. This filtering is only applied to the list
API, not the item API.Add a new form, the
UploadCommitForm, for handling the processing of
data for creating newCommitinstances. It is very similar to
diffviewer.forms.UploadDiffFormand may need to be refactored.Refactor behaviour for uploading
FileDiffs from theDiffSetManager
to a new class, theDiffProcessorMixin. This mix-in handles the
initial processing of.difffiles, their comparison (for header vs
source files), generating file lists, and creating actualFileDiffs
from upload (it calls the child class's implementation of
create_from_data).The
DiffSetManagernow has acreate_emptymethod for creating
DiffSets withoutFileDiffs for usage withCommits.Add the
CommitManagermodel. It inherits from the
DiffProcessorMixin.Update the
validate_diffendpoint to use named parameters for
DiffSetManager.create_from_uploadbecause of the refactoring.Add a WebAPI capability to show that the server supports review
requests with commit histories.TODO:
- Unit tests forthcoming.
- Manual testing information forthcoming.
Ran unit tests.
Able to create a review request with a single commit of history via
RBTools(see: https://reviews.reviewboard.org/r/6787/).