~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to testweave.py

  • Committer: Martin Pool
  • Date: 2005-06-30 08:40:59 UTC
  • mto: This revision was merged to the branch mainline in revision 852.
  • Revision ID: mbp@sourcefrog.net-20050630084059-d6eb6cb46972365b
Rename Weave.get_included to inclusions and getiter to get_iter

Refactor annotate() code 

Show diffs side-by-side

added added

removed removed

Lines of Context:
533
533
 
534
534
 
535
535
class Merge(TestBase):
536
 
    """Storage of versions that merge diverged parents"""
 
536
    """Versions that merge diverged parents"""
537
537
    def runTest(self):
538
538
        k = Weave()
539
539
 
567
567
        self.check_read_write(k)
568
568
 
569
569
 
570
 
class Conflicts(TestBase):
571
 
    """Test detection of conflicting regions during a merge.
572
 
 
573
 
    A base version is inserted, then two descendents try to
574
 
    insert different lines in the same place.  These should be
575
 
    reported as a possible conflict and forwarded to the user."""
576
 
    def runTest(self):
577
 
        return  # NOT RUN
578
 
        k = Weave()
579
 
 
580
 
        k.add([], ['aaa', 'bbb'])
581
 
        k.add([0], ['aaa', '111', 'bbb'])
582
 
        k.add([1], ['aaa', '222', 'bbb'])
583
 
 
584
 
        merged = k.merge([1, 2])
585
 
 
586
 
        self.assertEquals([[['aaa']],
587
 
                           [['111'], ['222']],
588
 
                           [['bbb']]])
589
 
 
590
 
 
591
 
 
592
 
class NonConflict(TestBase):
593
 
    """Two descendants insert compatible changes.
594
 
 
595
 
    No conflict should be reported."""
596
 
    def runTest(self):
597
 
        return  # NOT RUN
598
 
        k = Weave()
599
 
 
600
 
        k.add([], ['aaa', 'bbb'])
601
 
        k.add([0], ['111', 'aaa', 'ccc', 'bbb'])
602
 
        k.add([1], ['aaa', 'ccc', 'bbb', '222'])
603
 
 
604
 
    
605
 
    
606
 
 
607
 
 
608
570
class AutoMerge(TestBase):
609
571
    def runTest(self):
610
572
        k = Weave()
620
582
 
621
583
        self.log('k._l=' + pformat(k._l))
622
584
 
623
 
        m = list(k.mash_iter([0, 1, 2]))
 
585
        m = list(k.merge_iter([0, 1, 2]))
624
586
 
625
587
        self.assertEqual(m,
626
588
                         ['header', 'aaa',