当前位置: 首页>>代码示例>>Python>>正文


Python ReleaseBranchManager.finish方法代码示例

本文整理汇总了Python中gitflow.branches.ReleaseBranchManager.finish方法的典型用法代码示例。如果您正苦于以下问题:Python ReleaseBranchManager.finish方法的具体用法?Python ReleaseBranchManager.finish怎么用?Python ReleaseBranchManager.finish使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gitflow.branches.ReleaseBranchManager的用法示例。


在下文中一共展示了ReleaseBranchManager.finish方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_finish_release_keep

# 需要导入模块: from gitflow.branches import ReleaseBranchManager [as 别名]
# 或者: from gitflow.branches.ReleaseBranchManager import finish [as 别名]
 def test_finish_release_keep(self):
     gitflow = GitFlow(self.repo)
     mgr = ReleaseBranchManager(gitflow)
     mgr.finish('1.0', keep=True)
     # release branch still exists
     self.assertIn('rel/1.0',
             [b.name for b in self.repo.branches])
开发者ID:opicacek,项目名称:gitflow,代码行数:9,代码来源:test_branches.py

示例2: test_finish_release_tag_sign

# 需要导入模块: from gitflow.branches import ReleaseBranchManager [as 别名]
# 或者: from gitflow.branches.ReleaseBranchManager import finish [as 别名]
 def test_finish_release_tag_sign(self):
     gitflow = GitFlow(self.repo)
     mgr = ReleaseBranchManager(gitflow)
     taginfo = dict(
         message = 'Tagging version 1.0',
         signingkey = 'Dummy Key for Gitflow testing',
         )
     mgr.finish('1.0', tagging_info=taginfo)
     # tag message
     tag = self.repo.tags['v1.0'].tag
     self.assertIn('-----BEGIN PGP SIGNATURE-----', tag.message)
开发者ID:opicacek,项目名称:gitflow,代码行数:13,代码来源:test_branches.py

示例3: test_finish_release_push_keep

# 需要导入模块: from gitflow.branches import ReleaseBranchManager [as 别名]
# 或者: from gitflow.branches.ReleaseBranchManager import finish [as 别名]
    def test_finish_release_push_keep(self):
        # Since remote is no bare repo, checkout some branch untouched
        # by this operation. :fixme: find better solution
        self.remote.heads['feat/even'].checkout()
        gitflow = GitFlow(self.repo).init()
        mgr = ReleaseBranchManager(gitflow)
        mgr.create('1.0')
        mgr.finish('1.0', push=True, keep=True)

        # release branch still exists local and remote
        self.assertIn('rel/1.0',
                [b.name for b in self.repo.branches])
        self.assertIn('rel/1.0',
                [b.name for b in self.remote.branches])
开发者ID:opicacek,项目名称:gitflow,代码行数:16,代码来源:test_branches.py

示例4: test_finish_release_tag_sign_push

# 需要导入模块: from gitflow.branches import ReleaseBranchManager [as 别名]
# 或者: from gitflow.branches.ReleaseBranchManager import finish [as 别名]
    def test_finish_release_tag_sign_push(self):
        # Since remote is no bare repo, checkout some branch untouched
        # by this operation. :fixme: find better solution
        self.remote.heads['feat/even'].checkout()
        gitflow = GitFlow(self.repo).init()

        mgr = ReleaseBranchManager(gitflow)
        mgr.create('1.0')
        taginfo = dict(
            message = 'Tagging version 1.0',
            signingkey = 'Dummy Key for Gitflow testing',
            )
        mgr.finish('1.0', push=True, tagging_info=taginfo)
        # tag message
        tag = self.remote.tags['v1.0'].tag
        self.assertIn('-----BEGIN PGP SIGNATURE-----', tag.message)
开发者ID:opicacek,项目名称:gitflow,代码行数:18,代码来源:test_branches.py

示例5: test_finish_release_merge_conflict_tag

# 需要导入模块: from gitflow.branches import ReleaseBranchManager [as 别名]
# 或者: from gitflow.branches.ReleaseBranchManager import finish [as 别名]
    def test_finish_release_merge_conflict_tag(self):
        """
        finish + tag with merge-conflicts on develop
        """
        version_filename = 'VERSION'
        new_version = '1.1\n'

        gitflow = GitFlow(self.repo).init()
        fmgr = FeatureBranchManager(gitflow)
        fmgr.finish('even')
        fake_commit(self.repo, 'Overwrite version',
                    filename=version_filename,
                    change=new_version)

        # verify that the tag does not yet exist
        # "v" comes form "versiontag" prefix in the gitflow config for the "release" fixture
        self.assertNotIn('v1.0', self.repo.tags)

        mgr = ReleaseBranchManager(gitflow)
        taginfo = dict(
            message='Tagging version 1.0',
        )
        self.assertRaises(MergeError,
                          mgr.finish, '1.0', tagging_info=taginfo)

        # verify that the tag exists, even though there was a failed merge
        self.assertIn('v1.0', self.repo.tags)

        # resolve the conflict
        # this is in favor of the change on develop
        write_file(filename=version_filename,
                   append=False,
                   change=new_version)
        gitflow.git.add(version_filename)
        gitflow.git.commit('-F.git/MERGE_MSG')
        # the release branch is still here
        self.assertIn('rel/1.0',
                      [b.name for b in self.repo.branches])
        # finish the release again
        # this should skip the tagging, since that part previously succeeded
        mgr.finish('1.0', tagging_info=taginfo)
        # now the release branch is gone
        self.assertNotIn('rel/1.0',
                         [b.name for b in self.repo.branches])

        # verify that the tag still exists
        self.assertIn('v1.0', self.repo.tags)
开发者ID:chassing,项目名称:gitflow,代码行数:49,代码来源:test_branches.py

示例6: test_finish_release_tag

# 需要导入模块: from gitflow.branches import ReleaseBranchManager [as 别名]
# 或者: from gitflow.branches.ReleaseBranchManager import finish [as 别名]
 def test_finish_release_tag(self):
     gitflow = GitFlow(self.repo)
     mgr = ReleaseBranchManager(gitflow)
     taginfo = dict(
         message = 'Tagging version 1.0'
         )
     mgr.finish('1.0', tagging_info=taginfo)
     mc1 = gitflow.master().commit
     dc1 = gitflow.develop().commit
     # master is merged back to develop
     self.assertIn(mc1, dc1.parents)
     # tag exists
     self.assertIn('v1.0', self.repo.tags)
     self.assertEqual(self.repo.tags['v1.0'].commit, mc1)
     # tag message
     self.assertEqual(self.repo.tags['v1.0'].tag.message,
                      'Tagging version 1.0')
开发者ID:opicacek,项目名称:gitflow,代码行数:19,代码来源:test_branches.py

示例7: test_finish_release_merge_conflict

# 需要导入模块: from gitflow.branches import ReleaseBranchManager [as 别名]
# 或者: from gitflow.branches.ReleaseBranchManager import finish [as 别名]
    def test_finish_release_merge_conflict(self):
        gitflow = GitFlow(self.repo).init()
        fmgr = FeatureBranchManager(gitflow)
        fmgr.finish('even')
        fake_commit(self.repo, 'Overwrite version', filename='VERSION')

        mgr = ReleaseBranchManager(gitflow)
        self.assertRaises(MergeError,
                          mgr.finish, '1.0')
        # resolve the conflict
        gitflow.git.rm('VERSION')
        gitflow.git.commit('-F.git/MERGE_MSG')
        # the release branch is still here
        self.assertIn('rel/1.0',
                [b.name for b in self.repo.branches])
        mgr.finish('1.0')
        # now the release branch is gone
        self.assertNotIn('rel/1.0',
                [b.name for b in self.repo.branches])
开发者ID:opicacek,项目名称:gitflow,代码行数:21,代码来源:test_branches.py

示例8: test_finish_release_tag_push

# 需要导入模块: from gitflow.branches import ReleaseBranchManager [as 别名]
# 或者: from gitflow.branches.ReleaseBranchManager import finish [as 别名]
    def test_finish_release_tag_push(self):
        # Since remote is no bare repo, checkout some branch untouched
        # by this operation. :fixme: find better solution
        self.remote.heads['feat/even'].checkout()
        gitflow = GitFlow(self.repo).init()

        mgr = ReleaseBranchManager(gitflow)
        mgr.create('1.0')
        taginfo = dict(
            message = 'Tagging version 1.0'
            )
        mgr.finish('1.0', push=True, tagging_info=taginfo)
        mc1 = gitflow.master().commit
        # remote tag exists
        self.assertIn('v1.0', self.remote.tags)
        self.assertEqual(self.remote.tags['v1.0'].commit, mc1)
        # tag message
        self.assertEqual(self.remote.tags['v1.0'].tag.message,
                         'Tagging version 1.0')
开发者ID:opicacek,项目名称:gitflow,代码行数:21,代码来源:test_branches.py

示例9: test_finish_release_push

# 需要导入模块: from gitflow.branches import ReleaseBranchManager [as 别名]
# 或者: from gitflow.branches.ReleaseBranchManager import finish [as 别名]
    def test_finish_release_push(self):
        remote =  GitFlow(self.remote).init()
        # Since remote is no bare repo, checkout some branch untouched
        # by this operation. :fixme: find better solution
        self.remote.heads['feat/even'].checkout()
        gitflow = GitFlow(self.repo).init()

        rmc0 = remote.master().commit
        rdc0 = remote.develop().commit
        mc0 = gitflow.master().commit
        dc0 = gitflow.develop().commit

        mgr = ReleaseBranchManager(gitflow)
        mgr.create('1.0')
        mgr.finish('1.0', push=True)
        rmc1 = remote.master().commit
        rdc1 = remote.develop().commit
        mc1 = gitflow.master().commit
        dc1 = gitflow.develop().commit

        # Release finishes advances master and develop both local and remote
        self.assertNotEqual(rmc0, rmc1)
        self.assertNotEqual(rdc0, rdc1)
        self.assertNotEqual(mc0, mc1)
        self.assertNotEqual(dc0, dc1)

        # local and remote heads must be the same again
        self.assertEqual(rmc1, mc1)
        self.assertEqual(rdc1, dc1)

        # Finishing removes the local and the remote release branch
        self.assertNotIn('rel/1.0',
                [b.name for b in self.repo.branches])
        self.assertNotIn('rel/1.0',
                [b.name for b in self.remote.branches])


        # Merge commit message
        self.assertEquals('Finished release 1.0.\n', rdc1.message)
开发者ID:opicacek,项目名称:gitflow,代码行数:41,代码来源:test_branches.py

示例10: test_finish_release

# 需要导入模块: from gitflow.branches import ReleaseBranchManager [as 别名]
# 或者: from gitflow.branches.ReleaseBranchManager import finish [as 别名]
    def test_finish_release(self):
        gitflow = GitFlow(self.repo)
        mgr = ReleaseBranchManager(gitflow)

        mc0 = gitflow.master().commit
        dc0 = gitflow.develop().commit
        mgr.finish('1.0')
        mc1 = gitflow.master().commit
        dc1 = gitflow.develop().commit

        # Release finishes advance both master and develop
        self.assertNotEqual(mc0, mc1)
        self.assertNotEqual(dc0, dc1)
        # master is merged back to develop
        self.assertIn(mc1, dc1.parents)

        # Finishing removes the release branch
        self.assertNotIn('rel/1.0',
                [b.name for b in self.repo.branches])

        # Merge commit message
        self.assertEquals('Finished release 1.0.\n', dc1.message)
        self.assertEquals('Finished release 1.0.\n', mc1.message)
开发者ID:opicacek,项目名称:gitflow,代码行数:25,代码来源:test_branches.py

示例11: test_create_new_release_for_existing_tag_raises_error

# 需要导入模块: from gitflow.branches import ReleaseBranchManager [as 别名]
# 或者: from gitflow.branches.ReleaseBranchManager import finish [as 别名]
 def test_create_new_release_for_existing_tag_raises_error(self):
     gitflow = GitFlow(self.repo)
     mgr = ReleaseBranchManager(gitflow)
     mgr.finish('1.0', tagging_info={'message':'Tagging 1.0'})
     self.assertRaises(TagExistsError,
                       mgr.create, '1.0')
开发者ID:opicacek,项目名称:gitflow,代码行数:8,代码来源:test_branches.py


注:本文中的gitflow.branches.ReleaseBranchManager.finish方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。