mercurial/revlog.py
branchstable
changeset 51634 3cf9e52f5e27
parent 51425 def497c75351
child 51635 1721d983dd6d
--- a/mercurial/revlog.py	Tue Jun 11 03:05:20 2024 +0200
+++ b/mercurial/revlog.py	Wed Jun 12 02:15:20 2024 +0200
@@ -2895,10 +2895,13 @@
                 maybe_self._inner.index_file = old_index_file_path
 
         tr.registertmp(new_index_file_path)
+        # we use 001 here to make this this happens after the finalisation of
+        # pending changelog write (using 000). Otherwise the two finalizer
+        # would step over each other and delete the changelog.i file.
         if self.target[1] is not None:
-            callback_id = b'000-revlog-split-%d-%s' % self.target
+            callback_id = b'001-revlog-split-%d-%s' % self.target
         else:
-            callback_id = b'000-revlog-split-%d' % self.target[0]
+            callback_id = b'001-revlog-split-%d' % self.target[0]
         tr.addfinalize(callback_id, finalize_callback)
         tr.addabort(callback_id, abort_callback)