equal
deleted
inserted
replaced
10 |
10 |
11 import collections |
11 import collections |
12 import copy |
12 import copy |
13 import email |
13 import email |
14 import errno |
14 import errno |
|
15 import hashlib |
15 import os |
16 import os |
16 import posixpath |
17 import posixpath |
17 import re |
18 import re |
18 import shutil |
19 import shutil |
19 import tempfile |
20 import tempfile |
2410 |
2411 |
2411 def gitindex(text): |
2412 def gitindex(text): |
2412 if not text: |
2413 if not text: |
2413 text = "" |
2414 text = "" |
2414 l = len(text) |
2415 l = len(text) |
2415 s = util.sha1('blob %d\0' % l) |
2416 s = hashlib.sha1('blob %d\0' % l) |
2416 s.update(text) |
2417 s.update(text) |
2417 return s.hexdigest() |
2418 return s.hexdigest() |
2418 |
2419 |
2419 if opts.noprefix: |
2420 if opts.noprefix: |
2420 aprefix = bprefix = '' |
2421 aprefix = bprefix = '' |