mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 07:49:11 +03:00
repair: reliably obtain bytestr of node ids
This commit is contained in:
parent
fdaf985a63
commit
4f3dc48acb
@ -12,7 +12,10 @@ import errno
|
||||
import hashlib
|
||||
|
||||
from .i18n import _
|
||||
from .node import short
|
||||
from .node import (
|
||||
hex,
|
||||
short,
|
||||
)
|
||||
from . import (
|
||||
bundle2,
|
||||
changegroup,
|
||||
@ -35,8 +38,9 @@ def _bundle(repo, bases, heads, node, suffix, compress=True, obsolescence=True):
|
||||
# Include a hash of all the nodes in the filename for uniqueness
|
||||
allcommits = repo.set('%ln::%ln', bases, heads)
|
||||
allhashes = sorted(c.hex() for c in allcommits)
|
||||
totalhash = hashlib.sha1(''.join(allhashes)).hexdigest()
|
||||
name = "%s/%s-%s-%s.hg" % (backupdir, short(node), totalhash[:8], suffix)
|
||||
totalhash = hashlib.sha1(''.join(allhashes)).digest()
|
||||
name = "%s/%s-%s-%s.hg" % (backupdir, short(node),
|
||||
hex(totalhash[:4]), suffix)
|
||||
|
||||
cgversion = changegroup.safeversion(repo)
|
||||
comp = None
|
||||
|
Loading…
Reference in New Issue
Block a user