##// END OF EJS Templates
dirstate: start tracking that we are within a `running_status` context
marmoute -
r51040:72ef6c48 default
parent child Browse files
Show More
@@ -175,6 +175,8 b' class dirstate:'
175 self._changing_level = 0
175 self._changing_level = 0
176 # the change currently underway
176 # the change currently underway
177 self._change_type = None
177 self._change_type = None
178 # number of open _running_status context
179 self._running_status = 0
178 # True if the current dirstate changing operations have been
180 # True if the current dirstate changing operations have been
179 # invalidated (used to make sure all nested contexts have been exited)
181 # invalidated (used to make sure all nested contexts have been exited)
180 self._invalidated_context = False
182 self._invalidated_context = False
@@ -233,7 +235,16 b' class dirstate:'
233 E1: elif lock was acquired → write the changes
235 E1: elif lock was acquired → write the changes
234 E2: else → discard the changes
236 E2: else → discard the changes
235 """
237 """
238 self._running_status += 1
239 try:
236 yield
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 @contextlib.contextmanager
249 @contextlib.contextmanager
239 @check_invalidated
250 @check_invalidated
@@ -598,8 +609,10 b' class dirstate:'
598 delattr(self, a)
609 delattr(self, a)
599 self._dirty = False
610 self._dirty = False
600 self._dirty_tracked_set = False
611 self._dirty_tracked_set = False
601 self._invalidated_context = (
612 self._invalidated_context = bool(
602 self._changing_level > 0 or self._attached_to_a_transaction
613 self._changing_level > 0
614 or self._attached_to_a_transaction
615 or self._running_status
603 )
616 )
604 self._origpl = None
617 self._origpl = None
605
618
General Comments 0
You need to be logged in to leave comments. Login now