Changeset - 6d8a2c55b7d0
[Not reviewed]
default
0 1 0
Mads Kiilerich - 11 years ago 2015-01-21 17:35:11
madski@unity3d.com
hg: fix clone from svn+http urls using hg-svn (Issue #72)
1 file changed with 10 insertions and 8 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/vcs/backends/hg/repository.py
Show inline comments
 
@@ -282,8 +282,9 @@ class MercurialRepository(BaseRepository
 
        if os.path.isdir(url) or url.startswith('file:'):
 
            return True
 

	
 
        url_prefix = None
 
        if '+' in url[:url.find('://')]:
 
            url = url[url.find('+') + 1:]
 
            url_prefix, url = url.split('+', 1)
 

	
 
        handlers = []
 
        url_obj = hg_url(url)
 
@@ -317,13 +318,14 @@ class MercurialRepository(BaseRepository
 
            # means it cannot be cloned
 
            raise urllib2.URLError("[%s] org_exc: %s" % (cleaned_uri, e))
 

	
 
        # now check if it's a proper hg repo
 
        try:
 
            httppeer(repoui or ui.ui(), url).lookup('tip')
 
        except Exception, e:
 
            raise urllib2.URLError(
 
                "url [%s] does not look like an hg repo org_exc: %s"
 
                % (cleaned_uri, e))
 
        if not url_prefix: # skip svn+http://... (and git+... too)
 
            # now check if it's a proper hg repo
 
            try:
 
                httppeer(repoui or ui.ui(), url).lookup('tip')
 
            except Exception, e:
 
                raise urllib2.URLError(
 
                    "url [%s] does not look like an hg repo org_exc: %s"
 
                    % (cleaned_uri, e))
 

	
 
        return True
 

	
0 comments (0 inline, 0 general)