Display commits in the diffviewer based on the selected revision
Review Request #6933 — Created Feb. 11, 2015 and submitted
The
DiffViewerView
now provides information about the DiffCommits on
the selected revision. TheDiffViewerPageView
and associated models
have been updated to parse this information. The information on
DiffCommits is shown in the diffviewer now via theDiffCommitIndexView
,
which renders a table similar to theDiffCommitListField
on a review
request.When the diff revision slider is moved to select a diff revision, the
DiffCommitListField
will automatically update and populate the table
with information from the individual diff commits pertaining to the
selected revision. If the selected diff revision does not have any
commits, then the table will be hidden until a revision is selected that
does have associated commits.
Manually verified the following:
- Selecting the base and a diff revision that had commits displayed the
commit table. - Selecting the base and a diff revision that did not have commits did
not display the table. - Switching from one diff revision to another with different commits
changed the table to display the new commits.
Description | From | Last Updated |
---|---|---|
We can reduce the work needed with: diff_context['diff_commits'] = \ diffset.diff_commits.values('commit_id', 'summary', 'author_name') |
chipx86 | |
Can you sort these alphabetically, with comments? |
chipx86 | |
If you append this after building all the children, you'll reduce the work performed by the browser. |
chipx86 | |
No space after function. |
chipx86 | |
Can this be one line? |
chipx86 | |
You can use this.$el for this. |
chipx86 | |
Should be inserted alphabetically. |
chipx86 | |
Can we put the comments before the attributes, like in other models? That helps to prevent having to modify other … |
chipx86 | |
What if this is empty? |
david | |
These need to be localized. Given that, we should just use _.template for this. |
chipx86 | |
Can we use underscores in the ID to match the other diff ones? |
chipx86 | |
Did you test this? I don't think <%- %> can work this way (since it pulls values out of the … |
david | |
This line is useless because you set it again in update() |
david | |
These two lines can be combined. |
david | |
Now that you've moved the creation into here, you don't need the .empty() call. |
david |
Change Summary:
Update dependencies
Depends On: |
|
---|
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/views.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/diffviewer/view_diff.html reviewboard/static/rb/js/diffviewer/collections/diffCommitCollection.js reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js reviewboard/static/rb/js/pages/models/diffViewerPageModel.js reviewboard/static/rb/js/diffviewer/models/diffCommitModel.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/views.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/diffviewer/view_diff.html reviewboard/static/rb/js/diffviewer/collections/diffCommitCollection.js reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js reviewboard/static/rb/js/pages/models/diffViewerPageModel.js reviewboard/static/rb/js/diffviewer/models/diffCommitModel.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js
-
-
reviewboard/diffviewer/views.py (Diff revision 2) We can reduce the work needed with:
diff_context['diff_commits'] = \ diffset.diff_commits.values('commit_id', 'summary', 'author_name')
-
reviewboard/static/rb/js/diffviewer/models/diffCommitModel.js (Diff revision 2) Can you sort these alphabetically, with comments?
-
reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js (Diff revision 2) If you append this after building all the children, you'll reduce the work performed by the browser.
-
reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js (Diff revision 2) No space after
function
. -
reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js (Diff revision 2) Can this be one line?
-
reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js (Diff revision 2) You can use
this.$el
for this. -
reviewboard/static/rb/js/pages/models/diffViewerPageModel.js (Diff revision 2) Should be inserted alphabetically.
Change Summary:
Fix Christian's issues.
Diff: |
Revision 3 (+144)
|
---|
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/views.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/diffviewer/view_diff.html reviewboard/static/rb/js/diffviewer/collections/diffCommitCollection.js reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js reviewboard/static/rb/js/pages/models/diffViewerPageModel.js reviewboard/static/rb/js/diffviewer/models/diffCommitModel.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/views.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/diffviewer/view_diff.html reviewboard/static/rb/js/diffviewer/collections/diffCommitCollection.js reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js reviewboard/static/rb/js/pages/models/diffViewerPageModel.js reviewboard/static/rb/js/diffviewer/models/diffCommitModel.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js
Change Summary:
JSHint
Diff: |
Revision 4 (+144)
|
---|
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/views.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/diffviewer/view_diff.html reviewboard/static/rb/js/diffviewer/collections/diffCommitCollection.js reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js reviewboard/static/rb/js/pages/models/diffViewerPageModel.js reviewboard/static/rb/js/diffviewer/models/diffCommitModel.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/views.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/diffviewer/view_diff.html reviewboard/static/rb/js/diffviewer/collections/diffCommitCollection.js reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js reviewboard/static/rb/js/pages/models/diffViewerPageModel.js reviewboard/static/rb/js/diffviewer/models/diffCommitModel.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js
-
-
reviewboard/static/rb/js/diffviewer/models/diffCommitModel.js (Diff revision 4) What if this is empty?
-
-
reviewboard/static/rb/js/diffviewer/models/diffCommitModel.js (Diff revision 4) Can we put the comments before the attributes, like in other models? That helps to prevent having to modify other lines when we add things, in order to line things back up again.
-
reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js (Diff revision 4) These need to be localized.
Given that, we should just use
_.template
for this. -
reviewboard/templates/diffviewer/view_diff.html (Diff revision 4) Can we use underscores in the ID to match the other diff ones?
Diff: |
Revision 5 (+148)
|
---|
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/views.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/diffviewer/view_diff.html reviewboard/static/rb/js/diffviewer/collections/diffCommitCollection.js reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js reviewboard/static/rb/js/pages/models/diffViewerPageModel.js reviewboard/static/rb/js/diffviewer/models/diffCommitModel.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/views.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/diffviewer/view_diff.html reviewboard/static/rb/js/diffviewer/collections/diffCommitCollection.js reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js reviewboard/static/rb/js/pages/models/diffViewerPageModel.js reviewboard/static/rb/js/diffviewer/models/diffCommitModel.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js
-
-
reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js (Diff revision 5) Did you test this? I don't think
<%- %>
can work this way (since it pulls values out of the object passed in to the template). Usually we use names here and then call the template like this:_tableHeader({ summaryTitle: gettext('Summary'), authorTitle: gettext('Author') });
-
reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js (Diff revision 5) This line is useless because you set it again in
update()
Commit: |
|
||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 6 (+143)
|
-
Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/views.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/diffviewer/view_diff.html reviewboard/static/rb/js/diffviewer/collections/diffCommitCollection.js reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js reviewboard/static/rb/js/pages/models/diffViewerPageModel.js reviewboard/static/rb/js/diffviewer/models/diffCommitModel.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js Tool: Pyflakes Processed Files: reviewboard/diffviewer/views.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/diffviewer/view_diff.html reviewboard/static/rb/js/diffviewer/collections/diffCommitCollection.js reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js reviewboard/static/rb/js/pages/models/diffViewerPageModel.js reviewboard/static/rb/js/diffviewer/models/diffCommitModel.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js
-
-
reviewboard/static/rb/js/diffviewer/models/diffCommitModel.js (Diff revision 6) These two lines can be combined.
-
reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js (Diff revision 6) Just to double check, you want it to still take up room on the page? If not, this should use
.show()
/.hide()
Summary: |
|
||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 7 (+133)
|
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/views.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/diffviewer/view_diff.html reviewboard/static/rb/js/diffviewer/collections/diffCommitCollection.js reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js reviewboard/static/rb/js/pages/models/diffViewerPageModel.js reviewboard/static/rb/js/diffviewer/models/diffCommitModel.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/views.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/diffviewer/view_diff.html reviewboard/static/rb/js/diffviewer/collections/diffCommitCollection.js reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js reviewboard/static/rb/js/pages/models/diffViewerPageModel.js reviewboard/static/rb/js/diffviewer/models/diffCommitModel.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js
-
-
reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js (Diff revisions 6 - 7) Now that you've moved the creation into here, you don't need the
.empty()
call.
Diff: |
Revision 8 (+141)
|
---|
-
Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/views.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/diffviewer/view_diff.html reviewboard/static/rb/js/diffviewer/collections/diffCommitCollection.js reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js reviewboard/static/rb/js/pages/models/diffViewerPageModel.js reviewboard/static/rb/js/diffviewer/models/diffCommitModel.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js Tool: Pyflakes Processed Files: reviewboard/diffviewer/views.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/diffviewer/view_diff.html reviewboard/static/rb/js/diffviewer/collections/diffCommitCollection.js reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js reviewboard/static/rb/js/pages/models/diffViewerPageModel.js reviewboard/static/rb/js/diffviewer/models/diffCommitModel.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js
Diff: |
Revision 9 (+141)
|
---|
-
Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/views.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/diffviewer/view_diff.html reviewboard/static/rb/js/diffviewer/collections/diffCommitCollection.js reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js reviewboard/static/rb/js/pages/models/diffViewerPageModel.js reviewboard/static/rb/js/diffviewer/models/diffCommitModel.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js Tool: Pyflakes Processed Files: reviewboard/diffviewer/views.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/diffviewer/view_diff.html reviewboard/static/rb/js/diffviewer/collections/diffCommitCollection.js reviewboard/static/rb/js/diffviewer/views/diffCommitIndexView.js reviewboard/static/rb/js/pages/models/diffViewerPageModel.js reviewboard/static/rb/js/diffviewer/models/diffCommitModel.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js