comparison hgext/keyword.py @ 9102:bbc78cb1bf15

Merge with stable
author Matt Mackall <mpm@selenic.com>
date Thu, 09 Jul 2009 19:49:02 -0500
parents d8e8447a4b7b 47bc92755b95
children 7705d184faa1
comparison
equal deleted inserted replaced
9092:9aebeea7ac00 9102:bbc78cb1bf15
454 454
455 def wread(self, filename): 455 def wread(self, filename):
456 data = super(kwrepo, self).wread(filename) 456 data = super(kwrepo, self).wread(filename)
457 return kwt.wread(filename, data) 457 return kwt.wread(filename, data)
458 458
459 def commit(self, text='', user=None, date=None, match=None, 459 def commit(self, *args, **opts):
460 force=False, editor=None, extra={}):
461 # use custom commitctx for user commands 460 # use custom commitctx for user commands
462 # other extensions can still wrap repo.commitctx directly 461 # other extensions can still wrap repo.commitctx directly
463 repo.commitctx = self.kwcommitctx 462 self.commitctx = self.kwcommitctx
464 return super(kwrepo, self).commit(text, user, date, match, force, 463 try:
465 editor, extra) 464 return super(kwrepo, self).commit(*args, **opts)
465 finally:
466 del self.commitctx
466 467
467 def kwcommitctx(self, ctx, error=False): 468 def kwcommitctx(self, ctx, error=False):
468 wlock = lock = None 469 wlock = lock = None
469 try: 470 try:
470 wlock = self.wlock() 471 wlock = self.wlock()
484 485
485 kwt.overwrite(n, True, None) 486 kwt.overwrite(n, True, None)
486 if commithooks: 487 if commithooks:
487 for name, cmd in commithooks.iteritems(): 488 for name, cmd in commithooks.iteritems():
488 ui.setconfig('hooks', name, cmd) 489 ui.setconfig('hooks', name, cmd)
489 repo.hook('commit', node=n, parent1=xp1, parent2=xp2) 490 self.hook('commit', node=n, parent1=xp1, parent2=xp2)
490 return n 491 return n
491 finally: 492 finally:
492 release(lock, wlock) 493 release(lock, wlock)
493 494
494 # monkeypatches 495 # monkeypatches