From 4d268e5679694d314e5b6aaa3f00ef4ad1aef60f Mon Sep 17 00:00:00 2001 From: Wouter van Kesteren Date: Sun, 5 Jul 2015 15:03:36 +0200 Subject: [PATCH] Match links by url instead of domain. Exherbo has a setup where gerrit is at https://galileo.mailstation.de/gerrit/ and jenkins is at https://galileo.mailstation.de/jenkins/. gertty falsely thinks that the jenkins link is a change and when clicked it weirdly starts to sync random projects for 10 minutes before telling me that the change is not found. This patch fixes it by matching on the full url. Change-Id: I4261fce74d6cfaec736e478747592b001d82400d --- gertty/app.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gertty/app.py b/gertty/app.py index 3da1c2b..800e444 100644 --- a/gertty/app.py +++ b/gertty/app.py @@ -177,7 +177,6 @@ class BackgroundBrowser(webbrowser.GenericBrowser): class App(object): simple_change_search = re.compile('^(\d+|I[a-fA-F0-9]{40})$') - url_change_search = re.compile('^https?://.*$') def __init__(self, server=None, palette='default', keymap='default', debug=False, verbose=False, disable_sync=False, @@ -457,11 +456,9 @@ class App(object): trailing_filename_re = re.compile('.*(,[a-z]+)') def parseInternalURL(self, url): - if not self.url_change_search.match(url): + if not url.startswith(self.config.url): return None result = urlparse.urlparse(url) - if result.netloc != self.config.hostname: - return None change = patchset = filename = None path = [x for x in result.path.split('/') if x] if path: