~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_versionedfile.py

  • Committer: Robert Collins
  • Date: 2006-03-07 12:17:32 UTC
  • mto: (1594.2.4 integration)
  • mto: This revision was merged to the branch mainline in revision 1596.
  • Revision ID: robertc@robertcollins.net-20060307121732-1a219b872ef18ecc
cleanup deprecation warnings and finish conversion so the inventory is knit based too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
        f.add_lines('r3', ['r2'], ['b\n', 'c\n'])
76
76
        f.add_lines('rM', ['r1', 'r2'], ['b\n', 'c\n'])
77
77
        self.assertEqual([], f.get_ancestry([]))
78
 
        versions = set(f.get_ancestry(['rM']))
79
 
        self.assertEquals(versions, set(['rM', 'r2', 'r1', 'r0']))
 
78
        versions = f.get_ancestry(['rM'])
 
79
        # there are some possibilities:
 
80
        # r0 r1 r2 rM r3
 
81
        # r0 r1 r2 r3 rM
 
82
        # etc
 
83
        # so we check indexes
 
84
        r0 = versions.index('r0')
 
85
        r1 = versions.index('r1')
 
86
        r2 = versions.index('r2')
 
87
        self.assertFalse('r3' in versions)
 
88
        rM = versions.index('rM')
 
89
        self.assertTrue(r0 < r1)
 
90
        self.assertTrue(r0 < r2)
 
91
        self.assertTrue(r1 < rM)
 
92
        self.assertTrue(r2 < rM)
80
93
 
81
94
        self.assertRaises(RevisionNotPresent,
82
95
            f.get_ancestry, ['rM', 'rX'])
164
177
            f.annotate, 'foo')
165
178
 
166
179
    def test_walk(self):
 
180
        # tests that walk returns all the inclusions for the requested
 
181
        # revisions as well as the revisions changes themselves.
167
182
        f = self.get_file('1')
168
183
        f.add_lines('r0', [], ['a\n', 'b\n'])
169
184
        f.add_lines('r1', ['r0'], ['c\n', 'b\n'])