changeset 8098:6a6ce1df98d2

keyword: set overwrite message only once, not for each file
author Christian Ebert <blacktrash@gmx.net>
date Tue, 21 Apr 2009 09:56:07 +0100
parents eea3c1a8fba8
children 233f11b544f5
files hgext/keyword.py
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/keyword.py	Tue Apr 21 11:19:10 2009 +0200
+++ b/hgext/keyword.py	Tue Apr 21 09:56:07 2009 +0100
@@ -177,6 +177,8 @@
         candidates = [f for f in files if self.iskwfile(f, ctx.flags)]
         if candidates:
             self.restrict = True # do not expand when reading
+            msg = (expand and _('overwriting %s expanding keywords\n')
+                   or _('overwriting %s shrinking keywords\n'))
             for f in candidates:
                 fp = self.repo.file(f)
                 data = fp.read(mf[f])
@@ -190,10 +192,6 @@
                 else:
                     found = self.re_kw.search(data)
                 if found:
-                    if expand:
-                        msg = _('overwriting %s expanding keywords\n')
-                    else:
-                        msg = _('overwriting %s shrinking keywords\n')
                     notify(msg % f)
                     self.repo.wwrite(f, data, mf.flags(f))
                     self.repo.dirstate.normal(f)