comparison mercurial/bundlerepo.py @ 47012:d55b71393907

node: replace nullid and friends with nodeconstants class The introduction of 256bit hashes require changes to nullid and other constant magic values. Start pushing them down from repository and revlog where sensible. Differential Revision: https://phab.mercurial-scm.org/D9465
author Joerg Sonnenberger <joerg@bec.de>
date Mon, 29 Mar 2021 01:52:06 +0200
parents ffd3e823a7e5
children 4c041c71ec01
comparison
equal deleted inserted replaced
46992:5fa019ceb499 47012:d55b71393907
17 import shutil 17 import shutil
18 18
19 from .i18n import _ 19 from .i18n import _
20 from .node import ( 20 from .node import (
21 hex, 21 hex,
22 nullid,
23 nullrev, 22 nullrev,
24 ) 23 )
25 24
26 from . import ( 25 from . import (
27 bundle2, 26 bundle2,
445 444
446 def getcwd(self): 445 def getcwd(self):
447 return encoding.getcwd() # always outside the repo 446 return encoding.getcwd() # always outside the repo
448 447
449 # Check if parents exist in localrepo before setting 448 # Check if parents exist in localrepo before setting
450 def setparents(self, p1, p2=nullid): 449 def setparents(self, p1, p2=None):
450 if p2 is None:
451 p2 = self.nullid
451 p1rev = self.changelog.rev(p1) 452 p1rev = self.changelog.rev(p1)
452 p2rev = self.changelog.rev(p2) 453 p2rev = self.changelog.rev(p2)
453 msg = _(b"setting parent to node %s that only exists in the bundle\n") 454 msg = _(b"setting parent to node %s that only exists in the bundle\n")
454 if self.changelog.repotiprev < p1rev: 455 if self.changelog.repotiprev < p1rev:
455 self.ui.warn(msg % hex(p1)) 456 self.ui.warn(msg % hex(p1))