Show More
@@ -327,11 +327,11 b' class revlog(object):' | |||
|
327 | 327 | |
|
328 | 328 | self._indexfile = indexfile |
|
329 | 329 | self._datafile = datafile |
|
330 | self.nodemap_file = None | |
|
330 | self._nodemap_file = None | |
|
331 | 331 | self.postfix = postfix |
|
332 | 332 | self.opener = opener |
|
333 | 333 | if persistentnodemap: |
|
334 | self.nodemap_file = nodemaputil.get_nodemap_file(self) | |
|
334 | self._nodemap_file = nodemaputil.get_nodemap_file(self) | |
|
335 | 335 | |
|
336 | 336 | assert target[0] in ALL_KINDS |
|
337 | 337 | assert len(target) == 2 |
@@ -536,14 +536,14 b' class revlog(object):' | |||
|
536 | 536 | self._storedeltachains = True |
|
537 | 537 | |
|
538 | 538 | devel_nodemap = ( |
|
539 | self.nodemap_file | |
|
539 | self._nodemap_file | |
|
540 | 540 | and force_nodemap |
|
541 | 541 | and parse_index_v1_nodemap is not None |
|
542 | 542 | ) |
|
543 | 543 | |
|
544 | 544 | use_rust_index = False |
|
545 | 545 | if rustrevlog is not None: |
|
546 | if self.nodemap_file is not None: | |
|
546 | if self._nodemap_file is not None: | |
|
547 | 547 | use_rust_index = True |
|
548 | 548 | else: |
|
549 | 549 | use_rust_index = self.opener.options.get(b'rust.index') |
@@ -562,7 +562,7 b' class revlog(object):' | |||
|
562 | 562 | index, _chunkcache = d |
|
563 | 563 | use_nodemap = ( |
|
564 | 564 | not self._inline |
|
565 | and self.nodemap_file is not None | |
|
565 | and self._nodemap_file is not None | |
|
566 | 566 | and util.safehasattr(index, 'update_nodemap_data') |
|
567 | 567 | ) |
|
568 | 568 | if use_nodemap: |
@@ -698,7 +698,7 b' class revlog(object):' | |||
|
698 | 698 | return True |
|
699 | 699 | |
|
700 | 700 | def update_caches(self, transaction): |
|
701 | if self.nodemap_file is not None: | |
|
701 | if self._nodemap_file is not None: | |
|
702 | 702 | if transaction is None: |
|
703 | 703 | nodemaputil.update_persistent_nodemap(self) |
|
704 | 704 | else: |
@@ -715,7 +715,7 b' class revlog(object):' | |||
|
715 | 715 | # end up having to refresh it here. |
|
716 | 716 | use_nodemap = ( |
|
717 | 717 | not self._inline |
|
718 | and self.nodemap_file is not None | |
|
718 | and self._nodemap_file is not None | |
|
719 | 719 | and util.safehasattr(self.index, 'update_nodemap_data') |
|
720 | 720 | ) |
|
721 | 721 | if use_nodemap: |
@@ -28,9 +28,9 b' class NodeMap(dict):' | |||
|
28 | 28 | |
|
29 | 29 | def persisted_data(revlog): |
|
30 | 30 | """read the nodemap for a revlog from disk""" |
|
31 | if revlog.nodemap_file is None: | |
|
31 | if revlog._nodemap_file is None: | |
|
32 | 32 | return None |
|
33 | pdata = revlog.opener.tryread(revlog.nodemap_file) | |
|
33 | pdata = revlog.opener.tryread(revlog._nodemap_file) | |
|
34 | 34 | if not pdata: |
|
35 | 35 | return None |
|
36 | 36 | offset = 0 |
@@ -77,11 +77,11 b' def setup_persistent_nodemap(tr, revlog)' | |||
|
77 | 77 | """ |
|
78 | 78 | if revlog._inline: |
|
79 | 79 | return # inlined revlog are too small for this to be relevant |
|
80 | if revlog.nodemap_file is None: | |
|
80 | if revlog._nodemap_file is None: | |
|
81 | 81 | return # we do not use persistent_nodemap on this revlog |
|
82 | 82 | |
|
83 | 83 | # we need to happen after the changelog finalization, in that use "cl-" |
|
84 | callback_id = b"nm-revlog-persistent-nodemap-%s" % revlog.nodemap_file | |
|
84 | callback_id = b"nm-revlog-persistent-nodemap-%s" % revlog._nodemap_file | |
|
85 | 85 | if tr.hasfinalize(callback_id): |
|
86 | 86 | return # no need to register again |
|
87 | 87 | tr.addpending( |
@@ -123,7 +123,7 b' def update_persistent_nodemap(revlog):' | |||
|
123 | 123 | """ |
|
124 | 124 | if revlog._inline: |
|
125 | 125 | return # inlined revlog are too small for this to be relevant |
|
126 | if revlog.nodemap_file is None: | |
|
126 | if revlog._nodemap_file is None: | |
|
127 | 127 | return # we do not use persistent_nodemap on this revlog |
|
128 | 128 | |
|
129 | 129 | notr = _NoTransaction() |
@@ -133,11 +133,11 b' def update_persistent_nodemap(revlog):' | |||
|
133 | 133 | |
|
134 | 134 | |
|
135 | 135 | def delete_nodemap(tr, repo, revlog): |
|
136 | """Delete nodemap data on disk for a given revlog""" | |
|
137 | if revlog.nodemap_file is None: | |
|
136 | """ Delete nodemap data on disk for a given revlog""" | |
|
137 | if revlog._nodemap_file is None: | |
|
138 | 138 | msg = "calling persist nodemap on a revlog without the feature enabled" |
|
139 | 139 | raise error.ProgrammingError(msg) |
|
140 | repo.svfs.unlink(revlog.nodemap_file) | |
|
140 | repo.svfs.unlink(revlog._nodemap_file) | |
|
141 | 141 | |
|
142 | 142 | |
|
143 | 143 | def persist_nodemap(tr, revlog, pending=False, force=False): |
@@ -146,9 +146,9 b' def persist_nodemap(tr, revlog, pending=' | |||
|
146 | 146 | raise error.ProgrammingError( |
|
147 | 147 | "cannot persist nodemap of a filtered changelog" |
|
148 | 148 | ) |
|
149 | if revlog.nodemap_file is None: | |
|
149 | if revlog._nodemap_file is None: | |
|
150 | 150 | if force: |
|
151 | revlog.nodemap_file = get_nodemap_file(revlog) | |
|
151 | revlog._nodemap_file = get_nodemap_file(revlog) | |
|
152 | 152 | else: |
|
153 | 153 | msg = "calling persist nodemap on a revlog without the feature enabled" |
|
154 | 154 | raise error.ProgrammingError(msg) |
@@ -225,7 +225,7 b' def persist_nodemap(tr, revlog, pending=' | |||
|
225 | 225 | target_docket.tip_node = revlog.node(target_docket.tip_rev) |
|
226 | 226 | # EXP-TODO: if this is a cache, this should use a cache vfs, not a |
|
227 | 227 | # store vfs |
|
228 | file_path = revlog.nodemap_file | |
|
228 | file_path = revlog._nodemap_file | |
|
229 | 229 | if pending: |
|
230 | 230 | file_path += b'.a' |
|
231 | 231 | tr.registertmp(file_path) |
@@ -248,7 +248,7 b' def persist_nodemap(tr, revlog, pending=' | |||
|
248 | 248 | for oldfile in olds: |
|
249 | 249 | realvfs.tryunlink(oldfile) |
|
250 | 250 | |
|
251 | callback_id = b"revlog-cleanup-nodemap-%s" % revlog.nodemap_file | |
|
251 | callback_id = b"revlog-cleanup-nodemap-%s" % revlog._nodemap_file | |
|
252 | 252 | tr.addpostclose(callback_id, cleanup) |
|
253 | 253 | |
|
254 | 254 |
General Comments 0
You need to be logged in to leave comments.
Login now