# HG changeset patch # User Christian Ebert # Date 1166110050 -3600 # Node ID d6c0f391a6628bcb721e4c25a6ae95ff52458ef1 # Parent d9c4fc73596397cbdcf59b087fe215650bf81189 Short "f" for "filename" iteration variable diff -r d9c4fc735963 -r d6c0f391a662 hgkw/pretxnkw.py --- a/hgkw/pretxnkw.py Thu Dec 14 16:25:12 2006 +0100 +++ b/hgkw/pretxnkw.py Thu Dec 14 16:27:30 2006 +0100 @@ -34,20 +34,19 @@ re_kwcheck = re.compile(r'[$]Hg: (.*?),v.*?\$') - for filename in files: + for f in files: - data = repo.wfile(filename).read() + data = repo.wfile(f).read() # check for keywords with incorrect filename # eg. if you forgot to update filename manually after "hg mv" invalids = [m for m in map(str, re_kwcheck.findall(data)) - if m != filename] + if m != f] if invalids: invalids = ['%sHg: %s,v$' % ('$', i) for i in invalids] ui.warn(_('%d invalid keyword filenames in file %s:\n' '%s\nplease correct to %sHg: %s,v$\n' - % (len(invalids), filename, ', '.join(invalids), '$', filename) - )) + % (len(invalids), f, ', '.join(invalids), '$', f))) return True # substitute (Hg|Id): ,v.* @@ -55,9 +54,9 @@ if kwct: # backup file and write with expanded keyword - ui.note(_('expanding keywords in %s\n' % filename)) - absname = repo.wjoin(filename) + ui.note(_('expanding keywords in %s\n' % f)) + absname = repo.wjoin(f) util.copyfile(absname, absname+'~') - repo.wfile(filename, 'w').write(data) + repo.wfile(f, 'w').write(data) return False