diff hgext/keyword.py @ 12844:a1b49b9a0328 stable

keyword: fix regressions introduced in d87f3ff904ba - dirstate of overwritten files must be forced to normal with kwexpand/kwshrink, not commit. - recorded files must be weeded before overwriting. - add test cases.
author Christian Ebert <blacktrash@gmx.net>
date Sun, 24 Oct 2010 15:11:41 +0100
parents 4bca87c29445
children 1fab4970354e 99210fb3bc0a
line wrap: on
line diff
--- a/hgext/keyword.py	Mon Oct 25 23:55:43 2010 +0200
+++ b/hgext/keyword.py	Sun Oct 24 15:11:41 2010 +0100
@@ -205,11 +205,11 @@
 
     def overwrite(self, ctx, candidates, lookup, expand, rekw=False):
         '''Overwrites selected files expanding/shrinking keywords.'''
-        if self.restrict or lookup: # exclude kw_copy
+        if self.restrict or lookup or self.record: # exclude kw_copy
             candidates = self.iskwfile(candidates, ctx)
         if not candidates:
             return
-        commit = self.restrict and not lookup
+        kwcmd = self.restrict and lookup # kwexpand/kwshrink
         if self.restrict or expand and lookup:
             mf = ctx.manifest()
         fctx = ctx
@@ -234,7 +234,7 @@
             if found:
                 self.ui.note(msg % f)
                 self.repo.wwrite(f, data, ctx.flags(f))
-                if commit:
+                if kwcmd:
                     self.repo.dirstate.normal(f)
                 elif self.record:
                     self.repo.dirstate.normallookup(f)