diff mercurial/localrepo.py @ 23203:3872d563e01a

changelog: handle writepending in the transaction The 'delayupdate' method now takes a transaction object and registers its '_writepending' method for execution in 'transaction.writepending()'. The hook can then use 'transaction.writepending()' directly. At some point this will allow the addition of other file creation during writepending.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 17 Oct 2014 21:55:31 -0700
parents eb315418224c
children 2d54aa5397cd
line wrap: on
line diff
--- a/mercurial/localrepo.py	Fri Oct 17 21:19:54 2014 -0700
+++ b/mercurial/localrepo.py	Fri Oct 17 21:55:31 2014 -0700
@@ -1437,11 +1437,11 @@
                 files = []
 
             # update changelog
-            self.changelog.delayupdate()
+            self.changelog.delayupdate(tr)
             n = self.changelog.add(mn, files, ctx.description(),
                                    trp, p1.node(), p2.node(),
                                    user, ctx.date(), ctx.extra().copy())
-            p = lambda: self.changelog.writepending() and self.root or ""
+            p = lambda: tr.writepending() and self.root or ""
             xp1, xp2 = p1.hex(), p2 and p2.hex() or ''
             self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1,
                       parent2=xp2, pending=p)