~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_repository.py

  • Committer: Andrew Bennetts
  • Date: 2010-04-14 06:47:18 UTC
  • mto: This revision was merged to the branch mainline in revision 5155.
  • Revision ID: andrew.bennetts@canonical.com-20100414064718-130ptdug4opfjj6b
Link to Python bug in comment.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
"""
24
24
 
25
25
from stat import S_ISDIR
 
26
from StringIO import StringIO
26
27
import sys
27
28
 
28
29
import bzrlib
29
 
from bzrlib.errors import (NoSuchFile,
 
30
from bzrlib.errors import (NotBranchError,
 
31
                           NoSuchFile,
30
32
                           UnknownFormatError,
31
33
                           UnsupportedFormatError,
32
34
                           )
33
35
from bzrlib import (
34
 
    btree_index,
35
36
    graph,
36
37
    tests,
37
38
    )
 
39
from bzrlib.branchbuilder import BranchBuilder
38
40
from bzrlib.btree_index import BTreeBuilder, BTreeGraphIndex
39
 
from bzrlib.index import GraphIndex
 
41
from bzrlib.index import GraphIndex, InMemoryGraphIndex
40
42
from bzrlib.repository import RepositoryFormat
 
43
from bzrlib.smart import server
41
44
from bzrlib.tests import (
42
45
    TestCase,
43
46
    TestCaseWithTransport,
 
47
    TestSkipped,
 
48
    test_knit,
44
49
    )
45
50
from bzrlib.transport import (
 
51
    fakenfs,
46
52
    get_transport,
47
53
    )
48
54
from bzrlib import (
 
55
    bencode,
49
56
    bzrdir,
50
57
    errors,
51
58
    inventory,
52
59
    osutils,
 
60
    progress,
53
61
    repository,
54
62
    revision as _mod_revision,
 
63
    symbol_versioning,
55
64
    upgrade,
56
65
    versionedfile,
57
66
    workingtree,
682
691
 
683
692
class Test2a(tests.TestCaseWithMemoryTransport):
684
693
 
685
 
    def test_chk_bytes_uses_custom_btree_parser(self):
686
 
        mt = self.make_branch_and_memory_tree('test', format='2a')
687
 
        mt.lock_write()
688
 
        self.addCleanup(mt.unlock)
689
 
        mt.add([''], ['root-id'])
690
 
        mt.commit('first')
691
 
        index = mt.branch.repository.chk_bytes._index._graph_index._indices[0]
692
 
        self.assertEqual(btree_index._gcchk_factory, index._leaf_factory)
693
 
        # It should also work if we re-open the repo
694
 
        repo = mt.branch.repository.bzrdir.open_repository()
695
 
        repo.lock_read()
696
 
        self.addCleanup(repo.unlock)
697
 
        index = repo.chk_bytes._index._graph_index._indices[0]
698
 
        self.assertEqual(btree_index._gcchk_factory, index._leaf_factory)
699
 
 
700
694
    def test_fetch_combines_groups(self):
701
695
        builder = self.make_branch_builder('source', format='2a')
702
696
        builder.start_series()