~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_knit.py

  • Committer: Vincent Ladeuil
  • Date: 2010-02-05 10:27:33 UTC
  • mto: (5008.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5009.
  • Revision ID: v.ladeuil+lp@free.fr-20100205102733-8wpjnqz6g4nvrbfu
All Conflict action method names start with 'action_' to avoid potential namespace collisions

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):