本文整理汇总了Python中gitflow.branches.FeatureBranchManager类的典型用法代码示例。如果您正苦于以下问题:Python FeatureBranchManager类的具体用法?Python FeatureBranchManager怎么用?Python FeatureBranchManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FeatureBranchManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_feature_branch_origin
def test_feature_branch_origin(self):
repo = create_git_repo(self)
gitflow = GitFlow(repo).init()
mgr = FeatureBranchManager(gitflow)
new_branch = mgr.create('foobar')
self.assertEqual(new_branch.commit,
gitflow.repo.branches['develop'].commit)
示例2: test_delete_current_feature_raises_error
def test_delete_current_feature_raises_error(self):
gitflow = GitFlow(self.repo)
mgr = FeatureBranchManager(gitflow)
mgr.create('foo').checkout()
self.assertRaisesRegexp(GitCommandError,
'Cannot delete the branch .* which you are currently on',
mgr.delete, 'foo')
示例3: test_finish_feature_keep
def test_finish_feature_keep(self):
gitflow = GitFlow(self.repo)
mgr = FeatureBranchManager(gitflow)
mgr.finish('even', keep=True)
# feature branch still exists
self.assertIn('feat/even',
[b.name for b in self.repo.branches])
示例4: test_create_new_feature_from_alt_base
def test_create_new_feature_from_alt_base(self):
gitflow = GitFlow(self.repo)
mgr = FeatureBranchManager(gitflow)
new_branch = mgr.create('foo', 'feat/even')
self.assertEqual(new_branch.commit,
gitflow.repo.branches['feat/even'].commit)
示例5: test_create_feature_changes_active_branch
def test_create_feature_changes_active_branch(self):
gitflow = GitFlow(self.repo)
mgr = FeatureBranchManager(gitflow)
self.assertEquals('feat/recursion', self.repo.active_branch.name)
mgr.create('foo')
self.assertEquals('feat/foo', self.repo.active_branch.name)
示例6: test_create_new_feature_branch_non_default_prefix
def test_create_new_feature_branch_non_default_prefix(self):
gitflow = GitFlow(self.repo).init()
mgr = FeatureBranchManager(gitflow)
new_branch = mgr.create('foo')
self.assertEqual(new_branch.name, 'feat/foo')
self.assertIn('feat/foo', [b.name for b in mgr.list()])
self.assertEqual(new_branch.commit,
gitflow.repo.branches['devel'].commit)
示例7: test_merge_conflict
def test_merge_conflict(self):
gitflow = GitFlow(self.repo)
mgr = FeatureBranchManager(gitflow)
mgr.merge('recursion', 'devel')
self.assertRaises(MergeError,
mgr.merge, 'even', 'devel')
gitflow.git.rm('odd.py')
gitflow.git.commit('-F.git/MERGE_MSG')
示例8: test_finish_feature_unresolved_merge_conflict
def test_finish_feature_unresolved_merge_conflict(self):
gitflow = GitFlow(self.repo).init()
mgr = FeatureBranchManager(gitflow)
mgr.finish('recursion')
self.assertRaises(MergeError,
mgr.finish, 'even')
# do not resolve, but finish again
self.assertRaises(GitCommandError,
mgr.finish, 'even')
示例9: test_create_new_feature_branch
def test_create_new_feature_branch(self):
repo = create_git_repo(self)
gitflow = GitFlow(repo).init()
mgr = FeatureBranchManager(gitflow)
self.assertEqual(0, len(mgr.list()))
new_branch = mgr.create('foo')
self.assertEqual(1, len(mgr.list()))
self.assertEqual('feature/foo', mgr.list()[0].name)
self.assertEqual(new_branch.commit,
gitflow.repo.branches['develop'].commit)
示例10: test_finish_feature_push_keep
def test_finish_feature_push_keep(self):
gitflow = GitFlow(self.repo).init()
mgr = FeatureBranchManager(gitflow)
mgr.create('even')
mgr.finish('even', push=True, keep=True)
# Finishing removes the local and the remote feature branch
self.assertIn('feat/even',
[b.name for b in self.repo.branches])
self.assertIn('feat/even',
[b.name for b in self.remote.branches])
示例11: test_create_feature_from_remote_branch
def test_create_feature_from_remote_branch(self):
remote_branch = self.remote.refs['feat/even']
rfc0 = remote_branch.commit
gitflow = GitFlow(self.repo).init()
mgr = FeatureBranchManager(gitflow)
mgr.create('even')
branch = self.repo.active_branch
self.assertEqual(branch.name, 'feat/even')
self.assertEqual(branch.commit, rfc0)
# must be a tracking branch
self.assertTrue(branch.tracking_branch())
self.assertEqual(branch.tracking_branch().name, 'my-remote/feat/even')
示例12: test_finish_release_unresolved_merge_conflict
def test_finish_release_unresolved_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')
# do not resolve, but finish again
self.assertRaises(GitCommandError,
mgr.finish, '1.0')
示例13: test_create_feature_changes_active_branch_even_if_dirty_but_without_conflicts
def test_create_feature_changes_active_branch_even_if_dirty_but_without_conflicts(self):
gitflow = GitFlow(self.repo)
mgr = FeatureBranchManager(gitflow)
# In this fixture, odd.py contains changes that would be overwritten.
# Since we don't want to test this here, we revert all local changes in
# odd.py, but leave the local changes in README.txt. These changes
# won't be overwritten by the merge, so git-flow should be able to
# create a new feature branch if Git can do this
self.repo.index.reset(index=True, working_tree=True, paths=['odd.py'])
mgr.create('foo')
self.assertIn('feature/foo', [b.name for b in mgr.iter()])
示例14: test_delete_feature_with_commits_raises_error
def test_delete_feature_with_commits_raises_error(self):
gitflow = GitFlow(self.repo)
mgr = FeatureBranchManager(gitflow)
self.assertEquals(2, len(mgr.list()))
mgr.create('foo')
fake_commit(self.repo, 'A commit on the feature branch.', append=False)
gitflow.develop().checkout()
self.assertEquals(3, len(mgr.list()))
self.assertRaisesRegexp(GitCommandError,
'The branch .* is not fully merged',
mgr.delete, 'foo')
示例15: test_create_feature_fetch_from_remote_branch_behind_really_fetches
def test_create_feature_fetch_from_remote_branch_behind_really_fetches(self):
rfc0 = self.remote.refs['feat/even'].commit
# add a commit to remote feat/even branch
self.remote.refs['feat/even'].checkout()
change = fake_commit(self.remote, "Yet another even commit.")
gitflow = GitFlow(self.repo).init()
mgr = FeatureBranchManager(gitflow)
mgr.create('even', fetch=True)
# must not advance feat/even
self.assertEqual(self.repo.refs['feat/even'].commit, rfc0)
# change must nor be in local repo
self.assertNotIn(change, all_commits(self.repo))