##// END OF EJS Templates
revlog-split: make sure the self._indexfile attribut is reset (issue6811)...
marmoute -
r51705:f952be90 6.4.2 stable
parent child Browse files
Show More
@@ -19,6 +19,7 b' import contextlib'
19 19 import io
20 20 import os
21 21 import struct
22 import weakref
22 23 import zlib
23 24
24 25 # import stuff from node for others to import from revlog
@@ -2057,6 +2058,7 b' class revlog:'
2057 2058 old_index_file_path = self._indexfile
2058 2059 new_index_file_path = self._indexfile + b'.s'
2059 2060 opener = self.opener
2061 weak_self = weakref.ref(self)
2060 2062
2061 2063 fncache = getattr(opener, 'fncache', None)
2062 2064 if fncache is not None:
@@ -2069,13 +2071,22 b' class revlog:'
2069 2071 old_index_file_path,
2070 2072 checkambig=True,
2071 2073 )
2074 maybe_self = weak_self()
2075 if maybe_self is not None:
2076 maybe_self._indexfile = old_index_file_path
2077
2078 def abort_callback(tr):
2079 maybe_self = weak_self()
2080 if maybe_self is not None:
2081 maybe_self._indexfile = old_index_file_path
2072 2082
2073 2083 tr.registertmp(new_index_file_path)
2074 2084 if self.target[1] is not None:
2075 finalize_id = b'000-revlog-split-%d-%s' % self.target
2085 callback_id = b'000-revlog-split-%d-%s' % self.target
2076 2086 else:
2077 finalize_id = b'000-revlog-split-%d' % self.target[0]
2078 tr.addfinalize(finalize_id, finalize_callback)
2087 callback_id = b'000-revlog-split-%d' % self.target[0]
2088 tr.addfinalize(callback_id, finalize_callback)
2089 tr.addabort(callback_id, abort_callback)
2079 2090
2080 2091 new_dfh = self._datafp(b'w+')
2081 2092 new_dfh.truncate(0) # drop any potentially existing data
@@ -733,9 +733,7 b' check the results'
733 733 $ cd revlog-split-in-the-bundle
734 734 $ f --size .hg/store/00manifest.*
735 735 .hg/store/00manifest.d: size=499037
736 .hg/store/00manifest.i: size=192 (missing-correct-output !)
737 .hg/store/00manifest.i: size=128 (known-bad-output !)
738 .hg/store/00manifest.i.s: size=64 (known-bad-output !)
736 .hg/store/00manifest.i: size=192
739 737 $ f --size .hg/store/data/_a.*
740 738 .hg/store/data/_a.d: size=588917
741 739 .hg/store/data/_a.i: size=192
@@ -743,15 +741,11 b' check the results'
743 741 manifest should work
744 742
745 743 $ hg files -r tip | wc -l
746 \s*10001 (re) (missing-correct-output !)
747 abort: 00manifest@4941afd6b8e298d932227572c5c303cbc14301bd: no node (known-bad-output !)
748 0 (known-bad-output !)
744 \s*10001 (re)
749 745
750 746 file content should work
751 747
752 748 $ hg cat -r tip A | wc -l
753 \s*100001 (re) (missing-correct-output !)
754 abort: 00manifest@4941afd6b8e298d932227572c5c303cbc14301bd: no node (known-bad-output !)
755 0 (known-bad-output !)
749 \s*100001 (re)
756 750
757 751
General Comments 0
You need to be logged in to leave comments. Login now