~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_knit.py

  • Committer: Robert Collins
  • Date: 2010-04-08 04:34:03 UTC
  • mfrom: (5138 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5139.
  • Revision ID: robertc@robertcollins.net-20100408043403-56z0d07vdqrx7f3t
Update bugfix for 528114 to trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
862
862
 
863
863
    def get_knit_index(self, transport, name, mode):
864
864
        mapper = ConstantMapper(name)
865
 
        orig = knit._load_data
866
 
        def reset():
867
 
            knit._load_data = orig
868
 
        self.addCleanup(reset)
869
865
        from bzrlib._knit_load_data_py import _load_data_py
870
 
        knit._load_data = _load_data_py
 
866
        self.overrideAttr(knit, '_load_data', _load_data_py)
871
867
        allow_writes = lambda: 'w' in mode
872
868
        return _KndxIndex(transport, mapper, lambda:None, allow_writes, lambda:True)
873
869
 
1302
1298
 
1303
1299
    def get_knit_index(self, transport, name, mode):
1304
1300
        mapper = ConstantMapper(name)
1305
 
        orig = knit._load_data
1306
 
        def reset():
1307
 
            knit._load_data = orig
1308
 
        self.addCleanup(reset)
1309
1301
        from bzrlib._knit_load_data_pyx import _load_data_c
1310
 
        knit._load_data = _load_data_c
 
1302
        self.overrideAttr(knit, '_load_data', _load_data_c)
1311
1303
        allow_writes = lambda: mode == 'w'
1312
 
        return _KndxIndex(transport, mapper, lambda:None, allow_writes, lambda:True)
 
1304
        return _KndxIndex(transport, mapper, lambda:None,
 
1305
                          allow_writes, lambda:True)
1313
1306
 
1314
1307
 
1315
1308
class Test_KnitAnnotator(TestCaseWithMemoryTransport):