Starting in Gerrit 3.3, comments can include a special file-id of
/PATCHSET_LEVEL and these comments have no code context, thus no
line numbers or related files. A previous change
I6505d08b62ba7ad8877561a82732889e142873c3 attempted to skip these
when enumerating comments in diff view, but mistakenly only did so
on the new side of the diff. Apply the same skip to the old side as
well.
Change-Id: I22575015bd9e513d00024f026d2248c7a19c3d9e
Starting in Gerrit 3.3, comments can include a special file-id of
/PATCHSET_LEVEL and these comments have no code context, thus no
line numbers or related files. Skip these when enumerating comments
in diff view because there is no relevant context for them.
Thanks to Paul Fertser for reporting and debugging this problem.
Change-Id: I6505d08b62ba7ad8877561a82732889e142873c3
This is necessary on systems where the username may not be present
(e.g., gerrit-review.googlesource.com).
Change-Id: Ia91b1e9b0fb0f98728dca46a488a92a97a301274
Add '<' and '>' keybindings which are used for diffing pairs of
patchsets. '<' moves to the previous pair, '>' to the next.
Change-Id: I46d24f6e62f113e16be2445a8e52384086c01c8e
- Add a config option to enable closing a change after a review
is saved, and going back to the change list.
- Enable reviewKeys from the change page to also work on the
diff view.
Change-Id: I37d907132a012d074d38345f15ef83ec7d9f3e6c
When entering multi-key commands, display potential completions
in the status bar as a reminder to the user.
Change-Id: I498781576a60789b0f810f08cbc9c8c74d52784f
Gertty uses WidgetWraps around the LineBox widget for popup widgets. Add
LineBoxTitlePropertyMixin which adds property and setter for title attribute,
accessing the underlying title_widget on the wrapped LineBox widget.
We use the popup method in the controller to display these dialogs. It uses an
Overlay widget to display our dialog widget on top of the current view. If the
widget to be displayed by the Overlay widget has title attribute, copy it to
the Overlay widget.
Change-Id: I4c6ecbc7ed87867cd67cd93c1125384dd5d4b9af
Due to a math error, comments at the start of the file when outside
of the diff context may have not been displayed. This corrects
the error.
Change-Id: Ic879d3c434faaa5d884547889a602a7157d1b2a8
Add a simple interactive search to the diff view. This is bound
to C-s by default. It highlights text, but does not yet navigate.
Change-Id: Ic795bb5d18911590237b6595f812e10fd4baa1ce
The getRepo method really doesn't have much to do with the application
object. Since it's really a utiltiy method for dealing with git repos
I've moved it to gertty.gitrepo.
Change-Id: Ic3349430c456ee184bbf57b6e5b7de4f940b4cc1
This case was not handled at all and caused a crash.
Also handle the case where a file present in the diff is not
present in the new commit while diffing between patchsets.
Change-Id: I24b54b6db7eae8d6c6c349ab6ed2bf846f104f86
Since each revision now has files, associate comments with the
file relation rather than revisions so that the path is not stored
twice in the database.
Also correct a problem where comments could be left on empty files
or lines that are not in a file in the unified view.
The SQLAlchemy constraints API seems to have changed between
0.9.9 and 1.0.4. Support both behaviors to be user-friendly even
though we now specify 1.0.4.
Change-Id: If6593d279a432ea8a48f4bd74a157e4978e69eaa
To remind the user of the path of the file shown at the top of the
diff, always display the filename there, even after the file header
has scrolled past the top of the screen.
Change-Id: Icf3419647c2ccec45f878fbdc882e3d624eadebb
This is implemented by a callout to the widget's existing handler for
key_up and key_down events, and letting the key_* event propagate into
an appropriate place where it's handled as the user's input. Reusing
that handler makes it possible to work in a generic manner, so the code
has no builtin knowledge of the type or layout of the class it's
operating on. The same code is used for project listing, change listing,
single change history view and a diff view as well.
Change-Id: I14600f9dbdf1c066cf5f497f9afcf4e213f03257
When going back a screen, always refresh the screen since something
may have changed while it was not displayed. Also, refactor the
refresh methods to indicate whether something is of interest so
that if there is more than one refresh triggering event queued, we
still only refresh the screen once (if it is interested).
This should correct the problem where if you review a change and
go back to the change or project listings, the displayed numbers
are incorrect.
Change-Id: I97875831c4bd47f5e38992c38302b47809c785d5
When sync events produce results that modify the local db state,
record those events and have the screen widgets use that info
to decide whether to refresh (if relevant data are updated).
In practice this should mean far fewer screen refreshes (which
require costly db queries and manifest as UI pauses).
Change-Id: Iefca75ef3d727236b8e4d1199fd4301d25822fef
DB migration to rename pending -> draft. Keep pending column on
messages to mean "ready to upload". Indicate whether messages are
drafts in change display. Update display of (draft) messages when
their contents change. Also store draft votes, but don't display
them until finalized (pending upload). Also remove 'drafts' flag
from revisions if that revision has a pending upload.
Change-Id: Iff427c0c1664351ce8e2d61be2f79f3bfa1f989d
Multiple keymaps may be added in either Gertty itself or in config
files, individual keys may be overriden in the standard map, and
the map can be selected via config file or command line option
just as palettes are.
Change the help text to be dynamically generated based on the
current keymap.
Change-Id: I5f8e63897fab3aa14493465256b5d4516cf47dcd
Refactor commonalities into base diff view, and implement unified
and side-by-side diff views. Configurable in the config yaml
file.
Change-Id: Ia8d9241d04f3e7f480618e7efe1d3792f530e173
If there is a comment on a file that would not otherwise be displayed
because there is no diff, create an all-context diff for that file
so the comment may be displayed.
Also, update the number of comment lines to be displayed in the
context expansion button ("Expand X lines of context").
Change-Id: I6db509b42032b282dbbfdbee0d639f97b8b70da3
Also add support for dropping sqlite columns in migrations.
Replace any references to user names with references to account table
entries.
Change-Id: I5a147370f5ee648ddd808f699e80a7778c21d662
Reviewkeys are a customizable shortcut for leaving predefined
votes on a change. For example, if you want to leave a +2
review with no comment, you might simply hit the "meta-2"
key. The following configuration block is recommended for
use with OpenStack's Gerrit:
reviewkeys:
- key: 'meta 0'
approvals: []
- key: 'meta 1'
approvals:
- category: 'Code-Review'
value: 1
- key: 'meta 2'
approvals:
- category: 'Code-Review'
value: 2
- key: 'meta 3'
approvals:
- category: 'Code-Review'
value: 2
- category: 'Workflow'
value: 1
Change-Id: I466024d71d5b1d89fcdc32355e2a9fe13abf5c28
Gerrit represents changes to commits with a file change of /COMMIT_MSG
and magically offset file comments :/. In this patch I reproduce that
logic sufficiently well to match up on all the commits I have looked
at.
Since diffs vs the base should not show the old commit's commit
message, I have hinted to the diff function when to include the commit
message in the output.
Change-Id: I8adb9fa22b384cace88f114f770a3eb5d3a89f5c
Make sure that the revision row is updated with the current comment
count when after leaving the diff view. Also, don't include draft
comments in the comment count (they are displayed separately).
When exiting the diff view with the esc key while inside of a comment
box, be sure to save that comment before leaving.
Change-Id: I16fe96dc37101d97317b19fdcc38be6729bed551
Rather than 'selected' or 'reversed' which includes an assumption
about exactly how the text will be displayed.
Change-Id: I91606492494b2f7f7d5028be9e2e8782bb55c5a5
Use methods that can be re-used to support manually expanding
context by the user.
Also fix a s/old/new/ typo bug.
Change-Id: I5b247204b959add9fbfd51af7e508d3d07b7c001
This gets up to 10,000 lines of diff context information, but does
not display it. Now we have the data and in a future change can
display more context if needed in order to show comments or if the
user requests it.
Change-Id: Id569732ffa40610f67bf479de8bf936580fbacf1
Create groups of diff chunks and context chunks. In a subsequent
change we can use that to better control the displayed context.
Change-Id: I75858d002e9a9fff809c91cfced81c6022d86196
Add a setup.cfg and setup.py and fill in those files
so that gertty can be installed easily.
Adjust gertty.py to have a main function that
can be referenced as a console entrypoint during
installation.
Also adjusted a bunch of imports that were failing after
installation occurred (but now they should not fail since they
correctly reference the gertty module namespace).
Change-Id: I532ced51583b26300ba9a2efb97f8e41bc69ec8d
Remove the contextlib pipe close feature -- file descriptors are
closed on program exit anyway. Letting that happen normally
actually makes exiting with CTRL-C nicer (fewer race conditions).
Map "CTRL-Q" to the quit command, but pop up a yes/no dialog.
Refactor the MessageDialog into a ButtonDialog base class that
can serve MessageDialog and YesNoDialog.
Add global help text that is prepended to each screen's help text
to deal with the growing number of global commands.
Change-Id: I455344cb20fb19032a3964d602fc886e19f256e5