本文整理汇总了Python中datalad.support.annexrepo.AnnexRepo.git_get_branch_commits方法的典型用法代码示例。如果您正苦于以下问题:Python AnnexRepo.git_get_branch_commits方法的具体用法?Python AnnexRepo.git_get_branch_commits怎么用?Python AnnexRepo.git_get_branch_commits使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类datalad.support.annexrepo.AnnexRepo
的用法示例。
在下文中一共展示了AnnexRepo.git_get_branch_commits方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_publish_with_data
# 需要导入模块: from datalad.support.annexrepo import AnnexRepo [as 别名]
# 或者: from datalad.support.annexrepo.AnnexRepo import git_get_branch_commits [as 别名]
def test_publish_with_data(origin, src_path, dst_path):
# prepare src
source = install(path=src_path, source=origin, recursive=True)
# TODO: For now, circumnavigate the detached head issue.
# Figure out, what to do.
for subds in source.get_dataset_handles(recursive=True):
AnnexRepo(opj(src_path, subds), init=True, create=True).git_checkout("master")
source.repo.get('test-annex.dat')
# create plain git at target:
target = AnnexRepo(dst_path, create=True)
target.git_checkout("TMP", "-b")
source.repo.git_remote_add("target", dst_path)
res = publish(dataset=source, dest="target", with_data=['test-annex.dat'])
eq_(res, source)
eq_(list(target.git_get_branch_commits("master")),
list(source.repo.git_get_branch_commits("master")))
# TODO: last commit in git-annex branch differs. Probably fine,
# but figure out, when exactly to expect this for proper testing:
eq_(list(target.git_get_branch_commits("git-annex"))[1:],
list(source.repo.git_get_branch_commits("git-annex"))[1:])
# we need compare target/master:
target.git_checkout("master")
eq_(target.file_has_content(['test-annex.dat']), [True])