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