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