Show More
@@ -316,6 +316,7 b' class HgRemote(object):' | |||
|
316 | 316 | |
|
317 | 317 | @reraise_safe_exceptions |
|
318 | 318 | def check_url(self, url, config): |
|
319 | log.info("Checking URL for remote cloning/import: %s", url) | |
|
319 | 320 | _proto = None |
|
320 | 321 | if '+' in url[:url.find('://')]: |
|
321 | 322 | _proto = url[0:url.find('+')] |
@@ -345,10 +346,12 b' class HgRemote(object):' | |||
|
345 | 346 | req = urllib2.Request(cu, None, {}) |
|
346 | 347 | |
|
347 | 348 | try: |
|
349 | log.debug("Trying to open URL %s", url) | |
|
348 | 350 | resp = o.open(req) |
|
349 | 351 | if resp.code != 200: |
|
350 | 352 | raise exceptions.URLError('Return Code is not 200') |
|
351 | 353 | except Exception as e: |
|
354 | log.warning("URL cannot be opened: %s", url, exc_info=True) | |
|
352 | 355 | # means it cannot be cloned |
|
353 | 356 | raise exceptions.URLError("[%s] org_exc: %s" % (cleaned_uri, e)) |
|
354 | 357 | |
@@ -358,12 +361,16 b' class HgRemote(object):' | |||
|
358 | 361 | pass |
|
359 | 362 | else: |
|
360 | 363 | # check for pure hg repos |
|
364 | log.debug( | |
|
365 | "Verifying if URL is a Mercurial repository: %s", url) | |
|
361 | 366 | httppeer(make_ui_from_config(config), url).lookup('tip') |
|
362 | 367 | except Exception as e: |
|
368 | log.warning("URL is not a valid Mercurial repository: %s", url) | |
|
363 | 369 | raise exceptions.URLError( |
|
364 | 370 | "url [%s] does not look like an hg repo org_exc: %s" |
|
365 | 371 | % (cleaned_uri, e)) |
|
366 | 372 | |
|
373 | log.info("URL is a valid Mercurial repository: %s", url) | |
|
367 | 374 | return True |
|
368 | 375 | |
|
369 | 376 | @reraise_safe_exceptions |
General Comments 0
You need to be logged in to leave comments.
Login now