##// END OF EJS Templates
dirstate: detect potential fishy transaction patterns while changing...
marmoute -
r50973:605f0ccf default
parent child Browse files
Show More
@@ -176,6 +176,8 b' class dirstate:'
176 176 msg = "trying to use an invalidated dirstate before it has reset"
177 177 raise error.ProgrammingError(msg)
178 178
179 has_tr = repo.currenttransaction() is not None
180
179 181 # different type of change are mutually exclusive
180 182 if self._change_type is None:
181 183 assert self._changing_level == 0
@@ -194,6 +196,7 b' class dirstate:'
194 196 self.invalidate()
195 197 raise
196 198 finally:
199 tr = repo.currenttransaction()
197 200 if self._changing_level > 0:
198 201 if self._invalidated_context:
199 202 # make sure we invalidate anything an upper context might
@@ -216,8 +219,13 b' class dirstate:'
216 219 # Exception catching (and the associated `invalidate`
217 220 # calling) might have been called by a nested context
218 221 # instead of the top level one.
219 tr = repo.currenttransaction()
220 222 self.write(tr)
223 if has_tr != (tr is not None):
224 if has_tr:
225 m = "transaction vanished while changing dirstate"
226 else:
227 m = "transaction appeared while changing dirstate"
228 raise error.ProgrammingError(m)
221 229
222 230 @contextlib.contextmanager
223 231 def changing_parents(self, repo):
General Comments 0
You need to be logged in to leave comments. Login now