~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bundle.py

(vila) Fix bug #701212,
 don't set the tag dict of the master branch you are updating from. (John A
 Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2011 Canonical Ltd
 
1
# Copyright (C) 2005-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
28
28
    merge,
29
29
    osutils,
30
30
    revision as _mod_revision,
31
 
    symbol_versioning,
32
31
    tests,
33
32
    treebuilder,
34
33
    )
65
64
 
66
65
 
67
66
class MockTree(object):
68
 
 
69
67
    def __init__(self):
70
68
        from bzrlib.inventory import InventoryDirectory, ROOT_ID
71
69
        object.__init__(self)
76
74
 
77
75
    inventory = property(lambda x:x)
78
76
 
79
 
    def all_file_ids(self):
80
 
        return set(self.paths.keys())
 
77
    def __iter__(self):
 
78
        return self.paths.iterkeys()
81
79
 
82
80
    def __getitem__(self, file_id):
83
81
        if file_id == self.root.file_id:
144
142
        result.seek(0,0)
145
143
        return result
146
144
 
147
 
    def get_file_revision(self, file_id):
148
 
        return self.inventory[file_id].revision
149
 
 
150
145
    def contents_stats(self, file_id):
151
146
        if file_id not in self.contents:
152
147
            return None, None
494
489
                                 % (ancestor,))
495
490
 
496
491
                # Now check that the file contents are all correct
497
 
                for inventory_id in old.all_file_ids():
 
492
                for inventory_id in old:
498
493
                    try:
499
494
                        old_file = old.get_file(inventory_id)
500
495
                    except errors.NoSuchFile:
508
503
                old.unlock()
509
504
        if not _mod_revision.is_null(rev_id):
510
505
            rh = self.b1.revision_history()
511
 
            self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)),
512
 
                tree.branch.set_revision_history, rh[:rh.index(rev_id)+1])
 
506
            tree.branch.set_revision_history(rh[:rh.index(rev_id)+1])
513
507
            tree.update()
514
508
            delta = tree.changes_from(self.b1.repository.revision_tree(rev_id))
515
509
            self.assertFalse(delta.has_changed(),
1415
1409
        branch = tree_a.branch
1416
1410
        repo_a = branch.repository
1417
1411
        tree_a.commit("base", allow_pointless=True, rev_id='A')
1418
 
        self.assertFalse(branch.repository.has_signature_for_revision_id('A'))
 
1412
        self.failIf(branch.repository.has_signature_for_revision_id('A'))
1419
1413
        try:
1420
1414
            from bzrlib.testament import Testament
1421
1415
            # monkey patch gpg signing mechanism
1445
1439
        install_bundle(repo_b, serializer.read(s))
1446
1440
 
1447
1441
 
 
1442
class V4WeaveBundleTester(V4BundleTester):
 
1443
 
 
1444
    def bzrdir_format(self):
 
1445
        return 'metaweave'
 
1446
 
 
1447
 
1448
1448
class V4_2aBundleTester(V4BundleTester):
1449
1449
 
1450
1450
    def bzrdir_format(self):