本文整理汇总了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