Show More
@@ -138,7 +138,7 b' def hashdiffopts(diffopts):' | |||
|
138 | 138 | (k, getattr(diffopts, k)) |
|
139 | 139 | for k in mdiff.diffopts.defaults |
|
140 | 140 | )) |
|
141 |
return hashlib.sha1(diffoptstr). |
|
|
141 | return node.hex(hashlib.sha1(diffoptstr).digest())[:6] | |
|
142 | 142 | |
|
143 | 143 | _defaultdiffopthash = hashdiffopts(mdiff.defaultopts) |
|
144 | 144 |
@@ -240,7 +240,7 b' def _lfconvert_addchangeset(rsrc, rdst, ' | |||
|
240 | 240 | # largefile was modified, update standins |
|
241 | 241 | m = hashlib.sha1('') |
|
242 | 242 | m.update(ctx[f].data()) |
|
243 |
hash = m. |
|
|
243 | hash = node.hex(m.digest()) | |
|
244 | 244 | if f not in lfiletohash or lfiletohash[f] != hash: |
|
245 | 245 | rdst.wwrite(f, ctx[f].data(), ctx[f].flags()) |
|
246 | 246 | executable = 'x' in ctx[f].flags() |
@@ -20,6 +20,7 b' from mercurial.i18n import _' | |||
|
20 | 20 | from mercurial import ( |
|
21 | 21 | encoding, |
|
22 | 22 | error, |
|
23 | node, | |
|
23 | 24 | pathutil, |
|
24 | 25 | pycompat, |
|
25 | 26 | url as urlmod, |
@@ -156,7 +157,7 b' class local(object):' | |||
|
156 | 157 | fp.write(chunk) |
|
157 | 158 | sha256.update(chunk) |
|
158 | 159 | |
|
159 |
realoid = sha256. |
|
|
160 | realoid = node.hex(sha256.digest()) | |
|
160 | 161 | if realoid != oid: |
|
161 | 162 | raise LfsCorruptionError(_('corrupt remote lfs object: %s') |
|
162 | 163 | % oid) |
@@ -206,7 +207,7 b' class local(object):' | |||
|
206 | 207 | # Don't abort if corruption is detected, because `hg verify` will |
|
207 | 208 | # give more useful info about the corruption- simply don't add the |
|
208 | 209 | # hardlink. |
|
209 |
if verify or hashlib.sha256(blob). |
|
|
210 | if verify or node.hex(hashlib.sha256(blob).digest()) == oid: | |
|
210 | 211 | self.ui.note(_('lfs: found %s in the usercache\n') % oid) |
|
211 | 212 | lfutil.link(self.cachevfs.join(oid), self.vfs.join(oid)) |
|
212 | 213 | else: |
@@ -230,7 +231,7 b' class local(object):' | |||
|
230 | 231 | for chunk in util.filechunkiter(fp, size=1048576): |
|
231 | 232 | sha256.update(chunk) |
|
232 | 233 | |
|
233 |
return oid == sha256. |
|
|
234 | return oid == node.hex(sha256.digest()) | |
|
234 | 235 | |
|
235 | 236 | def has(self, oid): |
|
236 | 237 | """Returns True if the local blobstore contains the requested blob, |
@@ -587,7 +588,7 b' def _deduplicate(pointers):' | |||
|
587 | 588 | return reduced.values() |
|
588 | 589 | |
|
589 | 590 | def _verify(oid, content): |
|
590 |
realoid = hashlib.sha256(content). |
|
|
591 | realoid = node.hex(hashlib.sha256(content).digest()) | |
|
591 | 592 | if realoid != oid: |
|
592 | 593 | raise LfsCorruptionError(_('detected corrupt lfs object: %s') % oid, |
|
593 | 594 | hint=_('run hg verify')) |
@@ -10,6 +10,7 b' import time' | |||
|
10 | 10 | |
|
11 | 11 | from mercurial.i18n import _ |
|
12 | 12 | from mercurial import ( |
|
13 | node as nodemod, | |
|
13 | 14 | policy, |
|
14 | 15 | pycompat, |
|
15 | 16 | util, |
@@ -412,7 +413,7 b' class mutablebasepack(versionmixin):' | |||
|
412 | 413 | return |
|
413 | 414 | |
|
414 | 415 | try: |
|
415 |
sha = self.sha. |
|
|
416 | sha = nodemod.hex(self.sha.digest()) | |
|
416 | 417 | self.packfp.close() |
|
417 | 418 | self.writeindex() |
|
418 | 419 |
General Comments 0
You need to be logged in to leave comments.
Login now