mercurial/dirstate.py
changeset 50025 d50d45cd5a5f
parent 50024 0dc2fb4b4b11
child 50026 3550e4a88ccd
equal deleted inserted replaced
50024:0dc2fb4b4b11 50025:d50d45cd5a5f
   202                         #
   202                         #
   203                         # We don't have more straightforward code, because the
   203                         # We don't have more straightforward code, because the
   204                         # Exception catching (and the associated `invalidate`
   204                         # Exception catching (and the associated `invalidate`
   205                         # calling) might have been called by a nested context
   205                         # calling) might have been called by a nested context
   206                         # instead of the top level one.
   206                         # instead of the top level one.
   207                         self.write(repo.currenttransaction())
   207                         tr = repo.currenttransaction()
       
   208                         if tr is not None:
       
   209                             abort_cb = lambda tr: self.invalidate()
       
   210                             tr.addabort(b'dirstate', abort_cb)
       
   211                         self.write(tr)
   208 
   212 
   209     @contextlib.contextmanager
   213     @contextlib.contextmanager
   210     def changing_parents(self, repo):
   214     def changing_parents(self, repo):
   211         with self._changing(repo, CHANGE_TYPE_PARENTS) as c:
   215         with self._changing(repo, CHANGE_TYPE_PARENTS) as c:
   212             yield c
   216             yield c