hgkw/keyword.py
branch0.9.2compat
changeset 574 9353633b1611
parent 519 22a306a7b411
child 575 fdb3a5bf2c5c
equal deleted inserted replaced
560:42502f8fc5b0 574:9353633b1611
   445 
   445 
   446 def demo(ui, repo, *args, **opts):
   446 def demo(ui, repo, *args, **opts):
   447     '''print [keywordmaps] configuration and an expansion example
   447     '''print [keywordmaps] configuration and an expansion example
   448 
   448 
   449     Show current, custom, or default keyword template maps
   449     Show current, custom, or default keyword template maps
   450     and their expansion.
   450     and their expansions.
   451 
   451 
   452     Extend current configuration by specifying maps as arguments
   452     Extend current configuration by specifying maps as arguments
   453     and optionally by reading from an additional hgrc file.
   453     and optionally by reading from an additional hgrc file.
   454 
   454 
   455     Override current keyword template maps with "default" option.
   455     Override current keyword template maps with "default" option.
   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):
   527     '''expand keywords in working directory
   527     '''expand keywords in the working directory
   528 
   528 
   529     Run after (re)enabling keyword expansion.
   529     Run after (re)enabling keyword expansion.
   530 
   530 
   531     kwexpand refuses to run if given files contain local changes.
   531     kwexpand refuses to run if given files contain local changes.
   532     '''
   532     '''
   572         fmt = (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(fmt % _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 the working directory
   578 
   578 
   579     Run before changing/disabling active keywords
   579     Run before changing/disabling active keywords
   580     or if you experience problems with "hg import" or "hg merge".
   580     or if you experience problems with "hg import" or "hg merge".
   581 
   581 
   582     kwshrink refuses to run if given files contain local changes.
   582     kwshrink refuses to run if given files contain local changes.