##// END OF EJS Templates
revlog: stop usage of `_indexfile` to computing nodemap path...
marmoute -
r47922:24be247a default
parent child Browse files
Show More
@@ -329,12 +329,10 b' class revlog(object):'
329 self._datafile = datafile
329 self._datafile = datafile
330 self.nodemap_file = None
330 self.nodemap_file = None
331 self.postfix = postfix
331 self.postfix = postfix
332 self.opener = opener
332 if persistentnodemap:
333 if persistentnodemap:
333 self.nodemap_file = nodemaputil.get_nodemap_file(
334 self.nodemap_file = nodemaputil.get_nodemap_file(self)
334 opener, self._indexfile
335
335 )
336
337 self.opener = opener
338 assert target[0] in ALL_KINDS
336 assert target[0] in ALL_KINDS
339 assert len(target) == 2
337 assert len(target) == 2
340 self.target = target
338 self.target = target
@@ -148,9 +148,7 b' def persist_nodemap(tr, revlog, pending='
148 )
148 )
149 if revlog.nodemap_file is None:
149 if revlog.nodemap_file is None:
150 if force:
150 if force:
151 revlog.nodemap_file = get_nodemap_file(
151 revlog.nodemap_file = get_nodemap_file(revlog)
152 revlog.opener, revlog._indexfile
153 )
154 else:
152 else:
155 msg = "calling persist nodemap on a revlog without the feature enabled"
153 msg = "calling persist nodemap on a revlog without the feature enabled"
156 raise error.ProgrammingError(msg)
154 raise error.ProgrammingError(msg)
@@ -653,12 +651,9 b' def _find_node(block, node):'
653 return entry
651 return entry
654
652
655
653
656 def get_nodemap_file(opener, indexfile):
654 def get_nodemap_file(revlog):
657 if indexfile.endswith(b'.a'):
655 if revlog.postfix == b'a':
658 pending_path = indexfile[:-4] + b".n.a"
656 pending_path = revlog.radix + b".n.a"
659 if opener.exists(pending_path):
657 if revlog.opener.exists(pending_path):
660 return pending_path
658 return pending_path
661 else:
659 return revlog.radix + b".n"
662 return indexfile[:-4] + b".n"
663 else:
664 return indexfile[:-2] + b".n"
General Comments 0
You need to be logged in to leave comments. Login now