blob: 94ceaa2b2fa290af240d7417c2be6b4a3d8b03d3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
Index: cvs2svn_lib/dumpfile_delegate.py
===================================================================
--- cvs2svn_lib/dumpfile_delegate.py (revision 4808)
+++ cvs2svn_lib/dumpfile_delegate.py (working copy)
@@ -16,9 +16,11 @@
"""This module contains database facilities used by cvs2svn."""
+try:
+ from hashlib import md5
+except ImportError:
+ from md5 import new as md5
-import md5
-
from cvs2svn_lib import config
from cvs2svn_lib.common import FatalError
from cvs2svn_lib.common import InternalError
@@ -320,7 +322,7 @@
self.dumpfile.write(prop_contents)
# Insert the rev contents, calculating length and checksum as we go.
- checksum = md5.new()
+ checksum = md5()
length = 0
if buf is None:
buf = stream.read(config.PIPE_READ_SIZE)
Index: cvs2svn_lib/metadata_database.py
===================================================================
--- cvs2svn_lib/metadata_database.py (revision 4808)
+++ cvs2svn_lib/metadata_database.py (working copy)
@@ -16,9 +16,11 @@
"""This module contains classes to manage CVSRevision metadata."""
+try:
+ from hashlib import sha1
+except ImportError:
+ from sha import new as sha1
-import sha
-
from cvs2svn_lib.context import Ctx
from cvs2svn_lib.database import IndexedDatabase
from cvs2svn_lib.key_generator import KeyGenerator
@@ -86,7 +88,7 @@
if not Ctx().cross_branch_commits:
key.append(branch_name or '')
- digest = sha.new('\0'.join(key)).digest()
+ digest = sha1('\0'.join(key)).digest()
try:
# See if it is already known:
return self._digest_to_id[digest]
|