##// END OF EJS Templates
changelog: drop the side_write argument to revlog splitting...
marmoute -
r52210:5b3b6db4 default
parent child Browse files
Show More
@@ -387,9 +387,9 b' class changelog(revlog.revlog):'
387 387 tr.registertmp(new_index)
388 388 return any_pending
389 389
390 def _enforceinlinesize(self, tr, side_write=True):
390 def _enforceinlinesize(self, tr):
391 391 if not self.is_delaying:
392 revlog.revlog._enforceinlinesize(self, tr, side_write=side_write)
392 revlog.revlog._enforceinlinesize(self, tr)
393 393
394 394 def read(self, nodeorrev):
395 395 """Obtain data from a parsed changelog revision.
@@ -2827,7 +2827,7 b' class revlog:'
2827 2827 # manifest), no risk of collision.
2828 2828 return self.radix + b'.i.s'
2829 2829
2830 def _enforceinlinesize(self, tr, side_write=True):
2830 def _enforceinlinesize(self, tr):
2831 2831 """Check if the revlog is too big for inline and convert if so.
2832 2832
2833 2833 This should be called after revisions are added to the revlog. If the
@@ -2857,39 +2857,38 b' class revlog:'
2857 2857 tr.add(self._datafile, 0)
2858 2858
2859 2859 new_index_file_path = None
2860 if side_write:
2861 old_index_file_path = self._indexfile
2862 new_index_file_path = self._split_index_file
2863 opener = self.opener
2864 weak_self = weakref.ref(self)
2865
2866 # the "split" index replace the real index when the transaction is
2867 # finalized
2868 def finalize_callback(tr):
2869 opener.rename(
2870 new_index_file_path,
2871 old_index_file_path,
2872 checkambig=True,
2873 )
2874 maybe_self = weak_self()
2875 if maybe_self is not None:
2876 maybe_self._indexfile = old_index_file_path
2877 maybe_self._inner.index_file = maybe_self._indexfile
2878
2879 def abort_callback(tr):
2880 maybe_self = weak_self()
2881 if maybe_self is not None:
2882 maybe_self._indexfile = old_index_file_path
2883 maybe_self._inner.inline = True
2884 maybe_self._inner.index_file = old_index_file_path
2885
2886 tr.registertmp(new_index_file_path)
2887 if self.target[1] is not None:
2888 callback_id = b'000-revlog-split-%d-%s' % self.target
2889 else:
2890 callback_id = b'000-revlog-split-%d' % self.target[0]
2891 tr.addfinalize(callback_id, finalize_callback)
2892 tr.addabort(callback_id, abort_callback)
2860 old_index_file_path = self._indexfile
2861 new_index_file_path = self._split_index_file
2862 opener = self.opener
2863 weak_self = weakref.ref(self)
2864
2865 # the "split" index replace the real index when the transaction is
2866 # finalized
2867 def finalize_callback(tr):
2868 opener.rename(
2869 new_index_file_path,
2870 old_index_file_path,
2871 checkambig=True,
2872 )
2873 maybe_self = weak_self()
2874 if maybe_self is not None:
2875 maybe_self._indexfile = old_index_file_path
2876 maybe_self._inner.index_file = maybe_self._indexfile
2877
2878 def abort_callback(tr):
2879 maybe_self = weak_self()
2880 if maybe_self is not None:
2881 maybe_self._indexfile = old_index_file_path
2882 maybe_self._inner.inline = True
2883 maybe_self._inner.index_file = old_index_file_path
2884
2885 tr.registertmp(new_index_file_path)
2886 if self.target[1] is not None:
2887 callback_id = b'000-revlog-split-%d-%s' % self.target
2888 else:
2889 callback_id = b'000-revlog-split-%d' % self.target[0]
2890 tr.addfinalize(callback_id, finalize_callback)
2891 tr.addabort(callback_id, abort_callback)
2893 2892
2894 2893 self._format_flags &= ~FLAG_INLINE_DATA
2895 2894 self._inner.split_inline(
General Comments 0
You need to be logged in to leave comments. Login now