Mercurial > public > mercurial-scm > hg
comparison mercurial/revlog.py @ 46469:835aafb2543f
revlog: refactor logic to compute nodemap file in separate function
I will like to use it one more place.
Differential Revision: https://phab.mercurial-scm.org/D9933
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 31 Jan 2021 23:38:31 +0530 |
parents | 711ba0f1057e |
children | 07984507d553 |
comparison
equal
deleted
inserted
replaced
46468:83f037acf71a | 46469:835aafb2543f |
---|---|
446 self.upperboundcomp = upperboundcomp | 446 self.upperboundcomp = upperboundcomp |
447 self.indexfile = indexfile | 447 self.indexfile = indexfile |
448 self.datafile = datafile or (indexfile[:-2] + b".d") | 448 self.datafile = datafile or (indexfile[:-2] + b".d") |
449 self.nodemap_file = None | 449 self.nodemap_file = None |
450 if persistentnodemap: | 450 if persistentnodemap: |
451 if indexfile.endswith(b'.a'): | 451 self.nodemap_file = nodemaputil.get_nodemap_file( |
452 pending_path = indexfile[:-4] + b".n.a" | 452 opener, self.indexfile |
453 if opener.exists(pending_path): | 453 ) |
454 self.nodemap_file = pending_path | |
455 else: | |
456 self.nodemap_file = indexfile[:-4] + b".n" | |
457 else: | |
458 self.nodemap_file = indexfile[:-2] + b".n" | |
459 | 454 |
460 self.opener = opener | 455 self.opener = opener |
461 # When True, indexfile is opened with checkambig=True at writing, to | 456 # When True, indexfile is opened with checkambig=True at writing, to |
462 # avoid file stat ambiguity. | 457 # avoid file stat ambiguity. |
463 self._checkambig = checkambig | 458 self._checkambig = checkambig |