mirror of https://github.com/pypa/pip
Rename VersionControl.get_url() to get_remote_url().
This commit is contained in:
parent
8a4e2851d2
commit
7e8e706791
|
@ -327,7 +327,7 @@ class VersionControl(object):
|
|||
|
||||
rev_display = rev_options.to_display()
|
||||
if self.is_repository_directory(dest):
|
||||
existing_url = self.get_url(dest)
|
||||
existing_url = self.get_remote_url(dest)
|
||||
if self.compare_urls(existing_url, url):
|
||||
logger.debug(
|
||||
'%s in %s exists, and has correct URL (%s)',
|
||||
|
@ -419,7 +419,7 @@ class VersionControl(object):
|
|||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def get_url(self, location):
|
||||
def get_remote_url(self, location):
|
||||
"""
|
||||
Return the url used at location
|
||||
"""
|
||||
|
|
|
@ -75,7 +75,7 @@ class Bazaar(VersionControl):
|
|||
url = 'bzr+' + url
|
||||
return url, rev, user_pass
|
||||
|
||||
def get_url(self, location):
|
||||
def get_remote_url(self, location):
|
||||
urls = self.run_command(['info'], show_stdout=False, cwd=location)
|
||||
for line in urls.splitlines():
|
||||
line = line.strip()
|
||||
|
@ -95,7 +95,7 @@ class Bazaar(VersionControl):
|
|||
return revision.splitlines()[-1]
|
||||
|
||||
def get_src_requirement(self, location, project_name):
|
||||
repo = self.get_url(location)
|
||||
repo = self.get_remote_url(location)
|
||||
if not repo:
|
||||
return None
|
||||
if not repo.lower().startswith('bzr:'):
|
||||
|
|
|
@ -243,7 +243,7 @@ class Git(VersionControl):
|
|||
#: update submodules
|
||||
self.update_submodules(dest)
|
||||
|
||||
def get_url(self, location):
|
||||
def get_remote_url(self, location):
|
||||
"""Return URL of the first remote encountered."""
|
||||
remotes = self.run_command(
|
||||
['config', '--get-regexp', r'remote\..*\.url'],
|
||||
|
@ -294,7 +294,7 @@ class Git(VersionControl):
|
|||
return os.path.relpath(location, root_dir)
|
||||
|
||||
def get_src_requirement(self, location, project_name):
|
||||
repo = self.get_url(location)
|
||||
repo = self.get_remote_url(location)
|
||||
if not repo.lower().startswith('git:'):
|
||||
repo = 'git+' + repo
|
||||
current_rev = self.get_revision(location)
|
||||
|
|
|
@ -64,7 +64,7 @@ class Mercurial(VersionControl):
|
|||
cmd_args = ['update', '-q'] + rev_options.to_args()
|
||||
self.run_command(cmd_args, cwd=dest)
|
||||
|
||||
def get_url(self, location):
|
||||
def get_remote_url(self, location):
|
||||
url = self.run_command(
|
||||
['showconfig', 'paths.default'],
|
||||
show_stdout=False, cwd=location).strip()
|
||||
|
@ -85,7 +85,7 @@ class Mercurial(VersionControl):
|
|||
return current_rev_hash
|
||||
|
||||
def get_src_requirement(self, location, project_name):
|
||||
repo = self.get_url(location)
|
||||
repo = self.get_remote_url(location)
|
||||
if not repo.lower().startswith('hg:'):
|
||||
repo = 'hg+' + repo
|
||||
current_rev_hash = self.get_revision_hash(location)
|
||||
|
|
|
@ -131,7 +131,7 @@ class Subversion(VersionControl):
|
|||
|
||||
return extra_args
|
||||
|
||||
def get_url(self, location):
|
||||
def get_remote_url(self, location):
|
||||
# In cases where the source is in a subdirectory, not alongside
|
||||
# setup.py we have to look up in the location until we find a real
|
||||
# setup.py
|
||||
|
@ -196,7 +196,7 @@ class Subversion(VersionControl):
|
|||
return url, rev
|
||||
|
||||
def get_src_requirement(self, location, project_name):
|
||||
repo = self.get_url(location)
|
||||
repo = self.get_remote_url(location)
|
||||
if repo is None:
|
||||
return None
|
||||
repo = 'svn+' + repo
|
||||
|
|
Loading…
Reference in New Issue