Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 8309:4ff63d699256
util: overwrite sha1 and _fastsha1
author | Simon Heimberg <simohe@besonet.ch> |
---|---|
date | Fri, 08 May 2009 09:59:15 +0200 |
parents | d2ad8c066676 |
children | b87a50b7125c |
comparison
equal
deleted
inserted
replaced
8308:1268b895f69b | 8309:4ff63d699256 |
---|---|
29 # Subsequent calls will go directly to the imported function. | 29 # Subsequent calls will go directly to the imported function. |
30 try: | 30 try: |
31 from hashlib import sha1 as _sha1 | 31 from hashlib import sha1 as _sha1 |
32 except ImportError: | 32 except ImportError: |
33 from sha import sha as _sha1 | 33 from sha import sha as _sha1 |
34 global _fastsha1 | 34 global _fastsha1, sha1 |
35 _fastsha1 = _sha1 | 35 _fastsha1 = sha1 = _sha1 |
36 return _sha1(s) | 36 return _sha1(s) |
37 | 37 |
38 import subprocess | 38 import subprocess |
39 closefds = os.name == 'posix' | 39 closefds = os.name == 'posix' |
40 def popen2(cmd, mode='t', bufsize=-1): | 40 def popen2(cmd, mode='t', bufsize=-1): |