hgkw/keyword.py
changeset 309 a5f5bbf4a668
parent 308 2a20fa267041
child 310 574128f982a2
equal deleted inserted replaced
308:2a20fa267041 309:a5f5bbf4a668
   324         if name.split('.', 1)[0].find('commit') > -1:
   324         if name.split('.', 1)[0].find('commit') > -1:
   325             repo.ui.setconfig('hooks', name, '')
   325             repo.ui.setconfig('hooks', name, '')
   326     ui.note(_('unhooked all commit hooks\n'))
   326     ui.note(_('unhooked all commit hooks\n'))
   327     ui.note('hg -R "%s" ci -m "%s"\n' % (tmpdir, msg))
   327     ui.note('hg -R "%s" ci -m "%s"\n' % (tmpdir, msg))
   328     repo.commit(text=msg)
   328     repo.commit(text=msg)
   329     pathinfo = ('', ' in %s' % path)[ui.verbose]
   329     format = ui.verbose and ' in %s' % path or ''
   330     demostatus('%s keywords expanded%s' % (kwstatus, pathinfo))
   330     demostatus('%s keywords expanded%s' % (kwstatus, format))
   331     ui.write(repo.wread(fn))
   331     ui.write(repo.wread(fn))
   332     ui.debug(_('\nremoving temporary repo %s\n') % tmpdir)
   332     ui.debug(_('\nremoving temporary repo %s\n') % tmpdir)
   333     shutil.rmtree(tmpdir, ignore_errors=True)
   333     shutil.rmtree(tmpdir, ignore_errors=True)
   334 
   334 
   335 def expand(ui, repo, *pats, **opts):
   335 def expand(ui, repo, *pats, **opts):
   366     else:
   366     else:
   367         kwfstats = (('K', kwfiles),)
   367         kwfstats = (('K', kwfiles),)
   368     if allf or ignore:
   368     if allf or ignore:
   369         kwfstats += (('I', [f for f in files if f not in kwfiles]),)
   369         kwfstats += (('I', [f for f in files if f not in kwfiles]),)
   370     for char, filenames in kwfstats:
   370     for char, filenames in kwfstats:
   371         if allf or ui.verbose:
   371         format = (allf or ui.verbose) and '%s %%s\n' % char or '%s\n'
   372             format = '%s %%s\n' % char
       
   373         else:
       
   374             format = '%s\n'
       
   375         for f in filenames:
   372         for f in filenames:
   376             ui.write(format % repo.pathto(f, cwd))
   373             ui.write(format % repo.pathto(f, cwd))
   377 
   374 
   378 def shrink(ui, repo, *pats, **opts):
   375 def shrink(ui, repo, *pats, **opts):
   379     '''revert expanded keywords in working directory
   376     '''revert expanded keywords in working directory