~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bundle.py

Merge Tree.changes_from work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import sys
20
20
import tempfile
21
21
 
 
22
from bzrlib import inventory
22
23
from bzrlib.builtins import merge
23
24
from bzrlib.bzrdir import BzrDir
24
25
from bzrlib.bundle.apply_bundle import install_bundle, merge_bundle
26
27
from bzrlib.bundle.serializer import write_bundle, read_bundle
27
28
from bzrlib.branch import Branch
28
29
from bzrlib.diff import internal_diff
29
 
from bzrlib.delta import compare_trees
30
30
from bzrlib.errors import BzrError, TestamentMismatch, NotABundle, BadBundle
31
31
from bzrlib.merge import Merge3Merger
32
32
from bzrlib.osutils import has_symlinks, sha_file
290
290
    def test_iteration(self):
291
291
        """Ensure that iteration through ids works properly"""
292
292
        btree = self.make_tree_1()[0]
293
 
        self.assertEqual(self.sorted_ids(btree), ['a', 'b', 'c', 'd'])
 
293
        self.assertEqual(self.sorted_ids(btree),
 
294
            [inventory.ROOT_ID, 'a', 'b', 'c', 'd'])
294
295
        btree.note_deletion("grandparent/parent/file")
295
296
        btree.note_id("e", "grandparent/alt_parent/fool", kind="directory")
296
297
        btree.note_last_changed("grandparent/alt_parent/fool", 
297
298
                                "revisionidiguess")
298
 
        self.assertEqual(self.sorted_ids(btree), ['a', 'b', 'd', 'e'])
 
299
        self.assertEqual(self.sorted_ids(btree),
 
300
            [inventory.ROOT_ID, 'a', 'b', 'd', 'e'])
299
301
 
300
302
 
301
303
class BundleTester(TestCaseWithTransport):
400
402
            new = tree.branch.repository.revision_tree(ancestor)
401
403
 
402
404
            # Check that there aren't any inventory level changes
403
 
            delta = compare_trees(old, new)
 
405
            delta = new.changes_from(old)
404
406
            self.assertFalse(delta.has_changed(),
405
407
                             'Revision %s not copied correctly.'
406
408
                             % (ancestor,))
419
421
            rh = self.b1.revision_history()
420
422
            tree.branch.set_revision_history(rh[:rh.index(rev_id)+1])
421
423
            tree.update()
422
 
            delta = compare_trees(self.b1.repository.revision_tree(rev_id),
423
 
                                  tree)
 
424
            delta = tree.changes_from(self.b1.repository.revision_tree(rev_id))
424
425
            self.assertFalse(delta.has_changed(),
425
426
                             'Working tree has modifications')
426
427
        return tree