本文整理汇总了Python中vcs.git函数的典型用法代码示例。如果您正苦于以下问题:Python git函数的具体用法?Python git怎么用?Python git使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了git函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: update_expected
def update_expected(test_root, metadata_root, log_file_names, rev_old=None, rev_new="HEAD",
ignore_existing=False, sync_root=None):
"""Update the metadata files for web-platform-tests based on
the results obtained in a previous run"""
manifest = load_test_manifest(test_root, metadata_root)
if sync_root is not None:
if rev_old is not None:
rev_old = git("rev-parse", rev_old, repo=test_root).strip()
rev_new = git("rev-parse", rev_new, repo=test_root).strip()
if rev_old is not None:
change_data = load_change_data(rev_old, rev_new, repo=test_root)
else:
change_data = {}
expected_map = update_from_logs(metadata_root, manifest, *log_file_names,
ignore_existing=ignore_existing)
write_changes(metadata_root, expected_map)
results_changed = [item.test_path for item in expected_map.itervalues() if item.modified]
return unexpected_changes(change_data, results_changed)
开发者ID:L2-D2,项目名称:gecko-dev,代码行数:25,代码来源:metadata.py
示例2: update_expected
def update_expected(test_paths, serve_root, log_file_names,
rev_old=None, rev_new="HEAD", ignore_existing=False,
sync_root=None):
"""Update the metadata files for web-platform-tests based on
the results obtained in a previous run"""
manifests = load_test_manifests(serve_root, test_paths)
change_data = {}
if sync_root is not None:
if rev_old is not None:
rev_old = git("rev-parse", rev_old, repo=sync_root).strip()
rev_new = git("rev-parse", rev_new, repo=sync_root).strip()
if rev_old is not None:
change_data = load_change_data(rev_old, rev_new, repo=sync_root)
expected_map_by_manifest = update_from_logs(manifests,
*log_file_names,
ignore_existing=ignore_existing)
for test_manifest, expected_map in expected_map_by_manifest.iteritems():
url_base = manifests[test_manifest]["url_base"]
metadata_path = test_paths[url_base]["metadata_path"]
write_changes(metadata_path, expected_map)
results_changed = [item.test_path for item in expected_map.itervalues() if item.modified]
return unexpected_changes(manifests, change_data, results_changed)
开发者ID:MicrosoftEdge,项目名称:wptrunner,代码行数:31,代码来源:metadata.py
示例3: update_expected
def update_expected(test_paths, serve_root, log_file_names,
rev_old=None, rev_new="HEAD", ignore_existing=False,
sync_root=None, property_order=None, boolean_properties=None,
stability=None):
"""Update the metadata files for web-platform-tests based on
the results obtained in a previous run or runs
If stability is not None, assume log_file_names refers to logs from repeated
test jobs, disable tests that don't behave as expected on all runs"""
manifests = load_test_manifests(serve_root, test_paths)
change_data = {}
if sync_root is not None:
if rev_old is not None:
rev_old = git("rev-parse", rev_old, repo=sync_root).strip()
rev_new = git("rev-parse", rev_new, repo=sync_root).strip()
if rev_old is not None:
change_data = load_change_data(rev_old, rev_new, repo=sync_root)
expected_map_by_manifest = update_from_logs(manifests,
*log_file_names,
ignore_existing=ignore_existing,
property_order=property_order,
boolean_properties=boolean_properties,
stability=stability)
for test_manifest, expected_map in expected_map_by_manifest.iteritems():
url_base = manifests[test_manifest]["url_base"]
metadata_path = test_paths[url_base]["metadata_path"]
write_changes(metadata_path, expected_map)
if stability is not None:
for tree in expected_map.itervalues():
for test in tree.iterchildren():
for subtest in test.iterchildren():
if subtest.new_disabled:
print "disabled: %s" % os.path.dirname(subtest.root.test_path) + "/" + subtest.name
if test.new_disabled:
print "disabled: %s" % test.root.test_path
results_changed = [item.test_path for item in expected_map.itervalues() if item.modified]
return unexpected_changes(manifests, change_data, results_changed)
开发者ID:inexorabletash,项目名称:web-platform-tests,代码行数:45,代码来源:metadata.py
示例4: _submodules
def _submodules(self):
output = git("submodule", "status", "--recursive", repo=self.repo_path)
rv = []
for line in output.split("\n"):
line = line.strip()
if not line:
continue
parts = line.split(" ")
rv.append(parts[1])
return rv
开发者ID:ashishrana7,项目名称:firefox,代码行数:10,代码来源:update.py
示例5: update
def update(self):
if not os.path.exists(self.repo_path):
os.makedirs(self.repo_path)
if not vcs.is_git_root(self.repo_path):
git("clone", self.remote_url, ".", repo=self.repo_path)
git("checkout", "-b", self.local_branch, self.target_rev, repo=self.repo_path)
assert vcs.is_git_root(self.repo_path)
else:
if git("status", "--porcelain", repo=self.repo_path):
raise RepositoryError("Repository in %s not clean" % self.repo_path)
git("fetch",
self.remote_url,
"%s:%s" % (self.target_rev,
self.local_branch),
repo=self.repo_path)
git("checkout", self.local_branch, repo=self.repo_path)
git("submodule", "init", repo=self.repo_path)
git("submodule", "update", "--init", "--recursive", repo=self.repo_path)
开发者ID:ashishrana7,项目名称:firefox,代码行数:19,代码来源:update.py
示例6: is_type
def is_type(cls, path):
try:
git("rev-parse", "--show-toplevel", repo=path)
except:
return False
return True
开发者ID:ashishrana7,项目名称:firefox,代码行数:6,代码来源:update.py
示例7: __init__
def __init__(self, root=None):
if root is None:
root = git("rev-parse", "--show-toplevel").strip()
self.root = root
self.git = vcs.bind_to_repo(git, self.root)
self.message = None
开发者ID:ashishrana7,项目名称:firefox,代码行数:6,代码来源:update.py
示例8: clean
def clean(self):
git("checkout", self.rev, repo=self.repo_path)
git("branch", "-D", self.local_branch, repo=self.repo_path)
开发者ID:ashishrana7,项目名称:firefox,代码行数:3,代码来源:update.py
示例9: rev
def rev(self):
if vcs.is_git_root(self.repo_path):
return git("rev-parse", "HEAD", repo=self.repo_path).strip()
else:
return None
开发者ID:ashishrana7,项目名称:firefox,代码行数:5,代码来源:update.py
示例10: paths_changed
def paths_changed(rev_old, rev_new, repo):
data = git("diff", "--name-status", rev_range(rev_old, rev_new), repo=repo)
lines = [tuple(item.strip() for item in line.strip().split("\t", 1))
for line in data.split("\n") if line.strip()]
output = set(lines)
return output
开发者ID:inexorabletash,项目名称:web-platform-tests,代码行数:6,代码来源:metadata.py
示例11: files_in_repo
def files_in_repo(repo_root):
return git("ls-tree", "-r", "--name-only", "HEAD").split("\n")
开发者ID:inexorabletash,项目名称:web-platform-tests,代码行数:2,代码来源:metadata.py
注:本文中的vcs.git函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论