/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_repository.py

Fix python2.6 deprecation warnings related to hashlib.

* bzrlib/osutils.py: 
Wrap md5 and sha imports to be compatible with python 2.4, 2.5 and
above.  Replace all sha.new() calls by sha() calls they are
reputedly faster (not profiled).

* bzrlib/weave.py: 
Update sha import, fix use.     

* bzrlib/transport/http/_urllib2_wrappers.py: 
Update md5 and sha imports, fix use.    

* bzrlib/tests/test_testament.py:
Update sha import, fix use.     

* bzrlib/tests/test_knit.py:
Update sha import, fix use.     

* bzrlib/tests/test_hashcache.py: 
Update sha import, fix use.     

* bzrlib/tests/per_repository/test_check_reconcile.py:
Update sha import, fix use.     

* bzrlib/tests/http_utils.py: 
Update md5 and sha imports, fix use.    

* bzrlib/testament.py: 
Update sha import, fix use.     

* bzrlib/repofmt/pack_repo.py: 
Update md5 import, fix use.     

* bzrlib/hashcache.py: 
Update sha import, fix use.     

* bzrlib/btree_index.py: 
Delete useless sha import.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
also see this file.
23
23
"""
24
24
 
25
 
import md5
26
25
from stat import S_ISDIR
27
26
from StringIO import StringIO
28
27
 
52
51
    bzrdir,
53
52
    errors,
54
53
    inventory,
 
54
    osutils,
55
55
    progress,
56
56
    repository,
57
57
    revision as _mod_revision,
974
974
            pack_transport)
975
975
        self.assertIsInstance(pack.revision_index, InMemoryGraphIndex)
976
976
        self.assertIsInstance(pack.inventory_index, InMemoryGraphIndex)
977
 
        self.assertIsInstance(pack._hash, type(md5.new()))
 
977
        self.assertIsInstance(pack._hash, type(osutils.md5()))
978
978
        self.assertTrue(pack.upload_transport is upload_transport)
979
979
        self.assertTrue(pack.index_transport is index_transport)
980
980
        self.assertTrue(pack.pack_transport is pack_transport)