mercurial/patch.py
changeset 29341 0d83ad967bf8
parent 29326 d48fc6f318a3
child 29422 40d53d4b5925
equal deleted inserted replaced
29340:ae92c3eee88e 29341:0d83ad967bf8
    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 = ''