hgext/keyword.py
changeset 11296 0054a328b98f
parent 11253 d50e943a2acf
child 11303 a1aad8333864
equal deleted inserted replaced
11295:07e425d63dbd 11296:0054a328b98f
    79 '''
    79 '''
    80 
    80 
    81 from mercurial import commands, cmdutil, dispatch, filelog, revlog, extensions
    81 from mercurial import commands, cmdutil, dispatch, filelog, revlog, extensions
    82 from mercurial import patch, localrepo, templater, templatefilters, util, match
    82 from mercurial import patch, localrepo, templater, templatefilters, util, match
    83 from mercurial.hgweb import webcommands
    83 from mercurial.hgweb import webcommands
    84 from mercurial.node import nullid
       
    85 from mercurial.i18n import _
    84 from mercurial.i18n import _
    86 import re, shutil, tempfile
    85 import re, shutil, tempfile
    87 
    86 
    88 commands.optionalrepo += ' kwdemo'
    87 commands.optionalrepo += ' kwdemo'
    89 
    88 
   285         raise util.Abort(_('[keyword] patterns cannot match'))
   284         raise util.Abort(_('[keyword] patterns cannot match'))
   286     raise util.Abort(_('no [keyword] patterns configured'))
   285     raise util.Abort(_('no [keyword] patterns configured'))
   287 
   286 
   288 def _kwfwrite(ui, repo, expand, *pats, **opts):
   287 def _kwfwrite(ui, repo, expand, *pats, **opts):
   289     '''Selects files and passes them to kwtemplater.overwrite.'''
   288     '''Selects files and passes them to kwtemplater.overwrite.'''
   290     if repo.dirstate.parents()[1] != nullid:
   289     if len(repo[None].parents()) > 1:
   291         raise util.Abort(_('outstanding uncommitted merge'))
   290         raise util.Abort(_('outstanding uncommitted merge'))
   292     kwt = kwtools['templater']
   291     kwt = kwtools['templater']
   293     wlock = repo.wlock()
   292     wlock = repo.wlock()
   294     try:
   293     try:
   295         status = _status(ui, repo, kwt, *pats, **opts)
   294         status = _status(ui, repo, kwt, *pats, **opts)