Commit Graph

488 Commits

Author SHA1 Message Date
Zuul 5b577fd116 Merge "Fix urwid > 2.4.2 compatibility" 2024-02-27 15:31:59 +00:00
Aleksei Stepanov c9b58583d2 Fix urwid > 2.4.2 compatibility
1. `Columns` widget use FIXED pack method for items
   if they declare sizing as fixed.
2. `Columns` are implicitly declared as FIXED
   if all contents sizes are known or can be calculated without external size information.
3. `Text` is explicitly FIXED and FLOW widget
   (widget knows its size from contents).

Fix: explicit declare that widgets are FLOW-only
Change-Id: Ic0de5957ed47fadf2f0f02b235178eb03ecd1b04
2024-02-26 21:32:47 +01:00
Aleksei Stepanov 9846bcacf3 Drop prehistoric hack for urwid.GridFlow
1. Mentioned PR was merged > 8 years ago.
2. Issue with widget focusing on keypress is invalid:
   arrow keys should point on widgets as it positioned
   (if button at the next row - "right" button is ignored).

Change-Id: I6fecae34576196b63074a4b0db438aab3da3fd65
2024-02-26 11:04:21 +01:00
Matthew Thode 50b3b11ef9
make gertty work with sqlalchemy-2
Change-Id: I80c007af86cd7102c3c75963ad5b0a051dd9b541
Signed-off-by: Matthew Thode <mthode@mthode.org>
2023-04-11 23:46:51 -05:00
Jeremy Stanley 559bcfdb33 More skip patchset-level comments in diff view
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
2021-10-12 19:48:03 +00:00
Zuul cc97078eb8 Merge "Start cursor at Change-Id on entering ChangeView" 2021-10-09 14:46:05 +00:00
Jeremy Stanley cba4bb4098 Start cursor at Change-Id on entering ChangeView
In order to avoid having urwid warp the cursor to a non-selectable
widget when moving to a new ChangeView, set focus to the first item
we know will be selectable at the top of the screen, the Change-Id.

Change-Id: Ibd502eb18496eec37383370bb15a4f4cd8b3e5d7
2021-10-09 12:40:34 +00:00
James E. Blair 0f5079ded3 Make TextButtons have a cursor
All of our selectable widgets should have a cursor; if we use
SelectableIcon instead of a plain Text widget as the basis for
the TextButton, we will have one.

Change-Id: I490c7317a2d43727700066918b0b486d1a9cdc6b
2021-10-08 18:12:51 -07:00
Jeremy Stanley 3555a0d211 Make related change entries selectable
The default for _selectable in the Pile class was switched to False
with https://github.com/urwid/urwid/pull/367 commit 018509d, so
explicitly declare change entries are selectable in order to allow
them to be navigated by keyboard with urwid 2.1.0 and later.

Change-Id: I31f3d62475ec2e8a10e7a553426412ad6aa43f8f
2021-10-04 14:33:24 +00:00
Zuul 9ddbebd2cb Merge "Import alembic.migration" 2021-10-01 18:36:44 +00:00
James E. Blair e867dec44b Correctly locate cursor in hypertext widgets
The gertty-specific hypertext widget did not handle cursor positioning,
so selectable text did not behave like buttons.  This is an inconsistent
UI and causes problems for screen readers.

Change-Id: Iede3f663775fc169a757751acc1fe752dc00f544
2021-10-01 09:26:22 -07:00
Jeremy Stanley bff537e87c Import alembic.migration
This is needed for alembic >=1.7, though unfortunately goes entirely
unmentioned in its ChangeLog. Without adding the import, startup
raises this:

    AttributeError: module 'alembic' has no attribute 'migration'

Change-Id: Icf4c4a9240a8d1ea993d3aed62664531f8013a3e
2021-09-15 18:32:21 +00:00
Zuul 550df25397 Merge "Make commit and patchset comments nicer" 2021-08-24 16:47:39 +00:00
Zuul d084c102f9 Merge "Suggest a 'cherry-picked from' line when cherry picking" 2021-08-24 16:46:47 +00:00
James E. Blair 07827fcae7 Make commit and patchset comments nicer
Rather than display the /PATCHSET_LEVEL and /COMMIT_MSG fake
filenames, translate those to nice strings like the web ui does.

Change-Id: I225c8e2ea9763f9dadbefc4a23329efe0f97d899
2021-08-24 09:43:45 -07:00
Jeremy Stanley 699aa18766 Skip patchset-level comments in diff view
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
2021-08-24 09:43:43 -07:00
Dmitry Tantsur e96a663f1e Suggest a 'cherry-picked from' line when cherry picking
Emulates the behavior of "git cherry-pick -x" and the web UI.

Change-Id: I1c3654e39351cd0c6fc84a57b04560877bdf3b31
2021-07-06 13:05:29 +02:00
James E. Blair 363114eb7a Highlight WIP state in change view
To help reviewers notice WIP changes (which can't merge) highlight
that status.

Change-Id: If1a8cb0d6d8f3b29981ac58d6d5900898847e286
2021-03-26 07:44:48 -07:00
James E. Blair c134a8c6f1 Add support for searching for hashtags
Also for setting hashtags in change lists using the process mark.
Editing hashtags on individual change screens was already supported.
Selecting hashtags on a change screen will now perform a search for
that tag.

Change-Id: Icc23e10bbf22fbe9b1d958758ec6ceb3286e795b
2021-03-01 14:45:16 -08:00
James E. Blair 94310529ed Add WIP support
Change-Id: I3b690c3bffdb1ca534e42cef0c3c7d9b797f7e80
2020-12-18 11:02:33 -08:00
James E. Blair bb9d860dde Handle gerrit 3.x style internal urls
A new style of internal url appears in Gerrit 3.x:

  /c/PROJECT/+/NUMBER

This handles that in internal links and updates the terminal
integration docs with the new URL format as well.

Change-Id: I30bc6194b1b467b2e6500c5f11e5d06de1aea721
2020-12-18 09:46:04 -08:00
Zuul 119f96f293 Merge "tokenizer: do not try to decode strings on Python 3" 2020-12-18 16:52:18 +00:00
Alex Schultz 3027ce2735 Add version specific changes for git-url
With the upgrade of opendev's gerrit to 3.2.5.1, the git clones are
failing because the repository url no longer has p/ in it. This change
adds p/ in only if the version is less than 3 when we do a version check.

Change-Id: Id05cfa6449c6c36dd59c7efd74d57cebafcb78c6
2020-11-23 15:58:23 -07:00
Dmitry Tantsur ee9cd7a16c tokenizer: do not try to decode strings on Python 3
Change-Id: I37af7e9495fa3ddc0355f0184f93ed5c3ea87bd3
Story: #2007951
Task: #40427
2020-09-23 15:46:00 +02:00
James E. Blair f49f27db59 Fix error in message refresh
An extra argument was added recently; this was causing a crash.

Change-Id: I375b7709c28b0bbee265e097d09ea8eecab2ce36
2020-03-05 09:49:05 -08:00
James E. Blair e0515e7480 Fix "Save and Submit" button
This button was not working because we sync the change before sending
a review, which reset the pending state.  Determine whether we are
intending to submit the change before performing that sync, and
remember it after the sync is done.

Change-Id: I8c85c2a8fec50b50fb92037f6dcbcc7917c3baff
2020-02-24 14:31:42 -08:00
James E. Blair 055b11624b Add support for checks plugin
Change-Id: Iabaf1c928571ff0191e1201f395050f278f19a75
2020-02-20 15:40:30 -08:00
James E. Blair 5ff7d2061e Support robot comments
Change-Id: I8623bb2de9a9d7b6f162cd99ae0ea13a320c5a6b
2020-02-20 10:28:26 -08:00
James E. Blair b6ba991215 Display line comments from all patchsets in change view
The change view did not display comments from previous patchsets,
only comments associated with the patchset of the current message.
This displays them from all patchsets, annotating them with the
patchset number when it is different.

Note, the line comments were correctly displayed in the diff view.

Change-Id: Ieda0de0bb24800b9c3f577f339ca1338f2f1cc38
2020-02-20 09:48:52 -08:00
James E. Blair 2df6a24693 Hide errors when syncing conflicts
This is now an optional feature and does not appear in the upstream
gerrit.

Change-Id: Ib29ee107455794465986b04270737590696d5c76
2020-02-20 09:47:09 -08:00
James E. Blair 64b8d6dc6c Handle binary data in diffs
Even though we won't usually display it, binary data may show up
in a diff.  We can't decode it to display it, so just replace it
with a placeholder string so we don't crash.

Change-Id: I4794e707745ed8315afec00c1981e239ec98ef0e
2020-02-20 09:45:34 -08:00
Slawek Kaplonski a8487746e7 Update information about config file location
Default config location was changed recently. This commit
updates information about where this config should be placed in
message printed if there is no config file found at all.

Change-Id: I847005182d2a31a25b51886bd4997ce8a74075c0
2019-10-15 14:13:25 +00:00
James E. Blair 73a6481835 Use account_id to identify the user's own account
This is necessary on systems where the username may not be present
(e.g., gerrit-review.googlesource.com).

Change-Id: Ia91b1e9b0fb0f98728dca46a488a92a97a301274
2019-08-28 15:10:19 +02:00
James E. Blair 87d0f36c50 Add support for hashtags
Change-Id: Ib05f472be87b84a29157cfb158effb33c49ba458
2019-08-28 15:10:18 +02:00
James E. Blair 4d4bed3711 Fix a py3 error with exception formatting
The .message attribute of exceptions doesn't exist in py3.

Change-Id: I6ea60156d24649448be316244ddd81f9f3d2ebae
2019-08-28 15:10:14 +02:00
James E. Blair 9105cbb232 Correct file search implementation
The behavior for searching "file" more closely matches the documented
behavior for "path".  Implement "path" the same as "file", then update
"file" so that the non-regex form matches path components.

Change-Id: I03bf6d5232472069ea288b1ce0fe955469791af1
2019-07-29 16:11:31 -07:00
James E. Blair 6b794c03ee Only search files from the most recent revision
When searching for file: we previously would return changes with
any revisions with matching files.  Gerrit itself only considers
the latest revision, so match its behavior.

Also, correct a py3 issue with the message attribute not existing
on the SearchSyntaxError exception class.

Change-Id: I645e58b010cc3a2f74883e97f8be3634efbc2a20
2019-07-29 15:56:35 -07:00
James E. Blair 77f9fa5602 Add prev/next patchset keys to diff view
Add '<' and '>' keybindings which are used for diffing pairs of
patchsets.  '<' moves to the previous pair, '>' to the next.

Change-Id: I46d24f6e62f113e16be2445a8e52384086c01c8e
2019-06-18 09:48:05 -07:00
James E. Blair dfbe737cb9 Change some OpenStack to OpenDev or ttygroup
Change-Id: I1992146163b4a2ad9e70751c4ebd6b6a6663e441
2019-04-23 19:21:05 -07:00
Nate Johnston ea67716536 Change the default location for gertty config file
This change changes the default location for the gertty configuration
file that takes precedence if none is supplied on the command line to
~/.config/gertty/gertty.yaml.  If that file does not exist, the previous
location of ~/.gertty.yaml is consulted as a fallback.

Change-Id: I5ee6224219b0229c7b1ba17205c3f4cf8fb1d62b
Story: 2002119
Task: 19798
2019-04-23 19:18:46 -07:00
James E. Blair 0e770f0df6 Fix change view display of inline comments in python3
File comments were causing an exception when displayed on the
change view because python3 does not allow comparing None to int,
and file comments have a line number of None.

To correct this, use 0 as the line number for file comments whin
sorting and displaying them in the change view; there is no line
0 so this minor aliasing shouldn't cause any collisions.

Also, add a newline to the end of file comments, just as regular
inline comments (otherwise if a file comment was followed by a
line comment, they would appear on the same line).

Change-Id: Iedf88cdfd83adbc405e26cb013c9f57481d50c90
2019-03-28 08:03:42 -07:00
James E. Blair cd2538e04a Fix tab expansion in inter-patchset diff
There are some lines which were being read as byte arrays and
were not decoded into strings which was causing them to bypass
tab expansion (because they caused an exception which was caught
and the un-expanded text was used instead).  Correct those cases
and disable the exception handler so that we can identify any
other cases by triggering a crash.

Change-Id: I4b34132290fc8611cc770d572068197b33c0789c
2019-03-28 08:03:42 -07:00
Dominique Martinet c4b7fc6e37 gitrepo DiffFile: convert tab to » + spaces
tabs are displayed as question mark by urwid, so need replacing.
While we are replacing, might as well mark them like in the web UI.

Ideally I would want to use a slightly different color for them,
but that would require to add many new colors in the config (context,
full new line, part of new line) and would not be very compatible
with 8-colors terminals -- the '»' character is hopefully rarely used
enough to be useable as is.

Change-Id: Ic974774bf546765fa5b3e9266aee8ff973865502
2019-03-19 09:04:44 -07:00
Zuul 21a1cda390 Merge "Enable review keys in diffs, and close change on review" 2019-03-19 14:46:53 +00:00
Zuul 7e3f18bc04 Merge "Fix python3 encoding issues for remote commands" 2019-03-19 14:42:58 +00:00
Zuul 70f3bf113e Merge "Add ctrl-v/meta-v bindings for page-up/page-down" 2019-03-19 14:42:43 +00:00
James E. Blair 2f9eebc211 Fix python3 encoding issues for remote commands
Change-Id: Idb377eae4a2b52760cb810b590a75b5aea522968
2019-03-19 07:41:10 -07:00
Zuul 2e277a7897 Merge "Add inline comments to change overview" 2019-03-19 14:40:37 +00:00
Doug Wiegley 7892a19cb9
Enable review keys in diffs, and close change on review
- 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
2019-03-06 11:08:23 -07:00
Doug Wiegley 0ff7b5ef5b
Add ctrl-v/meta-v bindings for page-up/page-down
Many of the other keybindings seem to have emacs defaults, so add
page-up/page-down, for use on laptop keyboards without real page
keys.

Change-Id: I02bd8bebe9bfea89133d2eb28322bcf5fabaacf8
2019-02-18 12:24:50 -07:00