Show More
@@ -175,6 +175,8 b' class dirstate:' | |||
|
175 | 175 | self._changing_level = 0 |
|
176 | 176 | # the change currently underway |
|
177 | 177 | self._change_type = None |
|
178 | # number of open _running_status context | |
|
179 | self._running_status = 0 | |
|
178 | 180 | # True if the current dirstate changing operations have been |
|
179 | 181 | # invalidated (used to make sure all nested contexts have been exited) |
|
180 | 182 | self._invalidated_context = False |
@@ -233,7 +235,16 b' class dirstate:' | |||
|
233 | 235 | E1: elif lock was acquired → write the changes |
|
234 | 236 | E2: else → discard the changes |
|
235 | 237 | """ |
|
236 | yield | |
|
238 | self._running_status += 1 | |
|
239 | try: | |
|
240 | yield | |
|
241 | except Exception: | |
|
242 | self.invalidate() | |
|
243 | raise | |
|
244 | finally: | |
|
245 | self._running_status -= 1 | |
|
246 | if self._invalidated_context: | |
|
247 | self.invalidate() | |
|
237 | 248 | |
|
238 | 249 | @contextlib.contextmanager |
|
239 | 250 | @check_invalidated |
@@ -598,8 +609,10 b' class dirstate:' | |||
|
598 | 609 | delattr(self, a) |
|
599 | 610 | self._dirty = False |
|
600 | 611 | self._dirty_tracked_set = False |
|
601 | self._invalidated_context = ( | |
|
602 |
self._changing_level > 0 |
|
|
612 | self._invalidated_context = bool( | |
|
613 | self._changing_level > 0 | |
|
614 | or self._attached_to_a_transaction | |
|
615 | or self._running_status | |
|
603 | 616 | ) |
|
604 | 617 | self._origpl = None |
|
605 | 618 |
General Comments 0
You need to be logged in to leave comments.
Login now