Mercurial > hg
comparison hgext/remotefilelog/basepack.py @ 40675:9fcf8084ada8
py3: use node.hex(m.digest()) instead of m.hexdigest()
hashlib.sha1.hexdigest() returns str on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D5287
author | Pulkit Goyal <pulkit@yandex-team.ru> |
---|---|
date | Mon, 19 Nov 2018 21:12:13 +0300 |
parents | aa588bf40a08 |
children | e0b485a76009 |
comparison
equal
deleted
inserted
replaced
40673:337a38995336 | 40675:9fcf8084ada8 |
---|---|
8 import struct | 8 import struct |
9 import time | 9 import time |
10 | 10 |
11 from mercurial.i18n import _ | 11 from mercurial.i18n import _ |
12 from mercurial import ( | 12 from mercurial import ( |
13 node as nodemod, | |
13 policy, | 14 policy, |
14 pycompat, | 15 pycompat, |
15 util, | 16 util, |
16 vfs as vfsmod, | 17 vfs as vfsmod, |
17 ) | 18 ) |
410 def close(self, ledger=None): | 411 def close(self, ledger=None): |
411 if self._closed: | 412 if self._closed: |
412 return | 413 return |
413 | 414 |
414 try: | 415 try: |
415 sha = self.sha.hexdigest() | 416 sha = nodemod.hex(self.sha.digest()) |
416 self.packfp.close() | 417 self.packfp.close() |
417 self.writeindex() | 418 self.writeindex() |
418 | 419 |
419 if len(self.entries) == 0: | 420 if len(self.entries) == 0: |
420 # Empty pack | 421 # Empty pack |