Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/subrepo.py @ 20868:5db105f216c3 stable
i18n: fix "% inside _()" problems
Before this patch, "contrib/check-code.py" can't detect these
problems, because the regexp pattern to detect "% inside _()" doesn't
suppose the case that the format string and "%" aren't placed in the
same line.
This patch replaces "\s" in that regexp pattern with "[ \t\n]" to
detect "% inside _()" problems in such case.
"[\s\n]" can't be used in this purpose, because "\s" is automatically
replaced with "[ \t]" by "_preparepats()" and "\s" in "[]" causes
nested "[]" unexpectedly.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Tue, 01 Apr 2014 02:46:03 +0900 |
parents | e5641536e4d5 |
children | 9658a79968c6 |
comparison
equal
deleted
inserted
replaced
20867:539d9f839197 | 20868:5db105f216c3 |
---|---|
319 if os.path.basename(dirname).lower() != '.hg': | 319 if os.path.basename(dirname).lower() != '.hg': |
320 return | 320 return |
321 for f in names: | 321 for f in names: |
322 if f.lower() == 'hgrc': | 322 if f.lower() == 'hgrc': |
323 ui.warn( | 323 ui.warn( |
324 _("warning: removing potentially hostile .hg/hgrc in '%s'" | 324 _("warning: removing potentially hostile .hg/hgrc in '%s'") |
325 % path)) | 325 % path) |
326 os.unlink(os.path.join(dirname, f)) | 326 os.unlink(os.path.join(dirname, f)) |
327 os.walk(path, v, None) | 327 os.walk(path, v, None) |
328 | 328 |
329 def itersubrepos(ctx1, ctx2): | 329 def itersubrepos(ctx1, ctx2): |
330 """find subrepos in ctx1 or ctx2""" | 330 """find subrepos in ctx1 or ctx2""" |