mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Handle review URLs pointing directly at Gerrit
If a review URL is set to 'http://host/Gerrit' because the user thinks that is the correct way to point repo at Gerrit, we should be a bit more flexible and fix the URL by dropping the '/Gerrit' suffix and replace it with '/ssh_info'. Likewise, if a review URL points already at '/ssh_info' for a Gerrit instance, we should leave it alone. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
parent
feabbdb440
commit
13cc3844d7
@ -273,9 +273,12 @@ class Remote(object):
|
|||||||
u = self.review
|
u = self.review
|
||||||
if not u.startswith('http:') and not u.startswith('https:'):
|
if not u.startswith('http:') and not u.startswith('https:'):
|
||||||
u = 'http://%s' % u
|
u = 'http://%s' % u
|
||||||
if not u.endswith('/'):
|
if u.endswith('/Gerrit'):
|
||||||
u += '/'
|
u = u[:len(u) - len('/Gerrit')]
|
||||||
u += 'ssh_info'
|
if not u.endswith('/ssh_info'):
|
||||||
|
if not u.endswith('/'):
|
||||||
|
u += '/'
|
||||||
|
u += 'ssh_info'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
info = urlopen(u).read()
|
info = urlopen(u).read()
|
||||||
|
Loading…
Reference in New Issue
Block a user