Mercurial > hg
comparison hgext/keyword.py @ 8089:67efe5e3b0fb
keyword, i18n: avoid untranslated strings as message parameters
author | Wagner Bruna <wbruna@yahoo.com> |
---|---|
date | Mon, 20 Apr 2009 21:16:13 -0300 |
parents | 9c7ca86fc658 |
children | 6a6ce1df98d2 |
comparison
equal
deleted
inserted
replaced
8088:bdeb380a10de | 8089:67efe5e3b0fb |
---|---|
175 else: # kwexpand/kwshrink | 175 else: # kwexpand/kwshrink |
176 notify = self.ui.note | 176 notify = self.ui.note |
177 candidates = [f for f in files if self.iskwfile(f, ctx.flags)] | 177 candidates = [f for f in files if self.iskwfile(f, ctx.flags)] |
178 if candidates: | 178 if candidates: |
179 self.restrict = True # do not expand when reading | 179 self.restrict = True # do not expand when reading |
180 action = expand and 'expanding' or 'shrinking' | |
181 for f in candidates: | 180 for f in candidates: |
182 fp = self.repo.file(f) | 181 fp = self.repo.file(f) |
183 data = fp.read(mf[f]) | 182 data = fp.read(mf[f]) |
184 if util.binary(data): | 183 if util.binary(data): |
185 continue | 184 continue |
189 data, found = self.substitute(data, f, ctx, | 188 data, found = self.substitute(data, f, ctx, |
190 self.re_kw.subn) | 189 self.re_kw.subn) |
191 else: | 190 else: |
192 found = self.re_kw.search(data) | 191 found = self.re_kw.search(data) |
193 if found: | 192 if found: |
194 notify(_('overwriting %s %s keywords\n') % (f, action)) | 193 if expand: |
194 msg = _('overwriting %s expanding keywords\n') | |
195 else: | |
196 msg = _('overwriting %s shrinking keywords\n') | |
197 notify(msg % f) | |
195 self.repo.wwrite(f, data, mf.flags(f)) | 198 self.repo.wwrite(f, data, mf.flags(f)) |
196 self.repo.dirstate.normal(f) | 199 self.repo.dirstate.normal(f) |
197 self.restrict = False | 200 self.restrict = False |
198 | 201 |
199 def shrinktext(self, text): | 202 def shrinktext(self, text): |