diff mercurial/context.py @ 26748:5ba0a99ff27f

dirstate: make dirstate.write() callers pass transaction object to it Now, 'dirstate.write(tr)' delays writing in-memory changes out, if a transaction is running. This may cause treating this revision as "the first bad one" at bisecting in some cases using external hook process inside transaction scope, because some external hooks and editor process are still invoked without HG_PENDING and pending changes aren't visible to them. 'dirstate.write()' callers below in localrepo.py explicitly use 'None' as 'tr', because they can assume that no transaction is running: - just before starting transaction - at closing transaction, or - at unlocking wlock
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sat, 17 Oct 2015 01:15:34 +0900
parents a3fcc8e3136b
children bd19561b98d9
line wrap: on
line diff
--- a/mercurial/context.py	Sat Oct 17 01:15:34 2015 +0900
+++ b/mercurial/context.py	Sat Oct 17 01:15:34 2015 +0900
@@ -1324,7 +1324,7 @@
         # write changes out explicitly, because nesting wlock at
         # runtime may prevent 'wlock.release()' in 'repo.commit()'
         # from immediately doing so for subsequent changing files
-        self._repo.dirstate.write()
+        self._repo.dirstate.write(self._repo.currenttransaction())
 
 class workingctx(committablectx):
     """A workingctx object makes access to data related to
@@ -1530,7 +1530,7 @@
                     # write changes out explicitly, because nesting
                     # wlock at runtime may prevent 'wlock.release()'
                     # below from doing so for subsequent changing files
-                    self._repo.dirstate.write()
+                    self._repo.dirstate.write(self._repo.currenttransaction())
                 finally:
                     wlock.release()
             except error.LockError: