Use is_repository_directory() inside VersionControl.controls_location().

This commit is contained in:
Chris Jerdonek 2018-07-17 13:05:26 -07:00
parent 22acd1fed1
commit f62440950b
1 changed files with 4 additions and 4 deletions

View File

@ -204,6 +204,8 @@ class VersionControl(object):
""" """
Return whether a directory path is a repository directory. Return whether a directory path is a repository directory.
""" """
logger.debug('Checking in %s for %s (%s)...',
path, self.dirname, self.name)
return os.path.exists(os.path.join(path, self.dirname)) return os.path.exists(os.path.join(path, self.dirname))
# See issue #1083 for why this method was introduced: # See issue #1083 for why this method was introduced:
@ -472,10 +474,8 @@ class VersionControl(object):
It is meant to be overridden to implement smarter detection It is meant to be overridden to implement smarter detection
mechanisms for specific vcs. mechanisms for specific vcs.
""" """
logger.debug('Checking in %s for %s (%s)...', vcs = cls()
location, cls.dirname, cls.name) return vcs.is_repository_directory(location)
path = os.path.join(location, cls.dirname)
return os.path.exists(path)
def get_src_requirement(dist, location): def get_src_requirement(dist, location):