Add a manager for the DiffCommit model
Review Request #9631 — Created Feb. 12, 2018 and submitted
The main logic of the
DiffSetManager
has been refactored into two
parts:
reviewboard.diffviewer.filediff_creator
, which handles the
actual processing of diff files intoFileDiff
s; andDiffManagerBase
, which provides a base implementation of
create_from_upload
for both theDiffSetManager
and 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 |
reviewbot | |
typo: reivewboard |
david | |
Missing a period. |
david | |
) should be on the line before. |
david | |
Docstring? |
david | |
There are so many args here, let's put one per line. |
david | |
Can we put one arg per line? |
david | |
) should be on the previous line and no trailing comma after revision=1 |
david | |
F841 local variable 'history' is assigned to but never used |
reviewbot | |
W391 blank line at end of file |
reviewbot | |
While here, can you make request default to None and be optional? It's used for an eventual call to get_file_exists(), … |
chipx86 | |
"will be empty" |
chipx86 | |
Can you pass these as keyword arguments? It'll be easier for maintenance. |
chipx86 | |
"filenames" |
chipx86 | |
"filename" |
chipx86 | |
"filename" |
chipx86 | |
"filenames" |
chipx86 | |
Can you fix the indentation while you're here? |
chipx86 | |
Missing a docstring. |
chipx86 | |
Missing a docstring. |
chipx86 | |
This read better the way it was before. |
chipx86 | |
It's not valid to put more text here between sections. |
chipx86 | |
Can you revert this? It doesn't simplify the code any, and makes it less future-proof. Better to have one task … |
chipx86 | |
Like above, can we make this optional? |
chipx86 | |
Is this necessary, given that this is a new manager for a new model? If it is, we should document … |
chipx86 | |
Can you pass a keyword argument here, so it's self-describing? |
chipx86 | |
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 … |
chipx86 | |
Can you use a keyword argument here? |
chipx86 | |
Keyword arguments would also be great here. |
chipx86 | |
This is the manager for DiffSet. I'm not sure DiffCommit is right here? |
chipx86 | |
F841 local variable 'filediffs' is assigned to but never used |
reviewbot | |
Other such functions say "Subclasses." Would be nice to be consistent. |
chipx86 | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
Swap these. |
chipx86 | |
Should be "BaseDiffManager", to match other base classes. |
chipx86 | |
Missing an entry for **kwargs. |
chipx86 | |
I think instead of copying all the keyword arguments from create_from_data, we just document **kwargs and say these are passed … |
chipx86 | |
No u prefix. Also missing docs for this argument. |
chipx86 | |
Missing docs for this argument. |
chipx86 | |
Missing a period. |
chipx86 | |
This says optional, but the argument doesn't have a default. |
chipx86 | |
This is in the wrong spot with regards to the argument list. |
chipx86 | |
Why don't we pass basedir anymore? |
chipx86 | |
Missing docs for **kwargs. |
chipx86 | |
"F" before "P". |
chipx86 | |
, optional |
chipx86 | |
Missing backtick and period. |
chipx86 | |
The ( should be on the next line. Kind of looks weird after another paren though. |
chipx86 | |
Blank line between these. |
chipx86 | |
F401 'reviewboard.diffviewer.features.dvcs_feature' imported but unused |
reviewbot |
- Commit:
-
ca421dfabef70a6ca3534379365ddb010e188ac156c8f10ea2d2c8461f2cc3dd358062094b2652f7
Checks run (2 succeeded)
- Commit:
-
0b5163d08571398f0e333492e06c5076e1c4bc0972796b3bb31275b5fcf450bfb2ae35e2c3b0a314
Checks run (2 succeeded)
- Commit:
-
72796b3bb31275b5fcf450bfb2ae35e2c3b0a31442dd02bbb4fb76a92d541e2484dea7a3629eb311
Checks run (2 succeeded)
-
-
While here, can you make
request
default toNone
and 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 thatDiffCommitManager
could 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
DiffSetManager
has been refactored into two~ classes: ~ parts: ~ DiffProcessor
, which handles the actual processing of diff files
intoFileDiff
s; and
~ reviewboard.diffviewer.filediff_creator
, which handles the
actual processing of diff files intoFileDiff
s; and
DiffManagerBase
, which provides a base implementation of
create_from_upload
for both theDiffSetManager
and the
DiffCommitManager
.
The new
DiffCommitManager
is able to createDiffCommit
objects fromeither uploaded files or from data, just as the DiffSetManager
can forDiffSet
objects.This patch also adds
DiffSetManager.crete_empty
to 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
DiffSetManager
has been refactored into twoparts: reviewboard.diffviewer.filediff_creator
, which handles the
actual processing of diff files intoFileDiff
s; and
DiffManagerBase
, which provides a base implementation of
create_from_upload
for both theDiffSetManager
and the
DiffCommitManager
.
The new
DiffCommitManager
is able to createDiffCommit
objects fromeither uploaded files or from data, just as the DiffSetManager
can forDiffSet
objects.~ This patch also adds
DiffSetManager.crete_empty
to create empty~ This patch also adds
DiffSetManager.create_empty
to 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)