# HG changeset patch # User Christian Ebert # Date 1247182381 -7200 # Node ID 0d75562ef3b0eca6da41446068000e1a4ef92dec # Parent 7f928c9d56d0d0d8a5318ee9a8c800ce4d625aa2# Parent c50f56b5f4b865c21f0b397869b4a4e79b8692cb (stable) merge diff -r 7f928c9d56d0 -r 0d75562ef3b0 hgkw/keyword.py --- a/hgkw/keyword.py Tue Jul 07 23:54:42 2009 +0200 +++ b/hgkw/keyword.py Fri Jul 10 01:33:01 2009 +0200 @@ -124,9 +124,8 @@ kwmaps = self.ui.configitems('keywordmaps') if kwmaps: # override default templates - kwmaps = [(k, templater.parsestring(v, False)) - for (k, v) in kwmaps] - self.templates = dict(kwmaps) + self.templates = dict((k, templater.parsestring(v, False)) + for k, v in kwmaps) escaped = map(re.escape, self.templates.keys()) kwpat = r'\$(%s)(: [^$\n\r]*? )??\$' % '|'.join(escaped) self.re_kw = re.compile(kwpat) @@ -457,13 +456,14 @@ data = super(kwrepo, self).wread(filename) return kwt.wread(filename, data) - def commit(self, text='', user=None, date=None, match=None, - force=False, editor=None, extra={}): + def commit(self, *args, **opts): # use custom commitctx for user commands # other extensions can still wrap repo.commitctx directly - repo.commitctx = self.kwcommitctx - return super(kwrepo, self).commit(text, user, date, match, force, - editor, extra) + self.commitctx = self.kwcommitctx + try: + return super(kwrepo, self).commit(*args, **opts) + finally: + del self.commitctx def kwcommitctx(self, ctx, error=False): wlock = lock = None @@ -487,7 +487,7 @@ if commithooks: for name, cmd in commithooks.iteritems(): ui.setconfig('hooks', name, cmd) - repo.hook('commit', node=n, parent1=xp1, parent2=xp2) + self.hook('commit', node=n, parent1=xp1, parent2=xp2) return n finally: release(lock, wlock)