commit: weed out removed w/o recurring to os.path, weed out symlinks kwmap-templates
authorChristian Ebert <blacktrash@gmx.net>
Wed, 14 Feb 2007 02:44:25 +0100
branchkwmap-templates
changeset 142 aedce5bcc9eb
parent 141 edf9299112d1
child 143 3485b0ef99c4
commit: weed out removed w/o recurring to os.path, weed out symlinks
hgkw/keyword.py
--- a/hgkw/keyword.py	Tue Feb 13 18:03:12 2007 +0100
+++ b/hgkw/keyword.py	Wed Feb 14 02:44:25 2007 +0100
@@ -76,12 +76,12 @@
     from mercurial.i18n import gettext as _
     demandload(globals(), 'mercurial:cmdutil,templater,util')
     demandload(globals(), 'mercurial:context,filelog,revlog')
-    demandload(globals(), 'os.path re time')
+    demandload(globals(), 're time')
 except ImportError: # demandimport
     from mercurial.i18n import _
     from mercurial import cmdutil, templater, util
     from mercurial import context, filelog, revlog
-    import os.path, re, time
+    import re, time
 
 deftemplates = {
         'Revision': '{node|short}',
@@ -192,6 +192,8 @@
             '''Wraps commit, expanding keywords of committed and
             configured files in working directory.'''
 
+            removed = self.status()[2]
+
             node = super(kwrepo, self).commit(files=files,
                     text=text, user=user, date=date,
                     match=match, force=force, lock=lock, wlock=wlock,
@@ -200,8 +202,8 @@
                 return node
 
             candidates = self.changelog.read(node)[3]
-            candidates = [f for f in candidates
-                    if self.kwfmatcher(f) and os.path.isfile(self.wjoin(f))]
+            candidates = [f for f in candidates if f not in removed
+                    and not self._link(f) and self.kwfmatcher(f)]
             if not candidates:
                 return node