~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_versionedfile.py

  • Committer: Andrew Bennetts
  • Date: 2007-08-30 08:11:54 UTC
  • mfrom: (2766 +trunk)
  • mto: (2535.3.55 repo-refactor)
  • mto: This revision was merged to the branch mainline in revision 2772.
  • Revision ID: andrew.bennetts@canonical.com-20070830081154-16hebp2xwr15x2hc
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
543
543
        self.assertRaises(RevisionNotPresent,
544
544
            f.annotate, 'foo')
545
545
 
546
 
    def test_walk(self):
547
 
        # tests that walk returns all the inclusions for the requested
548
 
        # revisions as well as the revisions changes themselves.
549
 
        f = self.get_file('1')
550
 
        f.add_lines('r0', [], ['a\n', 'b\n'])
551
 
        f.add_lines('r1', ['r0'], ['c\n', 'b\n'])
552
 
        f.add_lines('rX', ['r1'], ['d\n', 'b\n'])
553
 
        f.add_lines('rY', ['r1'], ['c\n', 'e\n'])
554
 
 
555
 
        lines = {}
556
 
        for lineno, insert, dset, text in f.walk(['rX', 'rY']):
557
 
            lines[text] = (insert, dset)
558
 
 
559
 
        self.assertTrue(lines['a\n'], ('r0', set(['r1'])))
560
 
        self.assertTrue(lines['b\n'], ('r0', set(['rY'])))
561
 
        self.assertTrue(lines['c\n'], ('r1', set(['rX'])))
562
 
        self.assertTrue(lines['d\n'], ('rX', set([])))
563
 
        self.assertTrue(lines['e\n'], ('rY', set([])))
564
 
 
565
546
    def test_detection(self):
566
547
        # Test weaves detect corruption.
567
548
        #