##// END OF EJS Templates
dirstate: check that dirstate is clean at the initial context opening...
marmoute -
r51041:8ba5028d default
parent child Browse files
Show More
@@ -235,6 +235,19 b' class dirstate:'
235 235 E1: elif lock was acquired → write the changes
236 236 E2: else → discard the changes
237 237 """
238 is_changing = self.is_changing_any
239 has_tr = repo.currenttransaction is not None
240 nested = bool(self._running_status)
241
242 first_and_alone = not (is_changing or has_tr or nested)
243
244 # enforce no change happened outside of a proper context.
245 if first_and_alone and self._dirty:
246 has_tr = repo.currenttransaction() is not None
247 if not has_tr and self._changing_level == 0 and self._dirty:
248 msg = "entering a status context, but dirstate is already dirty"
249 raise error.ProgrammingError(msg)
250
238 251 self._running_status += 1
239 252 try:
240 253 yield
General Comments 0
You need to be logged in to leave comments. Login now