~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bundle.py

resolve conflicts against trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
    merge,
29
29
    osutils,
30
30
    revision as _mod_revision,
 
31
    symbol_versioning,
31
32
    tests,
32
33
    treebuilder,
33
34
    )
64
65
 
65
66
 
66
67
class MockTree(object):
 
68
 
67
69
    def __init__(self):
68
70
        from bzrlib.inventory import InventoryDirectory, ROOT_ID
69
71
        object.__init__(self)
74
76
 
75
77
    inventory = property(lambda x:x)
76
78
 
77
 
    def __iter__(self):
78
 
        return self.paths.iterkeys()
 
79
    def all_file_ids(self):
 
80
        return set(self.paths.keys())
79
81
 
80
82
    def __getitem__(self, file_id):
81
83
        if file_id == self.root.file_id:
142
144
        result.seek(0,0)
143
145
        return result
144
146
 
 
147
    def get_file_revision(self, file_id):
 
148
        return self.inventory[file_id].revision
 
149
 
145
150
    def contents_stats(self, file_id):
146
151
        if file_id not in self.contents:
147
152
            return None, None
489
494
                                 % (ancestor,))
490
495
 
491
496
                # Now check that the file contents are all correct
492
 
                for inventory_id in old:
 
497
                for inventory_id in old.all_file_ids():
493
498
                    try:
494
499
                        old_file = old.get_file(inventory_id)
495
500
                    except errors.NoSuchFile:
503
508
                old.unlock()
504
509
        if not _mod_revision.is_null(rev_id):
505
510
            rh = self.b1.revision_history()
506
 
            tree.branch.set_revision_history(rh[:rh.index(rev_id)+1])
 
511
            self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)),
 
512
                tree.branch.set_revision_history, rh[:rh.index(rev_id)+1])
507
513
            tree.update()
508
514
            delta = tree.changes_from(self.b1.repository.revision_tree(rev_id))
509
515
            self.assertFalse(delta.has_changed(),
1409
1415
        branch = tree_a.branch
1410
1416
        repo_a = branch.repository
1411
1417
        tree_a.commit("base", allow_pointless=True, rev_id='A')
1412
 
        self.failIf(branch.repository.has_signature_for_revision_id('A'))
 
1418
        self.assertFalse(branch.repository.has_signature_for_revision_id('A'))
1413
1419
        try:
1414
1420
            from bzrlib.testament import Testament
1415
1421
            # monkey patch gpg signing mechanism