Merge "Support the fragment form of Gerrit URLs"

This commit is contained in:
Zuul 2018-02-02 00:49:49 +00:00 committed by Gerrit Code Review
commit c39f388984
2 changed files with 8 additions and 2 deletions

View File

@ -54,8 +54,11 @@ class TestGerritCRD(ZuulTestCase):
A.setDependsOn(AM1, 1)
AM1.setDependsOn(AM2, 1)
# So that at least one test uses the /#/c/ form of the url,
# use it here.
url = 'https://%s/#/c/%s' % (B.gerrit.server, B.number)
A.data['commitMessage'] = '%s\n\nDepends-On: %s\n' % (
A.subject, B.data['url'])
A.subject, url)
self.fake_gerrit.addEvent(A.addApproval('Approved', 1))
self.waitUntilSettled()

View File

@ -54,7 +54,10 @@ class GerritSource(BaseSource):
parsed = urllib.parse.urlparse(url)
except ValueError:
return None
m = self.change_re.match(parsed.path)
path = parsed.path
if parsed.fragment:
path += '#' + parsed.fragment
m = self.change_re.match(path)
if not m:
return None
try: