It is better to have a lagging nodemap than a nodemap pointing to node that does
not exists yet.
(strictly speaking, the order was already right, however we make it more
explicit).
durin42 |
hg-reviewers |
It is better to have a lagging nodemap than a nodemap pointing to node that does
not exists yet.
(strictly speaking, the order was already right, however we make it more
explicit).
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/revlogutils/nodemap.py (4 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | Alphare | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | marmoute | ||
Closed | marmoute |
"""Install whatever is needed transaction side to persist a nodemap on disk | """Install whatever is needed transaction side to persist a nodemap on disk | ||||
(only actually persist the nodemap if this is relevant for this revlog) | (only actually persist the nodemap if this is relevant for this revlog) | ||||
""" | """ | ||||
if revlog._inline: | if revlog._inline: | ||||
return # inlined revlog are too small for this to be relevant | return # inlined revlog are too small for this to be relevant | ||||
if revlog.nodemap_file is None: | if revlog.nodemap_file is None: | ||||
return # we do not use persistent_nodemap on this revlog | return # we do not use persistent_nodemap on this revlog | ||||
callback_id = b"revlog-persistent-nodemap-%s" % revlog.nodemap_file | |||||
# we need to happen after the changelog finalization, in that use "cl-" | |||||
callback_id = b"nm-revlog-persistent-nodemap-%s" % revlog.nodemap_file | |||||
if tr.hasfinalize(callback_id): | if tr.hasfinalize(callback_id): | ||||
return # no need to register again | return # no need to register again | ||||
tr.addpending( | tr.addpending( | ||||
callback_id, lambda tr: _persist_nodemap(tr, revlog, pending=True) | callback_id, lambda tr: _persist_nodemap(tr, revlog, pending=True) | ||||
) | ) | ||||
tr.addfinalize(callback_id, lambda tr: _persist_nodemap(tr, revlog)) | tr.addfinalize(callback_id, lambda tr: _persist_nodemap(tr, revlog)) | ||||