# HG changeset patch # User Christian Ebert # Date 1276631933 -7200 # Node ID 3bf3212b13bc3572a53e636d7b3838f32f162f53 # Parent 36f51ccd65d3dc30d8cb4591c161bfa8080fbd58 Postpone manifest calculation in kwtemplater.overwrite We can check for file existence in the working directory (needed in case of recording) by simply using the given context and calculate the manifest only when there are in fact candidates for expansion/shrinking. diff -r 36f51ccd65d3 -r 3bf3212b13bc hgkw/keyword.py --- a/hgkw/keyword.py Thu Jun 10 11:33:01 2010 +0100 +++ b/hgkw/keyword.py Tue Jun 15 21:58:53 2010 +0200 @@ -191,12 +191,12 @@ def overwrite(self, ctx, candidates, iswctx, expand): '''Overwrites selected files expanding/shrinking keywords.''' - mf = ctx.manifest() if self.record: - candidates = [f for f in ctx.files() if f in mf] + candidates = [f for f in ctx.files() if f in ctx] candidates = [f for f in candidates if self.iskwfile(f, ctx.flags)] if candidates: self.restrict = True # do not expand when reading + mf = ctx.manifest() msg = (expand and _('overwriting %s expanding keywords\n') or _('overwriting %s shrinking keywords\n')) for f in candidates: