Checkout the SVN repo.

    Args:
        url (str): The SVN SOURCE repo.
        fname (str): The name of the repo on disk.
        to (str): The name of the TARGET folder on disk.
            Defaults to ``CFG["tmpdir"]``
497438
def Svn(url, fname, to=None):
    
    if to is None:
        to = str(CFG["tmp_dir"])

    src_dir = local.path(to) / fname
    if not source_required(src_dir):
        Copy(src_dir, ".")
        return

    from benchbuild.utils.cmd import svn
    svn("co", url, src_dir)
    update_hash(src_dir)
    Copy(src_dir, ".")
79451
def filename_from_url(url):
    """"""
    fname = os.path.basename(urlparse.urlparse(url).path)
    if len(fname.strip(" \n\t.")) == 0:
        return None
    return fname
1313589
def pull(self, url):
        
        url = self._get_url(url)
        cmd = ['pull']
        cmd.append("--ff-only")
        cmd.append(url)
        cmd = ' '.join(cmd)
        # If error occurs run_git_command raises RepositoryError already
        self.run_git_command(cmd)
804880
def get_commit_url(repo_url):
    """"""
    if "github.com" in repo_url:
        return repo_url[:-4] if repo_url.endswith(".git") else repo_url
    if "git.openstack.org" in repo_url:
        uri = '/'.join(repo_url.split('/')[-2:])
        return "https://github.com/{0}".format(uri)

    # If it didn't match these conditions, just return it.
    return repo_url
670960
function parseUrl (url) {
  var urlRegExp = /(git:\/\/)|(http:\/\/)/;

  if(urlRegExp.test(url)) {
    return url.replace(urlRegExp, 'https://');
  }

  return url;
}
1192956
function toRepoUrl(url) {
  if (url.startsWith('git@')) {
    if (argv.useSSH) {
      return url;
    }
    // have an ssh url need an http url
    const m = url.match(/(https?:\/\/([^/]+)\/|git@(.+):)([\w\d-_/]+)(.git)?/);
    return `https://${m[3]}/${m[4]}.git`;
  }
  if (url.startsWith('http')) {
    if (!argv.useSSH) {
      return url;
    }
    // have a http url need an ssh url
    const m = url.match(/(https?:\/\/([^/]+)\/|git@(.+):)([\w\d-_/]+)(.git)?/);
    return `git@${m[2]}:${m[4]}.git`;
  }
  if (!url.includes('/')) {
    url = `Caleydo/${url}`;
  }
  if (argv.useSSH) {
    return `git@github.com:${url}.git`;
  }
  return `https://github.com/${url}.git`;
}
349087
def get_repo_version(url):
    
    response = requests.get(url)
    if response.status_code == 404:
        return None
    else:
        return response.text.replace('\n', '')
1346887
function getFileUrl (repo, path, sha, line) {
  return HOST + "/" + repo + "/src/" + sha + "/" + path + "#cl-" + line;
}
623144
def repo_clone(from_name, to_name)
      Dir.chdir(tmp_repos_path) { `git clone #{from_name} #{to_name} 2>&1 > /dev/null` }
      repo_path(to_name)
    end
288023
def validate_repo_url(self, repo: str):
        
        # that should match valid git repos
        if not isinstance(repo, str) or not re.match(r"^(https?|file)://[\w._\-/~]*[.git]?/?$", repo):
            raise ValueError(f"{repo} is not a valid http[s] or file:// git repository.")
933887
def titleForFilepath( url ):
        
        url = nativestring(url)
        if url in XdkEntryItem.TITLE_MAP:
            return XdkEntryItem.TITLE_MAP.get(url)
        
        url      = nativestring(url).replace('\\', '/')
        basename = os.path.basename(url)
        title    = os.path.splitext(basename)[0]
        
        if title == 'index':
            title = url.split('/')[-2]
        
        if title.endswith('-allmembers'):
            title = 'List of All Members for %s' % title.split('-')[-2]
        elif title.endswith('-source'):
            title = 'Source Code for %s' % title.split('-')[-2]
        elif len(nativestring(url).split('/')) <= 2 and title in TITLE_MAP:
            title = TITLE_MAP[title]
        elif not 'api/' in url:
            title = projex.text.pretty(title)
        
        return title
487618
def _join_url_dir(cls, url, *args):
        

        for path in args:
            url = url.rstrip('/') + '/'
            url = urljoin(url, path.lstrip('/'))

        return url
1009309
def url2tmp(self, root, url):
        
        filename = url.rsplit('/', 1)[-1]
        return os.path.join(root, filename)
278404
function getUrl(repo, clone) {
	let url;

	if (repo.type === 'github') {
		url = github(repo, clone);
	} else if (repo.type === 'gitlab') {
		url = gitlab(repo, clone);
	} else if (repo.type === 'bitbucket') {
		url = bitbucket(repo, clone);
	} else if (repo.type === 'oschina') {
		url = oschina(repo, clone);
	} else {
		url = github(repo, clone);
	}

	return url;
}
283902
def url_to_fn(url):
    
    url = url.replace("http://", "").replace("https://", "")
    url = url.split("?")[0]

    return url.replace("%", "_").replace("/", "_")
777768
def get_url(self):
        # type: () -> STRING_TYPE
        """"""

        line = self.line
        try:
            parsed = URI.parse(line)
            line = parsed.to_string(escape_password=False, direct=False, strip_ref=True)
        except ValueError:
            pass
        else:
            self._parsed_url = parsed
            return line
        if self.vcs is not None and self.line.startswith("{0}+".format(self.vcs)):
            _, _, _parseable = self.line.partition("+")
            parsed = urllib_parse.urlparse(add_ssh_scheme_to_git_uri(_parseable))
            line, _ = split_ref_from_uri(line)
        else:
            parsed = urllib_parse.urlparse(add_ssh_scheme_to_git_uri(line))
        if "@" in self.line and parsed.scheme == "":
            name, _, url = self.line.partition("@")
            if self._name is None:
                url = url.strip()
                self._name = name.strip()
                if is_valid_url(url):
                    self.is_direct_url = True
            line = url.strip()
            parsed = urllib_parse.urlparse(line)
            url_path = parsed.path
            if "@" in url_path:
                url_path, _, _ = url_path.rpartition("@")
            parsed = parsed._replace(path=url_path)
        self._parsed_url = parsed
        return line
833536
def url_to_file_path(url, filecache):
    
    key = CacheController.cache_url(url)
    return filecache._fn(key)