Initial backend support for review requests with commit history.
Review Request #6779 — Created Jan. 15, 2015 and discarded — Latest diff uploaded
Add the
DiffCommitResource
andDraftDiffCommitResource
resources.
TheDiffCommitResource
is a resource for retrieving the information
about theCommits
under a particular DiffSet. The
DraftDiffCommitResource
inherits from theDiffCommitResource
and
modifies it to allow for the creation ofCommit
s and associated
FileDiff
s. TheDraftDiffCommitResource
handles the uploading of
FileDiff
s forCommit
s instead of theDiffSetResource
.Register the
Commit
model for bothDiffCommitResource
and
DraftDiffCommitResource
in the API. They are item child resources of
theDiffSetResource
andDraftDiffSetResource
resources,
respectively.The
DiffSetResource.create
method now takes an extra optional field,
create_empty
, that determines if theDiffSet
that is created is
created without uploading a.diff
file. This is used in the creation
of review requests with commit histories.The
FileDiffResource
andDraftFileDiffResource
classes now filter
their results based on thecommit
query parameter. If nocommit
query parameter is given, only thoseFileDiff
s unattached to a
Commit
will 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 newCommit
instances. It is very similar to
diffviewer.forms.UploadDiffForm
and may need to be refactored.Refactor behaviour for uploading
FileDiff
s from theDiffSetManager
to a new class, theDiffProcessorMixin
. This mix-in handles the
initial processing of.diff
files, their comparison (for header vs
source files), generating file lists, and creating actualFileDiff
s
from upload (it calls the child class's implementation of
create_from_data
).The
DiffSetManager
now has acreate_empty
method for creating
DiffSet
s withoutFileDiff
s for usage withCommit
s.Add the
CommitManager
model. It inherits from the
DiffProcessorMixin.
Update the
validate_diff
endpoint to use named parameters for
DiffSetManager.create_from_upload
because 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/).