Show More
@@ -480,14 +480,7 b' def reposetup(ui, repo):' | |||
|
480 | 480 | # other extensions can still wrap repo.commitctx directly |
|
481 | 481 | self.commitctx = self.kwcommitctx |
|
482 | 482 | try: |
|
483 | self._kwcommithooks = {} | |
|
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 | |
|
483 | return super(kwrepo, self).commit(*args, **opts) | |
|
491 | 484 | finally: |
|
492 | 485 | del self.commitctx |
|
493 | 486 | |
@@ -496,18 +489,7 b' def reposetup(ui, repo):' | |||
|
496 | 489 | try: |
|
497 | 490 | wlock = self.wlock() |
|
498 | 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 | 492 | n = super(kwrepo, self).commitctx(ctx, error) |
|
510 | ||
|
511 | 493 | kwt.overwrite(n, True, None) |
|
512 | 494 | return n |
|
513 | 495 | finally: |
General Comments 0
You need to be logged in to leave comments.
Login now