本文整理汇总了Python中jarn.mkrelease.scm.Git类的典型用法代码示例。如果您正苦于以下问题:Python Git类的具体用法?Python Git怎么用?Python Git使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Git类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testSwitchRemoteBranch
def testSwitchRemoteBranch(self):
scm = Git(Process(quiet=True))
self.branch(self.packagedir, "2.x")
self.clone()
self.assertEqual(scm.get_branch_from_sandbox(self.clonedir), "master")
self.assertEqual(scm.switch_branch(self.clonedir, "2.x"), 0)
self.assertEqual(scm.get_branch_from_sandbox(self.clonedir), "2.x")
示例2: testCheckinAndPushDirtyRemoteSandbox
def testCheckinAndPushDirtyRemoteSandbox(self):
scm = Git(Process(quiet=True))
self.clone()
self.modify(self.clonedir)
self.assertEqual(scm.checkin_sandbox(self.clonedir, 'testpackage', '2.6', True), 0)
self.verify(self.clonedir)
self.update(self.packagedir)
self.verify(self.packagedir)
示例3: testCommitAndPushDirtyRemoteSandbox
def testCommitAndPushDirtyRemoteSandbox(self):
scm = Git(Process(quiet=True))
self.clone()
self.modify(self.clonedir)
self.assertEqual(scm.commit_sandbox(self.clonedir, "testpackage", "2.6", True), 0)
self.verify(self.clonedir)
self.update(self.packagedir)
self.verify(self.packagedir)
示例4: testCreateTag
def testCreateTag(self):
scm = Git()
self.assertEqual(scm.tag_exists(self.packagedir, "2.6"), False)
self.assertEqual(scm.create_tag(self.packagedir, "2.6", "testpackage", "2.6", False), 0)
self.assertEqual(scm.tag_exists(self.packagedir, "2.6"), True)
示例5: testTagExists
def testTagExists(self):
scm = Git()
self.tag(self.packagedir, "2.6")
self.assertEqual(scm.tag_exists(self.packagedir, "2.6"), True)
示例6: testDeletedButTrackedFile
def testDeletedButTrackedFile(self):
scm = Git()
self.delete(self.packagedir)
# Note: The sandbox is reported as unclean
self.assertEqual(scm.is_unclean_sandbox(self.packagedir), True)
示例7: testFileUrl
def testFileUrl(self):
scm = Git()
self.assertEqual(scm.is_valid_url("file://"), True)
示例8: testNotExists
def testNotExists(self):
scm = Git()
self.assertEqual(scm.is_valid_sandbox("foo"), False)
示例9: testGetVersion
def testGetVersion(self):
scm = Git()
self.assertNotEqual(scm.get_version(), "")
示例10: testCreateAndPushRemoteTag
def testCreateAndPushRemoteTag(self):
scm = Git(Process(quiet=True))
self.clone()
self.assertEqual(scm.create_tag(self.clonedir, "2.6", "testpackage", "2.6", True), 0)
self.assertEqual(scm.tag_exists(self.clonedir, "2.6"), True)
self.assertEqual(scm.tag_exists(self.packagedir, "2.6"), True)
示例11: testEmptyBranchId
def testEmptyBranchId(self):
scm = Git()
self.assertEqual(scm.make_branchid(self.packagedir, ""), "master")
示例12: testMakeBranchId
def testMakeBranchId(self):
scm = Git()
self.assertEqual(scm.make_branchid(self.packagedir, "2.x"), "2.x")
示例13: testCloneUrl
def testCloneUrl(self):
scm = Git(Process(quiet=True))
self.assertEqual(scm.clone_url(self.packagedir, "testclone"), 0)
self.assertEqual(isdir("testclone"), True)
示例14: testBadProtocol
def testBadProtocol(self):
scm = Git()
self.assertEqual(scm.is_valid_url("svn://"), False)
示例15: testCommitAndPushCleanRemoteSandbox
def testCommitAndPushCleanRemoteSandbox(self):
scm = Git(Process(quiet=True))
self.clone()
self.assertEqual(scm.commit_sandbox(self.clonedir, "testpackage", "2.6", True), 0)