comparison hgext/keyword.py @ 7417:d3f1d316b72b

keyword: do not shadow builtin format (detected by pychecker)
author Christian Ebert <blacktrash@gmx.net>
date Tue, 25 Nov 2008 16:30:40 +0100
parents 27d304c8cc03
children 5aca12729a0d
comparison
equal deleted inserted replaced
7415:6163ef936a00 7417:d3f1d316b72b
346 if name.split('.', 1)[0].find('commit') > -1: 346 if name.split('.', 1)[0].find('commit') > -1:
347 repo.ui.setconfig('hooks', name, '') 347 repo.ui.setconfig('hooks', name, '')
348 ui.note(_('unhooked all commit hooks\n')) 348 ui.note(_('unhooked all commit hooks\n'))
349 ui.note('hg -R "%s" ci -m "%s"\n' % (tmpdir, msg)) 349 ui.note('hg -R "%s" ci -m "%s"\n' % (tmpdir, msg))
350 repo.commit(text=msg) 350 repo.commit(text=msg)
351 format = ui.verbose and ' in %s' % path or '' 351 fmt = ui.verbose and ' in %s' % path or ''
352 demostatus('%s keywords expanded%s' % (kwstatus, format)) 352 demostatus('%s keywords expanded%s' % (kwstatus, fmt))
353 ui.write(repo.wread(fn)) 353 ui.write(repo.wread(fn))
354 ui.debug(_('\nremoving temporary repo %s\n') % tmpdir) 354 ui.debug(_('\nremoving temporary repo %s\n') % tmpdir)
355 shutil.rmtree(tmpdir, ignore_errors=True) 355 shutil.rmtree(tmpdir, ignore_errors=True)
356 356
357 def expand(ui, repo, *pats, **opts): 357 def expand(ui, repo, *pats, **opts):
380 cwd = pats and repo.getcwd() or '' 380 cwd = pats and repo.getcwd() or ''
381 kwfstats = not opts.get('ignore') and (('K', kwfiles),) or () 381 kwfstats = not opts.get('ignore') and (('K', kwfiles),) or ()
382 if opts.get('all') or opts.get('ignore'): 382 if opts.get('all') or opts.get('ignore'):
383 kwfstats += (('I', [f for f in files if f not in kwfiles]),) 383 kwfstats += (('I', [f for f in files if f not in kwfiles]),)
384 for char, filenames in kwfstats: 384 for char, filenames in kwfstats:
385 format = (opts.get('all') or ui.verbose) and '%s %%s\n' % char or '%s\n' 385 fmt = (opts.get('all') or ui.verbose) and '%s %%s\n' % char or '%s\n'
386 for f in filenames: 386 for f in filenames:
387 ui.write(format % repo.pathto(f, cwd)) 387 ui.write(fmt % repo.pathto(f, cwd))
388 388
389 def shrink(ui, repo, *pats, **opts): 389 def shrink(ui, repo, *pats, **opts):
390 '''revert expanded keywords in working directory 390 '''revert expanded keywords in working directory
391 391
392 Run before changing/disabling active keywords 392 Run before changing/disabling active keywords