Add the DiffCommit model.
Review Request #6766 — Created Jan. 13, 2015 and discarded
The
DiffSet
model has been updated to be able to contain several
DiffCommit
s in addition toFileDiff
s. TheDiffCommit
model
represents a single commit in distributed version control system
(DVCS). EachDiffCommit
has one or moreFileDiff
s that belong to
it (as well as theDiffSet
).Add an evolution to add a foreign key on the
FileDiff
model to point
to an optionalDiffCommit
model. Also add an evolution to add a
RelationCounterField
to theDiffSet
model that counts the number
of DiffCommits it currently has.Update the
reviewboard.diffviewer.admin
module to add the ability to
view individualDiffCommit
s. TheDiffCommit
s can be as inline
models of theDiffSet
model and haveFileDiff
as an inline model.
Ran unit tests.
Applied evolution successfully.
Description | From | Last Updated |
---|---|---|
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 1 W391 blank line at end of file |
reviewbot | |
Something I realized is that we now have two things called Commit. This one and the one in reviewboard.scmtools.core. Perhaps … |
chipx86 | |
Should localize the labels using ugettext_lazy. |
chipx86 | |
Let's use commit_type, since type is technically a reserved word. |
chipx86 | |
Is this intended to be the summary, or something else? |
chipx86 | |
I'm not sure the correct answer to this, but I'm wondering if this field is needed, given that it's only … |
chipx86 | |
Maybe commit_id to be consistent with other uses in the codebase. |
chipx86 | |
Maybe worth allowing these to be null/blank? If used in some patchset tool (for, say, CVS/Subversion changes), we may not … |
chipx86 | |
Let's define a constant for the length that we can reuse in all these. COMMIT_ID_LENGTH? |
chipx86 | |
Maybe to make this more useful for debugging/browsing in the admin UI, we can have this include the summary of … |
chipx86 | |
Just a small thing, but it'd be nice to extend this a bit to talk generally about the kinds of … |
chipx86 | |
If you use #: instead of #, we'll be able to include the comments in any auto-generated documentation (which I … |
chipx86 | |
Can this explain what we consider to be a valid commit? |
chipx86 | |
If you make this a @cached_property (a utility provided by Django), then the summary will only ever be calculated once … |
chipx86 | |
It's safe to split on a character that isn't in the string. In that case, you'll just get the entire … |
chipx86 | |
Missing #: |
chipx86 | |
""" on the next line. |
chipx86 | |
We have a mix in the codebase, but I think "Returns" instead of "Gets" does a better job of saying … |
chipx86 |
- Change Summary:
-
Fix PEP8 review.
- Commit:
-
b80b2a09718dbf71740df953d68bf7564a0cedb49408a6a7111537ee0fcaf9bef4555338f3f13cc0
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py
- Change Summary:
-
Update description.
- Description:
-
The
DiffSet
model has been updated to be able to contain severalCommit
s in addition toFileDiff
s. TheCommit
model represents asingle commit in distributed version control system (DVCS). Each Commit
has one or moreFileDiff
s that belong to it (as well as the~ DiffSet
)~ DiffSet
).Add an evolution to add a foreign key on the
FileDiff
model to pointto an optional Commit
model. Also add an evolution to add aRelationCounterField
to theDiffSet
model that counts the number ofcommits it currently has. Update the
reviewboard.diffviewer.admin
module to add the ability toview individual Commit
s. TheCommit
s can be as inline models of theDiffSet
model and haveFileDiff
as an inline model.
- Change Summary:
-
Remvoe
commit_ordinal
field. It is going to be removed in the next patch anyway so may aswell do it now. - Commit:
-
9408a6a7111537ee0fcaf9bef4555338f3f13cc06a1b776ef8f14dc1ec4b9de44b1414948aa7827d
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py
-
- Change Summary:
-
Remove trailing newline
- Commit:
-
6a1b776ef8f14dc1ec4b9de44b1414948aa7827d181943d4a7b4f100265cb6e4bc3addc183e5e199
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py
-
Looking good! I have a bunch of comments, but they're minor, or just design questions.
-
Something I realized is that we now have two things called
Commit
. This one and the one inreviewboard.scmtools.core
.Perhaps (in a separate change) we should rename the other one to
SCMCommit
. -
-
-
-
I'm not sure the correct answer to this, but I'm wondering if this field is needed, given that it's only really used for Subversion, and we have the info in the diffset. Since only RBTools or something custom would be able to post commits, we can probably get away with saying that all commits must have file paths relative to the DiffSet's basedir.
-
-
Maybe worth allowing these to be null/blank? If used in some patchset tool (for, say, CVS/Subversion changes), we may not have this information.
-
-
Maybe to make this more useful for debugging/browsing in the admin UI, we can have this include the summary of the commit message. (Could define a
summary
@property
that grabs the first line fromdescription
).
- Change Summary:
-
Address Christian's issues. Remove the
CommitModel
reference because it isn't in this patch. - Summary:
-
Add support for the Commit model.Add support for the DiffCommit model.
- Description:
-
The
DiffSet
model has been updated to be able to contain several~ Commit
s in addition toFileDiff
s. TheCommit
model represents a~ single commit in distributed version control system (DVCS). Each ~ Commit
has one or moreFileDiff
s that belong to it (as well as the~ DiffSet
).~ DiffCommit
s in addition toFileDiff
s. TheDiffCommit
model~ represents a single commit in distributed version control system ~ (DVCS). Each DiffCommit
has one or moreFileDiff
s that belong to~ it (as well as the DiffSet
).Add an evolution to add a foreign key on the
FileDiff
model to point~ to an optional Commit
model. Also add an evolution to add a~ RelationCounterField
to theDiffSet
model that counts the number of~ commits it currently has. ~ to an optional DiffCommit
model. Also add an evolution to add a~ RelationCounterField
to theDiffSet
model that counts the number~ of DiffCommits it currently has. Update the
reviewboard.diffviewer.admin
module to add the ability to~ view individual Commit
s. TheCommit
s can be as inline models of the~ DiffSet
model and haveFileDiff
as an inline model.~ view individual DiffCommit
s. TheDiffCommit
s can be as inline~ models of the DiffSet
model and haveFileDiff
as an inline model. - Testing Done:
-
~ Ran unit tests.
~ Ran unit tests.
+ Applied evolution successfully. - Commit:
-
181943d4a7b4f100265cb6e4bc3addc183e5e1997546eba27f3b45f5fec086d81e8fbb5a9031404c
-
Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py Tool: Pyflakes Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py
- Change Summary:
-
Add a
RegexValidator
for commit_id fields in theDiffCommit
model. - Commit:
-
7546eba27f3b45f5fec086d81e8fbb5a9031404c9974639adca7d3fbfe1da7619c361b57e0fe21f6
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py
- Change Summary:
-
Don't use compiled re objects. Add a constant for the regex itself.
- Commit:
-
9974639adca7d3fbfe1da7619c361b57e0fe21f65cb6682333d47857dcfc061b4cf7961b5bdb3c4e
-
Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py Tool: Pyflakes Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py
-
Looks great! I mostly just have some doc suggestions, but I think this is exactly what we want.
(I'll want Steven to have a look as well, since he's been thinking about a lot of this more actively than I.)
-
Just a small thing, but it'd be nice to extend this a bit to talk generally about the kinds of data that can be stored on here and how the commit information is used, just to flesh this out.
-
If you use
#:
instead of#
, we'll be able to include the comments in any auto-generated documentation (which I really want to start including at some point on the site). -
-
If you make this a
@cached_property
(a utility provided by Django), then the summary will only ever be calculated once perCommit
instance. -
It's safe to split on a character that isn't in the string. In that case, you'll just get the entire string.
So, this can be:
text = text.split('\n', 1)[0].strip()
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py
- Change Summary:
-
Don't use
^
or$
in the regex. - Summary:
-
Add support for the DiffCommit model.Add the DiffCommit model.
- Commit:
-
fa063362bd1cd248359b7c4b005cde3afc1f4480bc44bd468919bd5ac44a6062a47e03fe80632866
-
Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py Tool: Pyflakes Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py
- Change Summary:
-
Address Christian's issues.
- Commit:
-
bc44bd468919bd5ac44a6062a47e03fe806328660d528c2869824612b692240f3e0a99ba55b7a0f4
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py
- Change Summary:
-
Allow multiple parents.
- Commit:
-
0d528c2869824612b692240f3e0a99ba55b7a0f43aaf9ed8840d9e924ffdb622b469b0d89382be5e
-
Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py Tool: Pyflakes Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py
- Change Summary:
-
Forgot to remove
merge_parent_id
field. - Commit:
-
3aaf9ed8840d9e924ffdb622b469b0d89382be5e8f6c1fb5a27a1236ffb09d3e2f3b549738ba01ff
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/models.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/models.py
-
Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py Tool: Pyflakes Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py
- Change Summary:
-
Rip out datetime fields. When we go to repro the commit, we will stick the header into the extra_data because that stuff can change over time
- Commit:
-
8f6c1fb5a27a1236ffb09d3e2f3b549738ba01ffa78656edefd431fb24485c3874bfc3b639110c94
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/admin.py reviewboard/diffviewer/models.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/evolutions/__init__.py