~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bundle.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-04-29 11:07:14 UTC
  • mfrom: (5813.1.1 realname-can-be-empty)
  • Revision ID: pqm@pqm.ubuntu.com-20110429110714-wr9f71ea9600lvb6
(jelmer) Allow realname to be empty in tests. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2005-2011 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
27
27
    inventory,
28
28
    merge,
29
29
    osutils,
30
 
    repository,
31
30
    revision as _mod_revision,
 
31
    symbol_versioning,
32
32
    tests,
33
33
    treebuilder,
34
34
    )
35
35
from bzrlib.bundle import read_mergeable_from_url
36
36
from bzrlib.bundle.apply_bundle import install_bundle, merge_bundle
37
37
from bzrlib.bundle.bundle_data import BundleTree
38
 
from bzrlib.bzrdir import BzrDir
39
38
from bzrlib.directory_service import directories
40
39
from bzrlib.bundle.serializer import write_bundle, read_bundle, v09, v4
41
40
from bzrlib.bundle.serializer.v08 import BundleSerializerV08
42
41
from bzrlib.bundle.serializer.v09 import BundleSerializerV09
43
42
from bzrlib.bundle.serializer.v4 import BundleSerializerV4
44
 
from bzrlib.branch import Branch
45
43
from bzrlib.repofmt import knitrepo
46
44
from bzrlib.tests import (
47
45
    test_read_bundle,
145
143
        result.seek(0,0)
146
144
        return result
147
145
 
 
146
    def get_file_revision(self, file_id):
 
147
        return self.inventory[file_id].revision
 
148
 
148
149
    def contents_stats(self, file_id):
149
150
        if file_id not in self.contents:
150
151
            return None, None
506
507
                old.unlock()
507
508
        if not _mod_revision.is_null(rev_id):
508
509
            rh = self.b1.revision_history()
509
 
            tree.branch.set_revision_history(rh[:rh.index(rev_id)+1])
 
510
            self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)),
 
511
                tree.branch.set_revision_history, rh[:rh.index(rev_id)+1])
510
512
            tree.update()
511
513
            delta = tree.changes_from(self.b1.repository.revision_tree(rev_id))
512
514
            self.assertFalse(delta.has_changed(),
1412
1414
        branch = tree_a.branch
1413
1415
        repo_a = branch.repository
1414
1416
        tree_a.commit("base", allow_pointless=True, rev_id='A')
1415
 
        self.failIf(branch.repository.has_signature_for_revision_id('A'))
 
1417
        self.assertFalse(branch.repository.has_signature_for_revision_id('A'))
1416
1418
        try:
1417
1419
            from bzrlib.testament import Testament
1418
1420
            # monkey patch gpg signing mechanism
1442
1444
        install_bundle(repo_b, serializer.read(s))
1443
1445
 
1444
1446
 
1445
 
class V4WeaveBundleTester(V4BundleTester):
1446
 
 
1447
 
    def bzrdir_format(self):
1448
 
        return 'metaweave'
1449
 
 
1450
 
 
1451
1447
class V4_2aBundleTester(V4BundleTester):
1452
1448
 
1453
1449
    def bzrdir_format(self):