comparison hgext/evolve.py @ 1713:00612a019547

evolve: use hashlib to compute sha1 hashes The util alias for sha1 was dropped in c27dc3c3122 in favor of hashlib.
author Jeroen Vaelen <jeroen@fb.com>
date Wed, 15 Jun 2016 15:19:38 -0700
parents aec233d3cafd
children 2ad40d972a74
comparison
equal deleted inserted replaced
1712:a4de197218cf 1713:00612a019547
69 StringIO = io.StringIO 69 StringIO = io.StringIO
70 import re 70 import re
71 import collections 71 import collections
72 import socket 72 import socket
73 import errno 73 import errno
74 import hashlib
74 import struct 75 import struct
75 sha1re = re.compile(r'\b[0-9a-f]{6,40}\b') 76 sha1re = re.compile(r'\b[0-9a-f]{6,40}\b')
76 77
77 import mercurial 78 import mercurial
78 from mercurial import util 79 from mercurial import util
3857 markercache = {} 3858 markercache = {}
3858 repo.ui.progress(_("preparing locally"), 0, total=len(unfi)) 3859 repo.ui.progress(_("preparing locally"), 0, total=len(unfi))
3859 for i in unfi: 3860 for i in unfi:
3860 ctx = unfi[i] 3861 ctx = unfi[i]
3861 entry = 0 3862 entry = 0
3862 sha = util.sha1() 3863 sha = hashlib.sha1()
3863 # add data from p1 3864 # add data from p1
3864 for p in ctx.parents(): 3865 for p in ctx.parents():
3865 p = p.rev() 3866 p = p.rev()
3866 if p < 0: 3867 if p < 0:
3867 p = nullid 3868 p = nullid