Show More
@@ -150,17 +150,18 b' def httpcheck(ui, path, proto):' | |||||
150 | try: |
|
150 | try: | |
151 | opener = urllib2.build_opener() |
|
151 | opener = urllib2.build_opener() | |
152 | rsp = opener.open('%s://%s/!svn/ver/0/.svn' % (proto, path)) |
|
152 | rsp = opener.open('%s://%s/!svn/ver/0/.svn' % (proto, path)) | |
153 | return '<m:human-readable errcode="160013">' in rsp.read() |
|
153 | data = rsp.read() | |
154 | except urllib2.HTTPError, inst: |
|
154 | except urllib2.HTTPError, inst: | |
155 |
if inst.code |
|
155 | if inst.code != 404: | |
156 | return False |
|
156 | # Except for 404 we cannot know for sure this is not an svn repo | |
157 | # Except for 404 we cannot know for sure this is not an svn repo |
|
157 | ui.warn(_('svn: cannot probe remote repository, assume it could be ' | |
158 | ui.warn(_('svn: cannot probe remote repository, assume it could be ' |
|
158 | 'a subversion repository. Use --source if you know better.\n')) | |
159 | 'a subversion repository. Use --source if you know better.\n')) |
|
159 | return True | |
160 | return True |
|
160 | data = inst.fp.read() | |
161 | except: |
|
161 | except: | |
162 | # Could be urllib2.URLError if the URL is invalid or anything else. |
|
162 | # Could be urllib2.URLError if the URL is invalid or anything else. | |
163 | return False |
|
163 | return False | |
|
164 | return '<m:human-readable errcode="160013">' in data | |||
164 |
|
165 | |||
165 | protomap = {'http': httpcheck, |
|
166 | protomap = {'http': httpcheck, | |
166 | 'https': httpcheck, |
|
167 | 'https': httpcheck, |
General Comments 0
You need to be logged in to leave comments.
Login now