hgkw/keyword.py
branch0.9.2compat
changeset 519 22a306a7b411
parent 486 a6f4e1367978
child 574 9353633b1611
equal deleted inserted replaced
489:f3514954d3c6 519:22a306a7b411
   515         if name.split('.', 1)[0].find('commit') > -1:
   515         if name.split('.', 1)[0].find('commit') > -1:
   516             repo.ui.setconfig('hooks', name, '')
   516             repo.ui.setconfig('hooks', name, '')
   517     ui.note(_('unhooked all commit hooks\n'))
   517     ui.note(_('unhooked all commit hooks\n'))
   518     ui.note('hg -R "%s" ci -m "%s"\n' % (tmpdir, msg))
   518     ui.note('hg -R "%s" ci -m "%s"\n' % (tmpdir, msg))
   519     repo.commit(text=msg)
   519     repo.commit(text=msg)
   520     format = ui.verbose and ' in %s' % path or ''
   520     fmt = ui.verbose and ' in %s' % path or ''
   521     demostatus('%s keywords expanded%s' % (kwstatus, format))
   521     demostatus('%s keywords expanded%s' % (kwstatus, fmt))
   522     ui.write(repo.wread(fn))
   522     ui.write(repo.wread(fn))
   523     ui.debug(_('\nremoving temporary repo %s\n') % tmpdir)
   523     ui.debug(_('\nremoving temporary repo %s\n') % tmpdir)
   524     shutil.rmtree(tmpdir, ignore_errors=True)
   524     shutil.rmtree(tmpdir, ignore_errors=True)
   525 
   525 
   526 def expand(ui, repo, *pats, **opts):
   526 def expand(ui, repo, *pats, **opts):
   567     cwd = pats and repo.getcwd() or ''
   567     cwd = pats and repo.getcwd() or ''
   568     kwfstats = not opts.get('ignore') and (('K', kwfiles),) or ()
   568     kwfstats = not opts.get('ignore') and (('K', kwfiles),) or ()
   569     if opts.get('all') or opts.get('ignore'):
   569     if opts.get('all') or opts.get('ignore'):
   570         kwfstats += (('I', [f for f in files if f not in kwfiles]),)
   570         kwfstats += (('I', [f for f in files if f not in kwfiles]),)
   571     for char, filenames in kwfstats:
   571     for char, filenames in kwfstats:
   572         format = (opts.get('all') or ui.verbose) and '%s %%s\n' % char or '%s\n'
   572         fmt = (opts.get('all') or ui.verbose) and '%s %%s\n' % char or '%s\n'
   573         for f in filenames:
   573         for f in filenames:
   574             ui.write(format % _pathto(repo, f, cwd))
   574             ui.write(fmt % _pathto(repo, f, cwd))
   575 
   575 
   576 def shrink(ui, repo, *pats, **opts):
   576 def shrink(ui, repo, *pats, **opts):
   577     '''revert expanded keywords in working directory
   577     '''revert expanded keywords in working directory
   578 
   578 
   579     Run before changing/disabling active keywords
   579     Run before changing/disabling active keywords