示例#1
0
文件: test_merge.py 项目: CMGS/ellen
    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
0
    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
0
文件: test_merge.py 项目: CMGS/ellen
    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']
示例#4
0
    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'] is False
示例#5
0
文件: test_merge.py 项目: CMGS/ellen
    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
示例#6
0
    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
示例#7
0
 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))
示例#8
0
文件: test_branch.py 项目: CMGS/ellen
 def test_create(self):
     repo = Jagare(self.path)
     repo.create_branch('br_test', 'master')
     assert repo.sha('br_test') == repo.sha('master')
示例#9
0
 def test_create(self):
     repo = Jagare(self.path)
     repo.create_branch('br_test', 'master')
     assert repo.sha('br_test') == repo.sha('master')
示例#10
0
 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))