예제 #1
0
파일: config.py 프로젝트: jsargiot/shub
 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()))
예제 #2
0
파일: config.py 프로젝트: nestortoledo/shub
 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)
예제 #3
0
 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)
예제 #4
0
파일: deploy_egg.py 프로젝트: coripple/shub
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'))
예제 #5
0
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'))
예제 #6
0
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()))
예제 #7
0
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()))
예제 #8
0
 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())
예제 #9
0
파일: test_utils.py 프로젝트: rowhit/shub
 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())