def testSwitchBranch(self): scm = Subversion(Process(quiet=True)) trunkid = 'file://%s/trunk' % self.packagedir branchid = 'file://%s/branches/2.x' % self.packagedir self.branch(self.clonedir, branchid) self.assertEqual(scm.get_branch_from_sandbox(self.clonedir), trunkid) self.assertEqual(scm.switch_branch(self.clonedir, branchid), 0) self.assertEqual(scm.get_branch_from_sandbox(self.clonedir), branchid)
def testGetBranchFromBranchSubdir(self): scm = Subversion() branchid = "file://%s/branches/2.x" % self.packagedir self.branch(self.clonedir, branchid) self.assertEqual( scm.get_branch_from_sandbox(join(self.branchdir, "testpackage")), "file://%s/branches/2.x" % self.packagedir )
def testTagIdFromBranch(self): scm = Subversion() branchid = 'file://%s/branch/2.x' % self.packagedir self.branch(self.clonedir, branchid) self.assertEqual(scm.get_branch_from_sandbox(self.branchdir), 'file://%s/branch/2.x' % self.packagedir) self.assertEqual(scm.make_tagid(self.branchdir, '2.6'), 'file://%s/tag/2.6' % self.packagedir)
def testSwitchSameBranch(self): scm = Subversion() trunkid = 'file://%s/trunk' % self.packagedir self.assertEqual(scm.get_branch_from_sandbox(self.clonedir), trunkid) self.assertEqual(scm.switch_branch(self.clonedir, trunkid), 0) self.assertEqual(scm.get_branch_from_sandbox(self.clonedir), trunkid)
def testGetBranchFromBranchSubdir(self): scm = Subversion() branchid = 'file://%s/branches/2.x' % self.packagedir self.branch(self.clonedir, branchid) self.assertEqual(scm.get_branch_from_sandbox(join(self.branchdir, 'testpackage')), 'file://%s/branches/2.x' % self.packagedir)
def testGetBranchFromBranch(self): scm = Subversion() branchid = 'file://%s/branches/2.x' % self.packagedir self.branch(self.clonedir, branchid) self.assertEqual(scm.get_branch_from_sandbox(self.branchdir), 'file://%s/branches/2.x' % self.packagedir)
def testGetBranchFromSubdir(self): scm = Subversion() self.assertEqual(scm.get_branch_from_sandbox(join(self.clonedir, 'testpackage')), 'file://%s/trunk' % self.packagedir)
def testGetBranch(self): scm = Subversion() self.assertEqual(scm.get_branch_from_sandbox(self.clonedir), 'file://%s/trunk' % self.packagedir)
def testTagIdFromBranch(self): scm = Subversion() branchid = "file://%s/branches/2.x" % self.packagedir self.branch(self.clonedir, branchid) self.assertEqual(scm.get_branch_from_sandbox(self.branchdir), "file://%s/branches/2.x" % self.packagedir) self.assertEqual(scm.make_tagid(self.branchdir, "2.6"), "file://%s/tags/2.6" % self.packagedir)