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