/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_transform.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-12-20 17:34:54 UTC
  • mfrom: (3123.5.19 hardlinks)
  • Revision ID: pqm@pqm.ubuntu.com-20071220173454-9nqwgm3k66f4bmj8
Enhance accelerator_tree tests (abentley)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1515
1515
        source.lock_read()
1516
1516
        self.addCleanup(source.unlock)
1517
1517
        target = self.make_branch_and_tree('target')
1518
 
        build_tree(source.basis_tree(), target, source)
 
1518
        revision_tree = source.basis_tree()
 
1519
        revision_tree.lock_read()
 
1520
        self.addCleanup(revision_tree.unlock)
 
1521
        build_tree(revision_tree, target, source)
1519
1522
        self.assertEqual(['file1-id'], calls)
 
1523
        target.lock_read()
 
1524
        self.addCleanup(target.unlock)
 
1525
        self.assertEqual([], list(target._iter_changes(revision_tree)))
1520
1526
 
1521
1527
    def test_build_tree_accelerator_tree_missing_file(self):
1522
1528
        source = self.make_branch_and_tree('source')
1527
1533
        os.unlink('source/file1')
1528
1534
        source.remove(['file2'])
1529
1535
        target = self.make_branch_and_tree('target')
1530
 
        build_tree(source.basis_tree(), target, source)
 
1536
        revision_tree = source.basis_tree()
 
1537
        revision_tree.lock_read()
 
1538
        self.addCleanup(revision_tree.unlock)
 
1539
        build_tree(revision_tree, target, source)
 
1540
        target.lock_read()
 
1541
        self.addCleanup(target.unlock)
 
1542
        self.assertEqual([], list(target._iter_changes(revision_tree)))
1531
1543
 
1532
1544
    def test_build_tree_accelerator_wrong_kind(self):
1533
1545
        source = self.make_branch_and_tree('source')
1548
1560
        source.lock_read()
1549
1561
        self.addCleanup(source.unlock)
1550
1562
        target = self.make_branch_and_tree('target')
1551
 
        build_tree(source.basis_tree(), target, source)
 
1563
        revision_tree = source.basis_tree()
 
1564
        revision_tree.lock_read()
 
1565
        self.addCleanup(revision_tree.unlock)
 
1566
        build_tree(revision_tree, target, source)
1552
1567
        self.assertEqual([], calls)
 
1568
        target.lock_read()
 
1569
        self.addCleanup(target.unlock)
 
1570
        self.assertEqual([], list(target._iter_changes(revision_tree)))
1553
1571
 
1554
1572
 
1555
1573
class MockTransform(object):