changeset 11253:d50e943a2acf

keyword: retrieve added and modified files from commitctx
author Christian Ebert <blacktrash@gmx.net>
date Tue, 01 Jun 2010 03:45:10 +0200
parents 56f306238256
children 94b7b3a1ae1b
files hgext/keyword.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/keyword.py	Tue Jun 01 01:05:45 2010 +0200
+++ b/hgext/keyword.py	Tue Jun 01 03:45:10 2010 +0200
@@ -194,7 +194,7 @@
         '''Overwrites selected files expanding/shrinking keywords.'''
         ctx = self.repo[node]
         mf = ctx.manifest()
-        if node is not None:     # commit, record
+        if self.record:
             candidates = [f for f in ctx.files() if f in mf]
         candidates = [f for f in candidates if self.iskwfile(f, ctx.flags)]
         if candidates:
@@ -209,7 +209,7 @@
                 if util.binary(data):
                     continue
                 if expand:
-                    if node is None:
+                    if node is None: # kwexpand/kwshrink
                         ctx = self.repo.filectx(f, fileid=mf[f]).changectx()
                     data, found = self.substitute(data, f, ctx,
                                                   self.re_kw.subn)
@@ -499,7 +499,7 @@
             n = super(kwrepo, self).commitctx(ctx, error)
             # no lock needed, only called from repo.commit() which already locks
             if not kwt.record:
-                kwt.overwrite(n, True, None)
+                kwt.overwrite(n, True, sorted(ctx.added() + ctx.modified()))
             return n
 
     # monkeypatches