##// END OF EJS Templates
changelog: rely on transaction for finalization...
Pierre-Yves David -
r23205:2d54aa53 default
parent child Browse files
Show More
@@ -788,8 +788,6 b' def addchangegroup(repo, source, srctype'
788 # strip should not touch boundary at all
788 # strip should not touch boundary at all
789 phases.retractboundary(repo, tr, targetphase, added)
789 phases.retractboundary(repo, tr, targetphase, added)
790
790
791 # make changelog see real files again
792 cl.finalize(trp)
793
791
794 tr.close()
792 tr.close()
795
793
@@ -5,6 +5,7 b''
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 import weakref
8 from node import bin, hex, nullid
9 from node import bin, hex, nullid
9 from i18n import _
10 from i18n import _
10 import util, error, revlog, encoding
11 import util, error, revlog, encoding
@@ -239,8 +240,10 b' class changelog(revlog.revlog):'
239 self._delaybuf)
240 self._delaybuf)
240 self._delayed = True
241 self._delayed = True
241 tr.addpending('cl-%i' % id(self), self._writepending)
242 tr.addpending('cl-%i' % id(self), self._writepending)
243 trp = weakref.proxy(tr)
244 tr.addfinalize('cl-%i' % id(self), lambda: self._finalize(trp))
242
245
243 def finalize(self, tr):
246 def _finalize(self, tr):
244 "finalize index updates"
247 "finalize index updates"
245 self._delayed = False
248 self._delayed = False
246 self.opener = self._realopener
249 self.opener = self._realopener
@@ -1445,7 +1445,6 b' class localrepository(object):'
1445 xp1, xp2 = p1.hex(), p2 and p2.hex() or ''
1445 xp1, xp2 = p1.hex(), p2 and p2.hex() or ''
1446 self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1,
1446 self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1,
1447 parent2=xp2, pending=p)
1447 parent2=xp2, pending=p)
1448 self.changelog.finalize(trp)
1449 # set the new commit is proper phase
1448 # set the new commit is proper phase
1450 targetphase = subrepo.newcommitphase(self.ui, ctx)
1449 targetphase = subrepo.newcommitphase(self.ui, ctx)
1451 if targetphase:
1450 if targetphase:
General Comments 0
You need to be logged in to leave comments. Login now