~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testrevision.py

  • Committer: aaron.bentley at utoronto
  • Date: 2005-09-04 02:59:56 UTC
  • mfrom: (1172)
  • mto: (1185.3.4)
  • mto: This revision was merged to the branch mainline in revision 1178.
  • Revision ID: aaron.bentley@utoronto.ca-20050904025956-776ba4f07de97700
Merged mpool's latest changes (~0.0.7)

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
 
from bzrlib.selftest import InTempDir
 
17
from bzrlib.selftest import TestCaseInTempDir
18
18
 
19
19
 
20
20
def make_branches():
21
21
    from bzrlib.branch import Branch
22
22
    from bzrlib.commit import commit
23
 
    from bzrlib.revision import validate_revision_id
24
23
    import os
25
24
    os.mkdir("branch1")
26
25
    br1 = Branch("branch1", init=True)
46
45
    return br1, br2
47
46
 
48
47
 
49
 
class TestIsAncestor(InTempDir):
50
 
 
 
48
class TestIsAncestor(TestCaseInTempDir):
51
49
    def test_is_ancestor(self):
52
50
        """Test checking whether a revision is an ancestor of another revision"""
53
51
        from bzrlib.revision import is_ancestor, MultipleRevisionSources
68
66
        assert is_ancestor(revisions[3], revisions_2[3], sources)
69
67
        assert not is_ancestor(revisions[3], revisions_2[3], br1)
70
68
 
71
 
class TestIntermediateRevisions(InTempDir):
 
69
class TestIntermediateRevisions(TestCaseInTempDir):
72
70
 
73
71
    def setUp(self):
74
72
        from bzrlib.commit import commit
75
 
        InTempDir.setUp(self)
 
73
        TestCaseInTempDir.setUp(self)
76
74
        self.br1, self.br2 = make_branches()
77
75
        commit(self.br2, "Commit eleven", rev_id="b@u-0-7")
78
76
        commit(self.br2, "Commit twelve", rev_id="b@u-0-8")
131
129
                          'c@u-0-6', self.br2.revision_history())
132
130
 
133
131
 
134
 
class TestCommonAncestor(InTempDir):
 
132
class TestCommonAncestor(TestCaseInTempDir):
135
133
    """Test checking whether a revision is an ancestor of another revision"""
136
134
 
137
135
    def test_common_ancestor(self):