/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_knit.py

  • Committer: Robert Collins
  • Date: 2008-03-19 04:39:04 UTC
  • mto: This revision was merged to the branch mainline in revision 3306.
  • Revision ID: robertc@robertcollins.net-20080319043904-7g4imzvybc7q9l8h
Deprecate VersionedFile.get_parents, breaking pulling from a ghost containing knit or pack repository to weaves, which improves correctness and allows simplification of core code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1221
1221
        """Store in knit with parents"""
1222
1222
        k = self.make_test_knit()
1223
1223
        self.add_stock_one_and_one_a(k)
1224
 
        self.assertEquals(k.get_parents('text-1'), [])
1225
 
        self.assertEquals(k.get_parents('text-1a'), ['text-1'])
 
1224
        self.assertEqual({'text-1':(), 'text-1a':('text-1',)},
 
1225
            k.get_parent_map(['text-1', 'text-1a']))
1226
1226
 
1227
1227
    def test_ancestry(self):
1228
1228
        """Store in knit with parents"""
1485
1485
        # and when reading it revid3 should now appear.
1486
1486
        knit = KnitVersionedFile('test', get_transport('.'), access_mode='r')
1487
1487
        self.assertEqual(['revid', 'revid2', 'revid3'], knit.versions())
1488
 
        self.assertEqual(['revid2'], knit.get_parents('revid3'))
 
1488
        self.assertEqual({'revid3':('revid2',)}, knit.get_parent_map(['revid3']))
1489
1489
 
1490
1490
    def test_delay_create(self):
1491
1491
        """Test that passing delay_create=True creates files late"""
2385
2385
        self.assertEqual(['fulltext', 'no-eol'], index.get_options('tip'))
2386
2386
        self.assertEqual(['fulltext'], index.get_options('parent'))
2387
2387
 
2388
 
    def test_get_parents(self):
2389
 
        # get_parents ignores ghosts
2390
 
        index = self.two_graph_index()
2391
 
        self.assertEqual(('tail', ), index.get_parents('parent'))
2392
 
        # and errors on ghosts.
2393
 
        self.assertRaises(errors.RevisionNotPresent,
2394
 
            index.get_parents, 'ghost')
2395
 
 
2396
2388
    def test_get_parents_with_ghosts(self):
2397
2389
        index = self.two_graph_index()
2398
2390
        self.assertEqual(('tail', 'ghost'), index.get_parents_with_ghosts('parent'))
2660
2652
        self.assertEqual(['fulltext', 'no-eol'], index.get_options('tip'))
2661
2653
        self.assertEqual(['fulltext'], index.get_options('parent'))
2662
2654
 
2663
 
    def test_get_parents(self):
2664
 
        index = self.two_graph_index()
2665
 
        self.assertEqual((), index.get_parents('parent'))
2666
 
        # and errors on ghosts.
2667
 
        self.assertRaises(errors.RevisionNotPresent,
2668
 
            index.get_parents, 'ghost')
2669
 
 
2670
2655
    def test_get_parents_with_ghosts(self):
2671
2656
        index = self.two_graph_index()
2672
2657
        self.assertEqual((), index.get_parents_with_ghosts('parent'))