hgkw/keyword.py
branchstable
changeset 465 2f017ca736ce
parent 463 55f535bc13bc
child 466 ddb8a222249b
equal deleted inserted replaced
463:55f535bc13bc 465:2f017ca736ce
   263         raise util.Abort(_('[keyword] patterns cannot match'))
   263         raise util.Abort(_('[keyword] patterns cannot match'))
   264     raise util.Abort(_('no [keyword] patterns configured'))
   264     raise util.Abort(_('no [keyword] patterns configured'))
   265 
   265 
   266 def _kwfwrite(ui, repo, expand, *pats, **opts):
   266 def _kwfwrite(ui, repo, expand, *pats, **opts):
   267     '''Selects files and passes them to kwtemplater.overwrite.'''
   267     '''Selects files and passes them to kwtemplater.overwrite.'''
       
   268     if repo.dirstate.parents()[1] != nullid:
       
   269         raise util.Abort(_('outstanding uncommitted merge'))
   268     kwt = kwtools['templater']
   270     kwt = kwtools['templater']
   269     status = _status(ui, repo, kwt, *pats, **opts)
   271     status = _status(ui, repo, kwt, *pats, **opts)
   270     modified, added, removed, deleted, unknown, ignored, clean = status
   272     modified, added, removed, deleted, unknown, ignored, clean = status
   271     if modified or added or removed or deleted:
   273     if modified or added or removed or deleted:
   272         raise util.Abort(_('outstanding uncommitted changes in given files'))
   274         raise util.Abort(_('outstanding uncommitted changes'))
   273     wlock = lock = None
   275     wlock = lock = None
   274     try:
   276     try:
   275         wlock = repo.wlock()
   277         wlock = repo.wlock()
   276         lock = repo.lock()
   278         lock = repo.lock()
   277         kwt.overwrite(None, expand, clean)
   279         kwt.overwrite(None, expand, clean)