本文整理汇总了Python中ellen.repo.Jagare.merge_flow方法的典型用法代码示例。如果您正苦于以下问题:Python Jagare.merge_flow方法的具体用法?Python Jagare.merge_flow怎么用?Python Jagare.merge_flow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ellen.repo.Jagare
的用法示例。
在下文中一共展示了Jagare.merge_flow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: merge_flow
# 需要导入模块: from ellen.repo import Jagare [as 别名]
# 或者: from ellen.repo.Jagare import merge_flow [as 别名]
def merge_flow(self, path, merger_name, merger_email,
message_header, message_body,
from_repo_path, from_ref, to_ref,
remote_name, no_ff):
"""merge with worktree(tmpdir)"""
try:
repo = Jagare(path)
with get_tmpdir() as tmpdir:
assert tmpdir
ret = repo.merge_flow(merger_name, merger_email,
message_header, message_body, tmpdir,
from_repo_path, from_ref, to_ref,
remote_name=remote_name, no_ff=no_ff)
assert ret
return ret
except Exception as e:
raise ServiceUnavailable(repr(e))
示例2: test_merge_flow
# 需要导入模块: from ellen.repo import Jagare [as 别名]
# 或者: from ellen.repo.Jagare import merge_flow [as 别名]
def test_merge_flow(self):
repo = Jagare(self.path)
BR = 'br_test_merge'
sha1 = repo.sha(BARE_REPO_OTHER_BRANCH)
from_repo_path = self.get_temp_path()
from_repo = repo.clone(from_repo_path, branch=BARE_REPO_OTHER_BRANCH,
bare=True)
ret = from_repo.create_branch(BR, BARE_REPO_OTHER_BRANCH)
assert ret
commit_something(from_repo_path, branch=BR)
tmpdir = self.get_temp_path()
# different repo
sha = repo.merge_flow('lh', '[email protected]',
'test_header', 'test_body', tmpdir,
from_repo_path, BR, BARE_REPO_OTHER_BRANCH,
remote_name='hub/xxxproject', no_ff=True)
assert sha
sha2 = repo.sha(BARE_REPO_OTHER_BRANCH)
assert sha1 != sha2
assert repo.sha(sha1) == sha1
# same repo
tmpdir2 = self.get_temp_path()
from_sha1 = from_repo.sha(BARE_REPO_OTHER_BRANCH)
assert from_sha1 == sha1
sha = from_repo.merge_flow('lh', '[email protected]',
'test_header', 'test_body', tmpdir2,
from_repo_path, BR, BARE_REPO_OTHER_BRANCH,
no_ff=True)
assert sha
from_sha2 = from_repo.sha(BARE_REPO_OTHER_BRANCH)
assert from_sha1 != from_sha2
assert from_repo.sha(from_sha1) == from_sha1