Arguments to kwshrink/expand must be filtered thru canonpath
authorChristian Ebert <blacktrash@gmx.net>
Fri, 14 Sep 2007 22:34:47 +0100
changeset 240 fb234089cc4c
parent 239 a0b8165fcec9
child 241 e0a846f9f095
Arguments to kwshrink/expand must be filtered thru canonpath
hgkw/keyword.py
--- a/hgkw/keyword.py	Mon Sep 03 06:11:07 2007 +0200
+++ b/hgkw/keyword.py	Fri Sep 14 22:34:47 2007 +0100
@@ -83,7 +83,7 @@
 from mercurial import commands, cmdutil, context, fancyopts, filelog
 from mercurial import localrepo, templater, util, hg
 from mercurial.i18n import gettext as _
-import getopt, re, shutil, sys, tempfile, time
+import getopt, os, re, shutil, sys, tempfile, time
 
 # backwards compatibility hacks
 
@@ -334,6 +334,9 @@
             ui.warn(_('no files configured for keyword expansion\n'))
             return
         man = ctx.manifest()
+        if files:
+            cwd = os.getcwd()
+            files = [util.canonpath(repo.root, cwd, f) for f in files]
         files = _weedcandidates(man, kwfmatcher, files)
         if not files:
             ui.warn(_('files not configured for expansion or untracked\n'))