##// END OF EJS Templates
keyword: do not postpone commit hooks...
Christian Ebert -
r10495:2c2d2f13 stable
parent child Browse files
Show More
@@ -480,14 +480,7 b' def reposetup(ui, repo):'
480 # other extensions can still wrap repo.commitctx directly
480 # other extensions can still wrap repo.commitctx directly
481 self.commitctx = self.kwcommitctx
481 self.commitctx = self.kwcommitctx
482 try:
482 try:
483 self._kwcommithooks = {}
483 return super(kwrepo, self).commit(*args, **opts)
484 n = super(kwrepo, self).commit(*args, **opts)
485 if self._kwcommithooks:
486 xp1, xp2 = self._kwxp1, self._kwxp2
487 for name, cmd in self._kwcommithooks.iteritems():
488 ui.setconfig('hooks', name, cmd)
489 self.hook('commit', node=n, parent1=xp1, parent2=xp2)
490 return n
491 finally:
484 finally:
492 del self.commitctx
485 del self.commitctx
493
486
@@ -496,18 +489,7 b' def reposetup(ui, repo):'
496 try:
489 try:
497 wlock = self.wlock()
490 wlock = self.wlock()
498 lock = self.lock()
491 lock = self.lock()
499 # store and postpone commit hooks
500 for name, cmd in ui.configitems('hooks'):
501 if name.split('.', 1)[0] == 'commit':
502 self._kwcommithooks[name] = cmd
503 ui.setconfig('hooks', name, None)
504 if self._kwcommithooks:
505 # store parents for commit hooks
506 p1, p2 = ctx.p1(), ctx.p2()
507 self._kwxp1, self._kwxp2 = p1.hex(), p2 and p2.hex() or ''
508
509 n = super(kwrepo, self).commitctx(ctx, error)
492 n = super(kwrepo, self).commitctx(ctx, error)
510
511 kwt.overwrite(n, True, None)
493 kwt.overwrite(n, True, None)
512 return n
494 return n
513 finally:
495 finally:
General Comments 0
You need to be logged in to leave comments. Login now