Add the DiffCommit model.
Review Request #6766 — Created Jan. 13, 2015 and discarded
The
DiffSetmodel has been updated to be able to contain several
DiffCommits in addition toFileDiffs. TheDiffCommitmodel
represents a single commit in distributed version control system
(DVCS). EachDiffCommithas one or moreFileDiffs that belong to
it (as well as theDiffSet).Add an evolution to add a foreign key on the
FileDiffmodel to point
to an optionalDiffCommitmodel. Also add an evolution to add a
RelationCounterFieldto theDiffSetmodel that counts the number
of DiffCommits it currently has.Update the
reviewboard.diffviewer.adminmodule to add the ability to
view individualDiffCommits. TheDiffCommits can be as inline
models of theDiffSetmodel and haveFileDiffas an inline model.
Ran unit tests.
Applied evolution successfully.
| Description | From | Last Updated |
|---|---|---|
|
Col: 1 E302 expected 2 blank lines, found 1 |
|
|
|
Col: 1 W391 blank line at end of file |
|
|
|
Something I realized is that we now have two things called Commit. This one and the one in reviewboard.scmtools.core. Perhaps … |
|
|
|
Should localize the labels using ugettext_lazy. |
|
|
|
Let's use commit_type, since type is technically a reserved word. |
|
|
|
Is this intended to be the summary, or something else? |
|
|
|
I'm not sure the correct answer to this, but I'm wondering if this field is needed, given that it's only … |
|
|
|
Maybe commit_id to be consistent with other uses in the codebase. |
|
|
|
Maybe worth allowing these to be null/blank? If used in some patchset tool (for, say, CVS/Subversion changes), we may not … |
|
|
|
Let's define a constant for the length that we can reuse in all these. COMMIT_ID_LENGTH? |
|
|
|
Maybe to make this more useful for debugging/browsing in the admin UI, we can have this include the summary of … |
|
|
|
Just a small thing, but it'd be nice to extend this a bit to talk generally about the kinds of … |
|
|
|
If you use #: instead of #, we'll be able to include the comments in any auto-generated documentation (which I … |
|
|
|
Can this explain what we consider to be a valid commit? |
|
|
|
If you make this a @cached_property (a utility provided by Django), then the summary will only ever be calculated once … |
|
|
|
It's safe to split on a character that isn't in the string. In that case, you'll just get the entire … |
|
|
|
Missing #: |
|
|
|
""" on the next line. |
|
|
|
We have a mix in the codebase, but I think "Returns" instead of "Gets" does a better job of saying … |
|
- 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
DiffSetmodel has been updated to be able to contain severalCommits in addition toFileDiffs. TheCommitmodel represents asingle commit in distributed version control system (DVCS). Each Commithas one or moreFileDiffs that belong to it (as well as the~ DiffSet)~ DiffSet).Add an evolution to add a foreign key on the
FileDiffmodel to pointto an optional Commitmodel. Also add an evolution to add aRelationCounterFieldto theDiffSetmodel that counts the number ofcommits it currently has. Update the
reviewboard.diffviewer.adminmodule to add the ability toview individual Commits. TheCommits can be as inline models of theDiffSetmodel and haveFileDiffas an inline model.
- Change Summary:
-
Remvoe
commit_ordinalfield. 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@propertythat grabs the first line fromdescription).
- Change Summary:
-
Address Christian's issues. Remove the
CommitModelreference because it isn't in this patch. - Summary:
-
Add support for the Commit model.Add support for the DiffCommit model.
- Description:
-
The
DiffSetmodel has been updated to be able to contain several~ Commits in addition toFileDiffs. TheCommitmodel represents a~ single commit in distributed version control system (DVCS). Each ~ Commithas one or moreFileDiffs that belong to it (as well as the~ DiffSet).~ DiffCommits in addition toFileDiffs. TheDiffCommitmodel~ represents a single commit in distributed version control system ~ (DVCS). Each DiffCommithas one or moreFileDiffs that belong to~ it (as well as the DiffSet).Add an evolution to add a foreign key on the
FileDiffmodel to point~ to an optional Commitmodel. Also add an evolution to add a~ RelationCounterFieldto theDiffSetmodel that counts the number of~ commits it currently has. ~ to an optional DiffCommitmodel. Also add an evolution to add a~ RelationCounterFieldto theDiffSetmodel that counts the number~ of DiffCommits it currently has. Update the
reviewboard.diffviewer.adminmodule to add the ability to~ view individual Commits. TheCommits can be as inline models of the~ DiffSetmodel and haveFileDiffas an inline model.~ view individual DiffCommits. TheDiffCommits can be as inline~ models of the DiffSetmodel and haveFileDiffas 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
RegexValidatorfor commit_id fields in theDiffCommitmodel. - 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 perCommitinstance. -
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_idfield. - 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
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