def testSwitchSameBranch(self): scm = Mercurial() self.assertEqual(scm.get_branch_from_sandbox(self.packagedir), 'default') self.assertEqual(scm.switch_branch(self.packagedir, 'default'), 0) self.assertEqual(scm.get_branch_from_sandbox(self.packagedir), 'default')
def testSwitchBranch(self): scm = Mercurial(Process(quiet=True)) self.branch(self.packagedir, '2.x') self.modify(self.packagedir) self.assertEqual(scm.checkin_sandbox(self.packagedir, 'testpackage', '0.0', True), 0) self.assertEqual(scm.get_branch_from_sandbox(self.packagedir), '2.x') self.assertEqual(scm.switch_branch(self.packagedir, 'default'), 0) self.assertEqual(scm.get_branch_from_sandbox(self.packagedir), 'default')
def testSwitchBranch(self): scm = Mercurial(Process(quiet=True)) self.branch(self.packagedir, "2.x") self.modify(self.packagedir) self.assertEqual(scm.commit_sandbox(self.packagedir, "testpackage", "0.0", True), 0) self.assertEqual(scm.get_branch_from_sandbox(self.packagedir), "2.x") self.assertEqual(scm.switch_branch(self.packagedir, "default"), 0) self.assertEqual(scm.get_branch_from_sandbox(self.packagedir), "default")
def testSwitchRemoteBranch(self): scm = Mercurial(Process(quiet=True)) self.branch(self.packagedir, '2.x') self.modify(self.packagedir) self.assertEqual( scm.commit_sandbox(self.packagedir, 'testpackage', '0.0', True), 0) self.clone() self.assertEqual(scm.get_branch_from_sandbox(self.clonedir), 'default') self.assertEqual(scm.switch_branch(self.clonedir, '2.x'), 0) self.assertEqual(scm.get_branch_from_sandbox(self.clonedir), '2.x')
def testGetRemoteBranch(self): scm = Mercurial() self.clone() self.assertEqual(scm.get_branch_from_sandbox(self.clonedir), 'default')
def testGetLocalBranchFromBranch(self): scm = Mercurial() self.branch(self.packagedir, '2.x') self.assertEqual(scm.get_branch_from_sandbox(self.packagedir), '2.x')
def testGetLocalBranch(self): scm = Mercurial() self.assertEqual(scm.get_branch_from_sandbox(self.packagedir), "default")