--- a/hgkw/keyword.py Tue Jun 12 18:45:26 2007 +0200
+++ b/hgkw/keyword.py Fri Jun 15 08:56:26 2007 +0200
@@ -88,6 +88,12 @@
from mercurial.i18n import gettext as _
from mercurial import commands, fancyopts, templater, util
from mercurial import cmdutil, context, filelog
+# findcmd might be in cmdutil or commands
+# depending on mercurial version
+if hasattr(cmdutil, "findcmd"):
+ findcmd = cmdutil.findcmd
+else:
+ findcmd = commands.findcmd
import os, re, sys, time
deftemplates = {
@@ -113,10 +119,7 @@
raise commands.ParseError(None, inst)
if args:
cmd = args[0]
- if hasattr(cmdutil, "findcmd"):
- aliases, i = cmdutil.findcmd(ui, cmd)
- else:
- aliases, i = commands.findcmd(ui, cmd)
+ aliases, i = findcmd(ui, cmd)
return aliases[0]
class kwtemplater(object):