##// END OF EJS Templates
nodemap: update the index with the newly written data (when appropriate)...
marmoute -
r44812:6ecc34b3 default
parent child Browse files
Show More
@@ -100,6 +100,8 b' def _persist_nodemap(tr, revlog):'
100 100 with revlog.opener(datafile, b'r+') as fd:
101 101 fd.seek(target_docket.data_length)
102 102 fd.write(data)
103 fd.seek(0)
104 new_data = fd.read(target_docket.data_length + len(data))
103 105 target_docket.data_length += len(data)
104 106 target_docket.data_unused += data_changed_count
105 107
@@ -113,6 +115,7 b' def _persist_nodemap(tr, revlog):'
113 115 data = persistent_data(revlog.index)
114 116 # EXP-TODO: if this is a cache, this should use a cache vfs, not a
115 117 # store vfs
118 new_data = data
116 119 with revlog.opener(datafile, b'w') as fd:
117 120 fd.write(data)
118 121 target_docket.data_length = len(data)
@@ -122,6 +125,9 b' def _persist_nodemap(tr, revlog):'
122 125 with revlog.opener(revlog.nodemap_file, b'w', atomictemp=True) as fp:
123 126 fp.write(target_docket.serialize())
124 127 revlog._nodemap_docket = target_docket
128 if util.safehasattr(revlog.index, "update_nodemap_data"):
129 revlog.index.update_nodemap_data(target_docket, new_data)
130
125 131 # EXP-TODO: if the transaction abort, we should remove the new data and
126 132 # reinstall the old one.
127 133
General Comments 0
You need to be logged in to leave comments. Login now