hgkw/keyword.py
branchkwmap-templates
changeset 176 3aed363c9eaf
parent 175 f8e5cafa7b99
child 177 261a6844145e
--- a/hgkw/keyword.py	Fri Jul 13 12:56:09 2007 +0200
+++ b/hgkw/keyword.py	Fri Jul 13 12:57:59 2007 +0200
@@ -82,7 +82,7 @@
 from mercurial import cmdutil, context, filelog
 # findcmd might be in cmdutil or commands
 # depending on mercurial version
-if hasattr(cmdutil, "findcmd"):
+if hasattr(cmdutil, 'findcmd'):
     findcmd = cmdutil.findcmd
 else:
     findcmd = commands.findcmd
@@ -249,7 +249,7 @@
             else:
                 return filelog.filelog(self.sopener, f)
 
-        def commit(self, files=None, text="", user=None, date=None,
+        def commit(self, files=None, text='', user=None, date=None,
                    match=util.always, force=False, lock=None, wlock=None,
                    force_editor=False, p1=None, p2=None, extra={}):
             '''Wraps commit, expanding keywords of committed and
@@ -275,11 +275,10 @@
                 candidates = [f for f in candidates if kwfmatcher(f)
                               and f not in removed
                               and not os.path.islink(self.wjoin(f))]
-                if not candidates:
-                    return node
+                if candidates:
+                    kwt = kwtemplater(ui, self, node=node)
+                    kwt.overwrite(candidates)
 
-                kwt = kwtemplater(ui, self, node=node)
-                kwt.overwrite(candidates)
                 return node
             finally:
                 if wrelease: