findcmd might be in cmdutil or commands, depending on hg version kwmap-templates
authorChristian Ebert <blacktrash@gmx.net>
Tue, 12 Jun 2007 18:45:26 +0200
branchkwmap-templates
changeset 162 017dbf710056
parent 161 aac10ec0a8cd
child 163 c18c0c80b6c2
findcmd might be in cmdutil or commands, depending on hg version
hgkw/keyword.py
--- a/hgkw/keyword.py	Fri Jun 08 16:05:44 2007 +0200
+++ b/hgkw/keyword.py	Tue Jun 12 18:45:26 2007 +0200
@@ -113,7 +113,10 @@
         raise commands.ParseError(None, inst)
     if args:
         cmd = args[0]
-        aliases, i = commands.findcmd(ui, cmd)
+        if hasattr(cmdutil, "findcmd"):
+            aliases, i = cmdutil.findcmd(ui, cmd)
+        else:
+            aliases, i = commands.findcmd(ui, cmd)
         return aliases[0]
 
 class kwtemplater(object):