Show More
@@ -189,7 +189,8 b' class kwtemplater(object):' | |||
|
189 | 189 | if found: |
|
190 | 190 | notify(msg % f) |
|
191 | 191 | self.repo.wwrite(f, data, mf.flags(f)) |
|
192 | self.repo.dirstate.normal(f) | |
|
192 | if node is None: | |
|
193 | self.repo.dirstate.normal(f) | |
|
193 | 194 | self.restrict = False |
|
194 | 195 | |
|
195 | 196 | def shrinktext(self, text): |
@@ -460,8 +461,14 b' def reposetup(ui, repo):' | |||
|
460 | 461 | |
|
461 | 462 | def commit(self, text='', user=None, date=None, match=None, |
|
462 | 463 | force=False, editor=None, extra={}): |
|
464 | # use custom commitctx for user commands | |
|
465 | # other extensions can still wrap repo.commitctx directly | |
|
466 | repo.commitctx = self.kwcommitctx | |
|
467 | return super(kwrepo, self).commit(text, user, date, match, force, | |
|
468 | editor, extra) | |
|
469 | ||
|
470 | def kwcommitctx(self, ctx, error=False): | |
|
463 | 471 | wlock = lock = None |
|
464 | _p1 = _p2 = None | |
|
465 | 472 | try: |
|
466 | 473 | wlock = self.wlock() |
|
467 | 474 | lock = self.lock() |
@@ -472,23 +479,17 b' def reposetup(ui, repo):' | |||
|
472 | 479 | commithooks[name] = cmd |
|
473 | 480 | ui.setconfig('hooks', name, None) |
|
474 | 481 | if commithooks: |
|
475 |
# store parents for commit hook |
|
|
476 |
|
|
|
477 |
|
|
|
478 | if _p2 == nullid: | |
|
479 | _p2 = '' | |
|
480 | else: | |
|
481 | _p2 = hex(_p2) | |
|
482 | # store parents for commit hooks | |
|
483 | p1, p2 = ctx.p1(), ctx.p2() | |
|
484 | xp1, xp2 = p1.hex(), p2 and p2.hex() or '' | |
|
485 | ||
|
486 | n = super(kwrepo, self).commitctx(ctx, error) | |
|
482 | 487 | |
|
483 | n = super(kwrepo, self).commit(text, user, date, match, force, | |
|
484 | editor, extra) | |
|
485 | ||
|
486 | # restore commit hooks | |
|
487 | for name, cmd in commithooks.iteritems(): | |
|
488 | ui.setconfig('hooks', name, cmd) | |
|
489 | if n is not None: | |
|
490 | kwt.overwrite(n, True, None) | |
|
491 | repo.hook('commit', node=n, parent1=_p1, parent2=_p2) | |
|
488 | kwt.overwrite(n, True, None) | |
|
489 | if commithooks: | |
|
490 | for name, cmd in commithooks.iteritems(): | |
|
491 | ui.setconfig('hooks', name, cmd) | |
|
492 | repo.hook('commit', node=n, parent1=xp1, parent2=xp2) | |
|
492 | 493 | return n |
|
493 | 494 | finally: |
|
494 | 495 | release(lock, wlock) |
General Comments 0
You need to be logged in to leave comments.
Login now