~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to test_multiparent.py

  • Committer: Aaron Bentley
  • Date: 2007-04-12 04:39:21 UTC
  • mto: (2520.4.1 bzr.mpbundle)
  • mto: This revision was merged to the branch mainline in revision 2631.
  • Revision ID: aaron.bentley@utoronto.ca-20070412043921-nl2n5ez9pl4m8vxj
Fix restoration bug

Show diffs side-by-side

added added

removed removed

Lines of Context:
170
170
                          self.reconstruct(vf, 'rev-c',  0, 4))
171
171
        self.assertEqual(['a\n', 'b\n', 'e\n', 'f\n'],
172
172
                          self.reconstruct_version(vf, 'rev-c'))
 
173
 
 
174
    def test_reordered(self):
 
175
        """Check for a corner case that requires re-starting the cursor"""
 
176
        vf = multiparent.MultiVersionedFile()
 
177
        # rev-b must have at least two hunks, so split a and b with c.
 
178
        self.add_version(vf, 'c', 'rev-a', [])
 
179
        self.add_version(vf, 'acb', 'rev-b', ['rev-a'])
 
180
        # rev-c and rev-d must each have a line from a different rev-b hunk
 
181
        self.add_version(vf, 'b', 'rev-c', ['rev-b'])
 
182
        self.add_version(vf, 'a', 'rev-d', ['rev-b'])
 
183
        # The lines from rev-c and rev-d must appear in the opposite order
 
184
        self.add_version(vf, 'ba', 'rev-e', ['rev-c', 'rev-d'])
 
185
        vf.clear_cache()
 
186
        lines = vf.get_line_list(['rev-e'])[0]
 
187
        self.assertEqual(['b\n', 'a\n'], lines)