comparison mercurial/revlog.py @ 44526:64e2f603de9d

nodemap: make sure hooks have access to an up-to-date version We make sure hooks can read persistent nodemap data and that they access something up-to-date with the pending transaction. Differential Revision: https://phab.mercurial-scm.org/D8187
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 28 Feb 2020 00:29:18 +0100
parents 6c906eaedd0d
children affe0fb42250
comparison
equal deleted inserted replaced
44525:6c906eaedd0d 44526:64e2f603de9d
434 self.upperboundcomp = upperboundcomp 434 self.upperboundcomp = upperboundcomp
435 self.indexfile = indexfile 435 self.indexfile = indexfile
436 self.datafile = datafile or (indexfile[:-2] + b".d") 436 self.datafile = datafile or (indexfile[:-2] + b".d")
437 self.nodemap_file = None 437 self.nodemap_file = None
438 if persistentnodemap: 438 if persistentnodemap:
439 self.nodemap_file = indexfile[:-2] + b".n" 439 if indexfile.endswith(b'.a'):
440 pending_path = indexfile[:-4] + b".n.a"
441 if opener.exists(pending_path):
442 self.nodemap_file = pending_path
443 else:
444 self.nodemap_file = indexfile[:-4] + b".n"
445 else:
446 self.nodemap_file = indexfile[:-2] + b".n"
440 447
441 self.opener = opener 448 self.opener = opener
442 # When True, indexfile is opened with checkambig=True at writing, to 449 # When True, indexfile is opened with checkambig=True at writing, to
443 # avoid file stat ambiguity. 450 # avoid file stat ambiguity.
444 self._checkambig = checkambig 451 self._checkambig = checkambig