Browse Source

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
changes/28/767928/1
James E. Blair 4 months ago
parent
commit
bb9d860dde
2 changed files with 10 additions and 2 deletions
  1. +1
    -1
      README.rst
  2. +9
    -1
      gertty/app.py

+ 1
- 1
README.rst View File

@ -203,7 +203,7 @@ in Gertty::
URxvt.keysym.C-Delete: perl:matcher:last
URxvt.keysym.M-Delete: perl:matcher:list
URxvt.matcher.button: 1
URxvt.matcher.pattern.1: https:\/\/review.example.org/(\\#\/c\/)?(\\d+)[\w]*
URxvt.matcher.pattern.1: https:\/\/review.example.org/(\\#/c/)?(c/[^\\+]+\\+/)?(\\d+)[\\w]*
URxvt.matcher.launcher.1: gertty --open $0
You will want to adjust the pattern to match the review site you are


+ 9
- 1
gertty/app.py View File

@ -637,7 +637,15 @@ class App(object):
change = patchset = filename = None
path = [x for x in result.path.split('/') if x]
if path:
change = path[0]
if path[0] == 'c':
while path:
path.pop(0)
if path[0] == '+':
path.pop(0)
change = path.pop(0)
break
else:
change = path[0]
else:
path = [x for x in result.fragment.split('/') if x]
if path[0] == 'c':


Loading…
Cancel
Save