[WIP] Add support for multi-commit review requests.
Review Request #6618 — Created Nov. 21, 2014 and discarded
Add the a
diffviewer.Commit
model. EachCommit
belongs to a
DiffSet
(which may have many commits) and may have manyFileDiff
s.
However, an old-fashioned review request (of squashed changes) will
not have anyCommit
s associated with it.Add a foreign key on the
FileDiff
model which links it to a
Commit
. EveryFileDiff
still corresponds to aDiffSet
, but they
now can optionally correspond to aCommit
.Add a
RelationCounterField
on theDiffSet
model to keep track of
the number ofCommits
corresponding to theDiffSet
. This way, the
DiffSet
can easily be checked if it is a multi-commit review request
or not.Add evolution (
new_commit_fields.py
) for new fields onFileDiff
andDiffSet
.TODO:
- Add an API endpoint so that multiple commits can be attached a review
request
Description | From | Last Updated |
---|---|---|
Col: 38 W292 no newline at end of file |
reviewbot | |
Two blank lines. |
chipx86 | |
We use whatever_count instead of num_whatevers for all other counter fields, so we should stick with that for this one. |
chipx86 | |
We usually swap this around to be named like COMMIT_TYPE_MERGE and COMMIT_TYPE_CHANGE. |
chipx86 | |
There are some crucial differences between how TEXT (TextField) and VARCHAR(x) (CharField(max_length=x)) columns are stored. If we ever want to … |
chipx86 | |
This should take a choices= argument that limits it to one of the commit types. It helps with validation and … |
chipx86 | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot |
- Change Summary:
-
Formatting.
- Commit:
-
f3a0c3cd25c2a0ab2ff8a3127237dab1ed49ce210d1b6b485a308a03ae25d6874f50522165407aa2
-
Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_fields.py reviewboard/diffviewer/evolutions/__init__.py Tool: Pyflakes Processed Files: reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_fields.py reviewboard/diffviewer/evolutions/__init__.py
-
-
-
We use
whatever_count
instead ofnum_whatevers
for all other counter fields, so we should stick with that for this one. -
-
There are some crucial differences between how
TEXT
(TextField
) andVARCHAR(x)
(CharField(max_length=x)
) columns are stored. If we ever want to do any queries on authors or committers (I can see us wanting to do that), then we're going to want to use aCharField
for performance.I think it's safe to say that an author or committer will always be a reasonable size (< 256 chars, probably < 128 chars). Given that, I think we can use a
CharField
here. -
This should take a
choices=
argument that limits it to one of the commit types. It helps with validation and display in the admin UI.
- Change Summary:
-
Depend on
r/6642
. Evolution cleanly applies. Fix Christian's issues. - Description:
-
Add the a
diffviewer.Commit
model. EachCommit
belongs to aDiffSet
(which may have many commits) and may have manyFileDiff
s.However, an old-fashioned review request (of squashed changes) will not have any Commit
s associated with it.Add a foreign key on the
FileDiff
model which links it to aCommit
. EveryFileDiff
still corresponds to aDiffSet
, but theynow can optionally correspond to a Commit
.Add a
RelationCounterField
on theDiffSet
model to keep track ofthe number of Commits
corresponding to theDiffSet
. This way, theDiffSet
can easily be checked if it is a multi-commit review requestor not. Add evolution (
new_commit_fields.py
) for new fields onFileDiff
and DiffSet
.- NB: The evolution does not currently cleanly apply because of a bug in
- django-evolution. - TODO:
- Add an API endpoint so that multiple commits can be attached a review request - Depends On:
-
- Commit:
0d1b6b485a308a03ae25d6874f50522165407aa2f8cfd3d0026c569ab262820b9b888fe5c1d5634e
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_fields.py reviewboard/diffviewer/evolutions/__init__.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_fields.py reviewboard/diffviewer/evolutions/__init__.py
- Change Summary:
-
Fix model
- Commit:
-
f8cfd3d0026c569ab262820b9b888fe5c1d5634ef961b3b22921e2baa84bd6cc30e6234dc8651556
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_fields.py reviewboard/diffviewer/evolutions/__init__.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_fields.py reviewboard/diffviewer/evolutions/__init__.py
- Change Summary:
-
Add commit_ordinal field to allow commits to be ordered within a DiffSet
- Commit:
-
f961b3b22921e2baa84bd6cc30e6234dc8651556785dc534b222aa080108ea49fdb3ba5baa847228
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_fields.py reviewboard/diffviewer/evolutions/__init__.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_fields.py reviewboard/diffviewer/evolutions/__init__.py
- Change Summary:
-
Work on commit endpoint
- Commit:
-
785dc534b222aa080108ea49fdb3ba5baa8472288dd0fb9b6771704d7ea82b01b4dfd512bae67c4b
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_fields.py reviewboard/webapi/resources/__init__.py reviewboard/diffviewer/evolutions/__init__.py reviewboard/webapi/resources/commit.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_fields.py reviewboard/webapi/resources/__init__.py reviewboard/diffviewer/evolutions/__init__.py reviewboard/webapi/resources/commit.py
-