本文整理汇总了Python中gitflow.branches.FeatureBranchManager.create方法的典型用法代码示例。如果您正苦于以下问题:Python FeatureBranchManager.create方法的具体用法?Python FeatureBranchManager.create怎么用?Python FeatureBranchManager.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gitflow.branches.FeatureBranchManager
的用法示例。
在下文中一共展示了FeatureBranchManager.create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_delete_current_feature_raises_error
# 需要导入模块: from gitflow.branches import FeatureBranchManager [as 别名]
# 或者: from gitflow.branches.FeatureBranchManager import create [as 别名]
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')
示例2: test_create_feature_changes_active_branch
# 需要导入模块: from gitflow.branches import FeatureBranchManager [as 别名]
# 或者: from gitflow.branches.FeatureBranchManager import create [as 别名]
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)
示例3: test_finish_feature_push_keep
# 需要导入模块: from gitflow.branches import FeatureBranchManager [as 别名]
# 或者: from gitflow.branches.FeatureBranchManager import create [as 别名]
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])
示例4: test_delete_feature_without_commits
# 需要导入模块: from gitflow.branches import FeatureBranchManager [as 别名]
# 或者: from gitflow.branches.FeatureBranchManager import create [as 别名]
def test_delete_feature_without_commits(self):
gitflow = GitFlow(self.repo)
mgr = FeatureBranchManager(gitflow)
self.assertEquals(2, len(mgr.list()))
mgr.create('foo')
gitflow.develop().checkout()
self.assertEquals(3, len(mgr.list()))
mgr.delete('foo')
self.assertEquals(2, len(mgr.list()))
self.assertNotIn('feat/foo', [b.name for b in self.repo.branches])
示例5: test_delete_feature_with_commits_forcefully
# 需要导入模块: from gitflow.branches import FeatureBranchManager [as 别名]
# 或者: from gitflow.branches.FeatureBranchManager import create [as 别名]
def test_delete_feature_with_commits_forcefully(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()))
mgr.delete('foo', force=True)
self.assertEquals(2, len(mgr.list()))
self.assertNotIn('feat/foo', [b.name for b in self.repo.branches])
示例6: test_delete_feature_with_commits_raises_error
# 需要导入模块: from gitflow.branches import FeatureBranchManager [as 别名]
# 或者: from gitflow.branches.FeatureBranchManager import create [as 别名]
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')
示例7: test_create_feature_changes_active_branch_even_if_dirty_but_without_conflicts
# 需要导入模块: from gitflow.branches import FeatureBranchManager [as 别名]
# 或者: from gitflow.branches.FeatureBranchManager import create [as 别名]
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()])
示例8: test_create_feature_from_remote_branch
# 需要导入模块: from gitflow.branches import FeatureBranchManager [as 别名]
# 或者: from gitflow.branches.FeatureBranchManager import create [as 别名]
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')
示例9: test_create_feature_fetch_from_remote_branch_behind_really_fetches
# 需要导入模块: from gitflow.branches import FeatureBranchManager [as 别名]
# 或者: from gitflow.branches.FeatureBranchManager import create [as 别名]
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))
示例10: test_merge_feature_without_commits
# 需要导入模块: from gitflow.branches import FeatureBranchManager [as 别名]
# 或者: from gitflow.branches.FeatureBranchManager import create [as 别名]
def test_merge_feature_without_commits(self):
repo = create_git_repo(self)
gitflow = GitFlow(repo).init()
mgr = FeatureBranchManager(gitflow)
dc0 = gitflow.develop().commit
mgr.create('newstuff')
mgr.merge('newstuff', 'develop')
dc1 = gitflow.develop().commit
# Assert the develop tip is unchanged by the merge
self.assertEqual(dc0, dc1)
# Assert the target-branch is active
self.assertEqual(gitflow.repo.active_branch.name, 'develop')
示例11: test_delete_already_merged_feature
# 需要导入模块: from gitflow.branches import FeatureBranchManager [as 别名]
# 或者: from gitflow.branches.FeatureBranchManager import create [as 别名]
def test_delete_already_merged_feature(self):
gitflow = GitFlow(self.repo)
mgr = FeatureBranchManager(gitflow)
self.assertEquals(2, len(mgr.list()))
mgr.create('foo')
fake_commit(self.repo, 'Dummy commit #1')
fake_commit(self.repo, 'Dummy commit #2')
mgr.merge('foo', 'devel')
self.assertEquals(3, len(mgr.list()))
mgr.delete('foo')
self.assertEquals(2, len(mgr.list()))
self.assertNotIn('feat/foo', [b.name for b in mgr.list()])
示例12: test_create_feature_from_remote_branch_behind
# 需要导入模块: from gitflow.branches import FeatureBranchManager [as 别名]
# 或者: from gitflow.branches.FeatureBranchManager import create [as 别名]
def test_create_feature_from_remote_branch_behind(self):
# If BranchManager.create() uses `update`, this test-case has
# to be adopted, since since `update` change the cloned repo.
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')
# does not advance feat/even, since create() uses `fetch`, not `update`
self.assertEqual(self.repo.refs['feat/even'].commit, rfc0)
# change must not be in local repo, since create() uses `fetch`, not `update`
self.assertNotIn(change, all_commits(self.repo))
示例13: test_feature_branch_origin
# 需要导入模块: from gitflow.branches import FeatureBranchManager [as 别名]
# 或者: from gitflow.branches.FeatureBranchManager import create [as 别名]
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)
示例14: test_create_new_feature_from_alt_base
# 需要导入模块: from gitflow.branches import FeatureBranchManager [as 别名]
# 或者: from gitflow.branches.FeatureBranchManager import create [as 别名]
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)
示例15: test_create_new_feature_branch_non_default_prefix
# 需要导入模块: from gitflow.branches import FeatureBranchManager [as 别名]
# 或者: from gitflow.branches.FeatureBranchManager import create [as 别名]
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)