本文整理汇总了Python中datalad.support.gitrepo.GitRepo.precommit方法的典型用法代码示例。如果您正苦于以下问题:Python GitRepo.precommit方法的具体用法?Python GitRepo.precommit怎么用?Python GitRepo.precommit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类datalad.support.gitrepo.GitRepo
的用法示例。
在下文中一共展示了GitRepo.precommit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_GitRepo_git_get_branch_commits
# 需要导入模块: from datalad.support.gitrepo import GitRepo [as 别名]
# 或者: from datalad.support.gitrepo.GitRepo import precommit [as 别名]
def test_GitRepo_git_get_branch_commits(src):
repo = GitRepo(src, create=True)
with open(op.join(src, 'file.txt'), 'w') as f:
f.write('load')
repo.add('*')
repo.commit('committing')
commits_default = list(repo.get_branch_commits())
commits = list(repo.get_branch_commits('master'))
eq_(commits, commits_default)
eq_(len(commits), 1)
commits_stop0 = list(repo.get_branch_commits(stop=commits[0].hexsha))
eq_(commits_stop0, [])
commits_hexsha = list(repo.get_branch_commits(value='hexsha'))
commits_hexsha_left = list(repo.get_branch_commits(value='hexsha', limit='left-only'))
eq_([commits[0].hexsha], commits_hexsha)
# our unittest is rudimentary ;-)
eq_(commits_hexsha_left, commits_hexsha)
repo.precommit() # to stop all the batched processes for swallow_outputs
raise SkipTest("TODO: Was more of a smoke test -- improve testing")