~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_tsort.py

  • Committer: John Arbash Meinel
  • Date: 2008-07-09 13:36:48 UTC
  • mto: This revision was merged to the branch mainline in revision 3535.
  • Revision ID: john@arbash-meinel.com-20080709133648-3b03z59rcalc4rjx
(bug #243536) tsort.merge_sorted() should work even with a ghost in mainline.

There is a bit of a discrepency when it comes to ghosts.
The revision_graph passed to merge_sorted has had ghosts stripped,
because it cannot handle pointing to nodes that aren't present.
(Thinks there is a graph cycle.)
However, the mainline_history includes the ghost.
For now, work around this by ignoring the ghost in the mainline
history.

Show diffs side-by-side

added added

removed removed

Lines of Context:
533
533
            mainline_revisions=[None, 'A']
534
534
            )
535
535
 
 
536
    def test_mainline_revs_with_ghost(self):
 
537
        # We have a mainline, but the end of it is actually a ghost
 
538
        # The graph that is passed to tsort has had ghosts filtered out, but
 
539
        # the mainline history has not.
 
540
        self.assertSortAndIterate(
 
541
            {'B':[],
 
542
             'C':['B']}.items(),
 
543
            'C',
 
544
            [(0, 'C', 0, (2,), False),
 
545
             (1, 'B', 0, (1,), True),
 
546
             ],
 
547
             True, mainline_revisions=['A', 'B', 'C'])
 
548
 
536
549
    def test_parallel_root_sequence_numbers_increase_with_merges(self):
537
550
        """When there are parallel roots, check their revnos."""
538
551
        self.assertSortAndIterate(