本文整理匯總了Python中vcstools.git.GitClient.is_tag方法的典型用法代碼示例。如果您正苦於以下問題:Python GitClient.is_tag方法的具體用法?Python GitClient.is_tag怎麽用?Python GitClient.is_tag使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vcstools.git.GitClient
的用法示例。
在下文中一共展示了GitClient.is_tag方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: checkout_package
# 需要導入模塊: from vcstools.git import GitClient [as 別名]
# 或者: from vcstools.git.GitClient import is_tag [as 別名]
def checkout_package(self, package_name):
"""Fetches and checks out the correct version of a package for the rosdistro"""
pkg_info = self._rosdist.get_package_checkout_info()[package_name]
repo_url = pkg_info['url']
name = os.path.basename(pkg_info['url'])
repo_path = os.path.join(self.workspace, name)
client = GitClient(repo_path)
if client.path_exists():
tag = pkg_info['version'] if client.is_tag(pkg_info['version']) else pkg_info['full_version']
if client.get_url() == repo_url:
# Sometimes debian/rules gets mussed with in the build process.
# This should translate to 'git checkout debian/rules' which should reset so we can change tags
client.update('debian/rules', verbose=True)
updated = client.update(tag, force_fetch=True, verbose=True)
if not updated:
print("WARNING: Repo at %s changed url from %s to %s or update failed. Redownloading!" % (repo_path, client.get_url(), repo_url))
shutil.rmtree(repo_path)
self.fetch_with_tagcheck(client, pkg_info)
else:
self.fetch_with_tagcheck(client, pkg_info)
return repo_path