# HG changeset patch # User Christian Ebert # Date 1276614931 -7200 # Node ID 5ea28187707e2f96664fd3e1e71b3d1a251825a3 # Parent cf8a9154a362db3a8e6ab0afe37a5f27ba04ed87 keyword: 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 cf8a9154a362 -r 5ea28187707e hgext/keyword.py --- a/hgext/keyword.py Sun Jun 13 23:25:27 2010 +0200 +++ b/hgext/keyword.py Tue Jun 15 17:15:31 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: