hgkw/keyword.py
changeset 759 8cab71dc5725
parent 757 fdbfecffd95b
child 761 81d8da31c542
equal deleted inserted replaced
757:fdbfecffd95b 759:8cab71dc5725
    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 
   283         raise util.Abort(_('[keyword] patterns cannot match'))
   282         raise util.Abort(_('[keyword] patterns cannot match'))
   284     raise util.Abort(_('no [keyword] patterns configured'))
   283     raise util.Abort(_('no [keyword] patterns configured'))
   285 
   284 
   286 def _kwfwrite(ui, repo, expand, *pats, **opts):
   285 def _kwfwrite(ui, repo, expand, *pats, **opts):
   287     '''Selects files and passes them to kwtemplater.overwrite.'''
   286     '''Selects files and passes them to kwtemplater.overwrite.'''
   288     if repo.dirstate.parents()[1] != nullid:
   287     if len(repo[None].parents()) > 1:
   289         raise util.Abort(_('outstanding uncommitted merge'))
   288         raise util.Abort(_('outstanding uncommitted merge'))
   290     kwt = kwtools['templater']
   289     kwt = kwtools['templater']
   291     wlock = repo.wlock()
   290     wlock = repo.wlock()
   292     try:
   291     try:
   293         status = _status(ui, repo, kwt, *pats, **opts)
   292         status = _status(ui, repo, kwt, *pats, **opts)