~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_knit.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-01-07 17:02:44 UTC
  • mfrom: (4934.1.14 2.1.0rc1-set-mtime)
  • Revision ID: pqm@pqm.ubuntu.com-20100107170244-3cgdapvuokgf8l42
(jam,
        gz) (bug #488724) Set the mtime of files touched in a TreeTransform.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007 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
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)
865
869
        from bzrlib._knit_load_data_py import _load_data_py
866
 
        self.overrideAttr(knit, '_load_data', _load_data_py)
 
870
        knit._load_data = _load_data_py
867
871
        allow_writes = lambda: 'w' in mode
868
872
        return _KndxIndex(transport, mapper, lambda:None, allow_writes, lambda:True)
869
873
 
1298
1302
 
1299
1303
    def get_knit_index(self, transport, name, mode):
1300
1304
        mapper = ConstantMapper(name)
 
1305
        orig = knit._load_data
 
1306
        def reset():
 
1307
            knit._load_data = orig
 
1308
        self.addCleanup(reset)
1301
1309
        from bzrlib._knit_load_data_pyx import _load_data_c
1302
 
        self.overrideAttr(knit, '_load_data', _load_data_c)
 
1310
        knit._load_data = _load_data_c
1303
1311
        allow_writes = lambda: mode == 'w'
1304
 
        return _KndxIndex(transport, mapper, lambda:None,
1305
 
                          allow_writes, lambda:True)
 
1312
        return _KndxIndex(transport, mapper, lambda:None, allow_writes, lambda:True)
1306
1313
 
1307
1314
 
1308
1315
class Test_KnitAnnotator(TestCaseWithMemoryTransport):