本文整理汇总了Python中ellen.repo.Jagare.create_branch方法的典型用法代码示例。如果您正苦于以下问题:Python Jagare.create_branch方法的具体用法?Python Jagare.create_branch怎么用?Python Jagare.create_branch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ellen.repo.Jagare
的用法示例。
在下文中一共展示了Jagare.create_branch方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_merge_commits
# 需要导入模块: from ellen.repo import Jagare [as 别名]
# 或者: from ellen.repo.Jagare import create_branch [as 别名]
def test_merge_commits(self):
repo = Jagare(self.path)
BR = 'br_test_merge'
path = self.get_temp_path()
# repo has work-tree
repo.clone(path, branch=BARE_REPO_OTHER_BRANCH)
repo = Jagare(os.path.join(path, '.git'))
ret = repo.create_branch(BR, BARE_REPO_OTHER_BRANCH)
assert ret
commit_something(path, branch=BR)
repo.update_head(BARE_REPO_OTHER_BRANCH)
merge_index = repo.merge_commits(repo.head.target.hex, BR)
assert merge_index['has_conflicts'] == False
示例2: test_merge_head
# 需要导入模块: from ellen.repo import Jagare [as 别名]
# 或者: from ellen.repo.Jagare import create_branch [as 别名]
def test_merge_head(self):
repo = Jagare(self.path)
BR = 'br_test_merge'
path = self.get_temp_path()
# repo has work-tree
repo.clone(path, branch=BARE_REPO_OTHER_BRANCH)
repo = Jagare(os.path.join(path, '.git'))
ret = repo.create_branch(BR, BARE_REPO_OTHER_BRANCH)
assert ret
commit_something(path, branch=BR)
repo.update_head(BARE_REPO_OTHER_BRANCH)
merge_result = repo.merge_head(BR)
assert merge_result['is_fastforward']
示例3: _merge
# 需要导入模块: from ellen.repo import Jagare [as 别名]
# 或者: from ellen.repo.Jagare import create_branch [as 别名]
def _merge(self, no_ff):
repo = Jagare(self.path)
BR = 'br_test_merge'
path = self.get_temp_path()
# repo has work-tree
repo.clone(path, branch=BARE_REPO_OTHER_BRANCH)
repo = Jagare(os.path.join(path, '.git'))
ret = repo.create_branch(BR, BARE_REPO_OTHER_BRANCH)
assert ret
sha1 = repo.sha(BARE_REPO_OTHER_BRANCH)
commit_something(path, branch=BR)
repo.update_head(BARE_REPO_OTHER_BRANCH)
ret = repo.merge(BR, no_ff=no_ff)
sha2 = repo.sha(BARE_REPO_OTHER_BRANCH)
assert sha1 != sha2
assert repo.sha(sha1) == sha1
示例4: test_create
# 需要导入模块: from ellen.repo import Jagare [as 别名]
# 或者: from ellen.repo.Jagare import create_branch [as 别名]
def test_create(self):
repo = Jagare(self.path)
repo.create_branch('br_test', 'master')
assert repo.sha('br_test') == repo.sha('master')
示例5: create_branch
# 需要导入模块: from ellen.repo import Jagare [as 别名]
# 或者: from ellen.repo.Jagare import create_branch [as 别名]
def create_branch(self, path, name, ref, force):
try:
repo = Jagare(path)
return repo.create_branch(name, ref, force)
except Exception as e:
raise ServiceUnavailable(repr(e))