hgkw/keyword.py
changeset 457 5e2be38cb3dd
parent 456 47bbe7c2fa7d
child 460 d9aae4cd69be
equal deleted inserted replaced
456:47bbe7c2fa7d 457:5e2be38cb3dd
   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)