Add a manager for the DiffCommit model
Review Request #9631 — Created Feb. 12, 2018 and submitted
The main logic of the
DiffSetManagerhas been refactored into two
parts:
reviewboard.diffviewer.filediff_creator, which handles the
actual processing of diff files intoFileDiffs; andDiffManagerBase, which provides a base implementation of
create_from_uploadfor both theDiffSetManagerand the
DiffCommitManager.
The new DiffCommitManager is able to create DiffCommit objects from
either uploaded files or from data, just as the DiffSetManager can for
DiffSet objects.
This patch also adds DiffSetManager.create_empty to create empty
DiffSets which will contain DiffCommits.
Ran unit tests.
| Description | From | Last Updated |
|---|---|---|
|
F401 'nose' imported but unused |
|
|
|
typo: reivewboard |
|
|
|
Missing a period. |
|
|
|
) should be on the line before. |
|
|
|
Docstring? |
|
|
|
There are so many args here, let's put one per line. |
|
|
|
Can we put one arg per line? |
|
|
|
) should be on the previous line and no trailing comma after revision=1 |
|
|
|
F841 local variable 'history' is assigned to but never used |
|
|
|
W391 blank line at end of file |
|
|
|
While here, can you make request default to None and be optional? It's used for an eventual call to get_file_exists(), … |
|
|
|
"will be empty" |
|
|
|
Can you pass these as keyword arguments? It'll be easier for maintenance. |
|
|
|
"filenames" |
|
|
|
"filename" |
|
|
|
"filename" |
|
|
|
"filenames" |
|
|
|
Can you fix the indentation while you're here? |
|
|
|
Missing a docstring. |
|
|
|
Missing a docstring. |
|
|
|
This read better the way it was before. |
|
|
|
It's not valid to put more text here between sections. |
|
|
|
Can you revert this? It doesn't simplify the code any, and makes it less future-proof. Better to have one task … |
|
|
|
Like above, can we make this optional? |
|
|
|
Is this necessary, given that this is a new manager for a new model? If it is, we should document … |
|
|
|
Can you pass a keyword argument here, so it's self-describing? |
|
|
|
It seems that DiffSetManager.create_from_data() and DiffCommitManager.create_from_data() do primarily the same thing, with the exception that the latter creates and passes … |
|
|
|
Can you use a keyword argument here? |
|
|
|
Keyword arguments would also be great here. |
|
|
|
This is the manager for DiffSet. I'm not sure DiffCommit is right here? |
|
|
|
F841 local variable 'filediffs' is assigned to but never used |
|
|
|
Other such functions say "Subclasses." Would be nice to be consistent. |
|
|
|
E126 continuation line over-indented for hanging indent |
|
|
|
Swap these. |
|
|
|
Should be "BaseDiffManager", to match other base classes. |
|
|
|
Missing an entry for **kwargs. |
|
|
|
I think instead of copying all the keyword arguments from create_from_data, we just document **kwargs and say these are passed … |
|
|
|
No u prefix. Also missing docs for this argument. |
|
|
|
Missing docs for this argument. |
|
|
|
Missing a period. |
|
|
|
This says optional, but the argument doesn't have a default. |
|
|
|
This is in the wrong spot with regards to the argument list. |
|
|
|
Why don't we pass basedir anymore? |
|
|
|
Missing docs for **kwargs. |
|
|
|
"F" before "P". |
|
|
|
, optional |
|
|
|
Missing backtick and period. |
|
|
|
The ( should be on the next line. Kind of looks weird after another paren though. |
|
|
|
Blank line between these. |
|
|
|
F401 'reviewboard.diffviewer.features.dvcs_feature' imported but unused |
|
- Commit:
-
ca421dfabef70a6ca3534379365ddb010e188ac156c8f10ea2d2c8461f2cc3dd358062094b2652f7
Checks run (2 succeeded)
- Commit:
-
0b5163d08571398f0e333492e06c5076e1c4bc0972796b3bb31275b5fcf450bfb2ae35e2c3b0a314
Checks run (2 succeeded)
- Commit:
-
72796b3bb31275b5fcf450bfb2ae35e2c3b0a31442dd02bbb4fb76a92d541e2484dea7a3629eb311
Checks run (2 succeeded)
-
-
While here, can you make
requestdefault toNoneand be optional? It's used for an eventual call toget_file_exists(), which doesn't require it. That will make it easier for testing work (I've hit this before while going through some complex diff testing for interdiffs). -
-
-
-
-
-
-
-
-
-
-
-
Can you revert this? It doesn't simplify the code any, and makes it less future-proof. Better to have one task per line here.
-
-
Is this necessary, given that this is a new manager for a new model?
If it is, we should document why in a comment here, and this should specify the right function and class name.
-
-
It seems that
DiffSetManager.create_from_data()andDiffCommitManager.create_from_data()do primarily the same thing, with the exception that the latter creates and passes aDiffCommit. It'd be nice to consolidate as much of this functionality as possible. I imagine the base class could have its own implementation thatDiffCommitManagercould override, calling the parent with adiff_commit=argument. -
-
-
- Change Summary:
-
Addressed Christian's issues.
- Commit:
-
42dd02bbb4fb76a92d541e2484dea7a3629eb311fe865810a504254c78b57518da41cc185a53d915
- Change Summary:
-
Lint.
- Commit:
-
fe865810a504254c78b57518da41cc185a53d9153892e701afac0aa452130fdd5f1fdb66af7179aa
Checks run (2 succeeded)
- Change Summary:
-
Fixed unit test failure.
- Commit:
-
3892e701afac0aa452130fdd5f1fdb66af7179aa4a608722445de17d05cfb24f185f66f1024db181
Checks run (2 succeeded)
- Change Summary:
-
Refactor + address issues.
- Description:
-
The main logic of the
DiffSetManagerhas been refactored into two~ classes: ~ parts: ~ DiffProcessor, which handles the actual processing of diff files
intoFileDiffs; and
~ reviewboard.diffviewer.filediff_creator, which handles the
actual processing of diff files intoFileDiffs; and
DiffManagerBase, which provides a base implementation of
create_from_uploadfor both theDiffSetManagerand the
DiffCommitManager.
The new
DiffCommitManageris able to createDiffCommitobjects fromeither uploaded files or from data, just as the DiffSetManagercan forDiffSetobjects.This patch also adds
DiffSetManager.crete_emptyto create emptyDiffSets which will contain DiffCommits. - Commit:
-
4a608722445de17d05cfb24f185f66f1024db181d4105b27bae9a276d23113124d95f09bae9a238a
Checks run (2 timed out)
- Change Summary:
-
Rebase
- Commit:
-
d4105b27bae9a276d23113124d95f09bae9a238a0a91cb4e9b0c3ccf0478e4396aa0e72be96464ac
- Change Summary:
-
Fixups
- Description:
-
The main logic of the
DiffSetManagerhas been refactored into twoparts: reviewboard.diffviewer.filediff_creator, which handles the
actual processing of diff files intoFileDiffs; and
DiffManagerBase, which provides a base implementation of
create_from_uploadfor both theDiffSetManagerand the
DiffCommitManager.
The new
DiffCommitManageris able to createDiffCommitobjects fromeither uploaded files or from data, just as the DiffSetManagercan forDiffSetobjects.~ This patch also adds
DiffSetManager.crete_emptyto create empty~ This patch also adds
DiffSetManager.create_emptyto create emptyDiffSets which will contain DiffCommits. - Commit:
-
0a91cb4e9b0c3ccf0478e4396aa0e72be96464ac482efd1a628218f93fd31e8ef0944517fa8a3ef8
Checks run (2 succeeded)
- Change Summary:
-
Do not pass basedir and base_commit_id to DiffCommitManager.create_from_data. fixes unit test failures in next patch
- Commit:
-
482efd1a628218f93fd31e8ef0944517fa8a3ef8d356972c7478fffdee78d209a1d7d84460e578b7
Checks run (2 succeeded)
- Change Summary:
-
Addressed Christian's feedback.
- Commit:
-
d356972c7478fffdee78d209a1d7d84460e578b7cd5fe6e71269fd9fb4d55db20b56623e9675f99c
Checks run (2 succeeded)
- Change Summary:
-
Do not pass diffset_history to DiffCommitManager
- Commit:
-
cd5fe6e71269fd9fb4d55db20b56623e9675f99c4c79653909cc7459358efb3bb9314f5f615e59bf
Checks run (2 succeeded)
- Change Summary:
-
diff_commit_count->diffcommit_count - Commit:
-
4c79653909cc7459358efb3bb9314f5f615e59bf5bb04731dfb5644076b92b08b74c9c808896c3b8
Checks run (2 succeeded)
- Commit:
-
5bb04731dfb5644076b92b08b74c9c808896c3b8498b84b80e76ced5620abf3ac5621f5d3eb66364
- Diff:
-
Revision 16 (+790 -230)
Checks run (2 succeeded)
- Change Summary:
-
Addressed Christian's feedback
- Commit:
-
498b84b80e76ced5620abf3ac5621f5d3eb663640d4bf895516e1e6861d346f979299436f6d498a7
Checks run (2 succeeded)
- Change Summary:
-
Fix
create_filediffs()to save file counts. - Commit:
-
0d4bf895516e1e6861d346f979299436f6d498a72e9a2fda87df8e434419b0fd9dd4b197d0f1a0e1
- Diff:
-
Revision 18 (+897 -232)
- Change Summary:
-
dev/release-4.0.x/dvcs/manager
- Commit:
-
2e9a2fda87df8e434419b0fd9dd4b197d0f1a0e1bc4b0ce7d27392e427cde2aeed65a1374146ab9e
- Diff:
-
Revision 19 (+896 -232)