Show More
@@ -270,8 +270,35 b' def v2_censor(rl, tr, censornode, tombst' | |||||
270 | tombstone, |
|
270 | tombstone, | |
271 | ) |
|
271 | ) | |
272 |
|
272 | |||
273 |
|
|
273 | # Writing all subsequent revisions | |
274 | for rev in range(censor_rev + 1, len(old_index)): |
|
274 | for rev in range(censor_rev + 1, len(old_index)): | |
|
275 | _rewrite_simple( | |||
|
276 | rl, | |||
|
277 | old_index, | |||
|
278 | open_files, | |||
|
279 | rev, | |||
|
280 | rewritten_entries, | |||
|
281 | tmp_storage, | |||
|
282 | ) | |||
|
283 | docket.write(transaction=None, stripping=True) | |||
|
284 | ||||
|
285 | ||||
|
286 | def _rewrite_simple( | |||
|
287 | revlog, | |||
|
288 | old_index, | |||
|
289 | all_files, | |||
|
290 | rev, | |||
|
291 | rewritten_entries, | |||
|
292 | tmp_storage, | |||
|
293 | ): | |||
|
294 | """append a normal revision to the index after the rewritten one(s)""" | |||
|
295 | ( | |||
|
296 | old_data_file, | |||
|
297 | old_sidedata_file, | |||
|
298 | new_index_file, | |||
|
299 | new_data_file, | |||
|
300 | new_sidedata_file, | |||
|
301 | ) = all_files | |||
275 |
|
|
302 | entry = old_index[rev] | |
276 |
|
|
303 | flags = entry[ENTRY_DATA_OFFSET] & 0xFFFF | |
277 |
|
|
304 | old_data_offset = entry[ENTRY_DATA_OFFSET] >> 16 | |
@@ -327,15 +354,13 b' def v2_censor(rl, tr, censornode, tombst' | |||||
327 |
|
|
354 | data_compression_mode=d_comp_mode, | |
328 |
|
|
355 | sidedata_compression_mode=sd_com_mode, | |
329 | ) |
|
356 | ) | |
330 |
|
|
357 | revlog.index.append(new_entry) | |
331 |
|
|
358 | entry_bin = revlog.index.entry_binary(rev) | |
332 |
|
|
359 | new_index_file.write(entry_bin) | |
333 |
|
360 | |||
334 |
|
|
361 | revlog._docket.index_end = new_index_file.tell() | |
335 |
|
|
362 | revlog._docket.data_end = new_data_file.tell() | |
336 |
|
|
363 | revlog._docket.sidedata_end = new_sidedata_file.tell() | |
337 |
|
||||
338 | docket.write(transaction=None, stripping=True) |
|
|||
339 |
|
364 | |||
340 |
|
365 | |||
341 | def _rewrite_censor( |
|
366 | def _rewrite_censor( |
General Comments 0
You need to be logged in to leave comments.
Login now