Show More
@@ -176,6 +176,8 b' class dirstate:' | |||||
176 | msg = "trying to use an invalidated dirstate before it has reset" |
|
176 | msg = "trying to use an invalidated dirstate before it has reset" | |
177 | raise error.ProgrammingError(msg) |
|
177 | raise error.ProgrammingError(msg) | |
178 |
|
178 | |||
|
179 | has_tr = repo.currenttransaction() is not None | |||
|
180 | ||||
179 | # different type of change are mutually exclusive |
|
181 | # different type of change are mutually exclusive | |
180 | if self._change_type is None: |
|
182 | if self._change_type is None: | |
181 | assert self._changing_level == 0 |
|
183 | assert self._changing_level == 0 | |
@@ -194,6 +196,7 b' class dirstate:' | |||||
194 | self.invalidate() |
|
196 | self.invalidate() | |
195 | raise |
|
197 | raise | |
196 | finally: |
|
198 | finally: | |
|
199 | tr = repo.currenttransaction() | |||
197 | if self._changing_level > 0: |
|
200 | if self._changing_level > 0: | |
198 | if self._invalidated_context: |
|
201 | if self._invalidated_context: | |
199 | # make sure we invalidate anything an upper context might |
|
202 | # make sure we invalidate anything an upper context might | |
@@ -216,8 +219,13 b' class dirstate:' | |||||
216 | # Exception catching (and the associated `invalidate` |
|
219 | # Exception catching (and the associated `invalidate` | |
217 | # calling) might have been called by a nested context |
|
220 | # calling) might have been called by a nested context | |
218 | # instead of the top level one. |
|
221 | # instead of the top level one. | |
219 | tr = repo.currenttransaction() |
|
|||
220 | self.write(tr) |
|
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 | @contextlib.contextmanager |
|
230 | @contextlib.contextmanager | |
223 | def changing_parents(self, repo): |
|
231 | def changing_parents(self, repo): |
General Comments 0
You need to be logged in to leave comments.
Login now