def get_version(self): if self.version == 'AUTO': ver = pwd_git_version() if not ver: ver = pwd_hg_version() if not ver: ver = str(int(time.time())) return ver elif self.version == 'GIT': return pwd_git_version() elif self.version == 'HG': return pwd_hg_version() elif self.version: return str(self.version) return str(int(time.time()))
def get_version(self): if not self.version or self.version == 'AUTO': return pwd_version() elif self.version == 'GIT': return pwd_git_version() elif self.version == 'HG': return pwd_hg_version() elif self.version: return str(self.version)
def _get_dependency_version(name): if isdir('.git'): return pwd_git_version() elif isdir('.hg'): return pwd_hg_version() elif isdir('.bzr'): return pwd_bzr_version() return "%s-%s" % (name, run('python setup.py --version'))
def _get_version(target, version): version = version or target.get('version') if version == 'HG': return pwd_hg_version() elif version == 'GIT': return pwd_git_version() elif version: return str(version) else: return str(int(time.time()))
def test_pwd_git_version_without_git(self): # Change into test dir to make sure we're within a repo os.chdir(os.path.dirname(__file__)) self.assertIsNotNone(utils.pwd_git_version()) with patch('shub.utils.find_executable', return_value=None): self.assertIsNone(utils.pwd_git_version())