hgkw/keyword.py
changeset 687 857f2f9bd67f
parent 685 6d26c4bafda3
child 688 13bb123ad894
equal deleted inserted replaced
685:6d26c4bafda3 687:857f2f9bd67f
   263     '''Selects files and passes them to kwtemplater.overwrite.'''
   263     '''Selects files and passes them to kwtemplater.overwrite.'''
   264     if repo.dirstate.parents()[1] != nullid:
   264     if repo.dirstate.parents()[1] != nullid:
   265         raise util.Abort(_('outstanding uncommitted merge'))
   265         raise util.Abort(_('outstanding uncommitted merge'))
   266     kwt = kwtools['templater']
   266     kwt = kwtools['templater']
   267     status = _status(ui, repo, kwt, *pats, **opts)
   267     status = _status(ui, repo, kwt, *pats, **opts)
   268     modified, added, removed, deleted = status[:4]
   268     modified, added, removed, deleted, unknown, ignored, clean = status
   269     if modified or added or removed or deleted:
   269     if modified or added or removed or deleted:
   270         raise util.Abort(_('outstanding uncommitted changes'))
   270         raise util.Abort(_('outstanding uncommitted changes'))
   271     wlock = lock = None
   271     wlock = lock = None
   272     try:
   272     try:
   273         wlock = repo.wlock()
   273         wlock = repo.wlock()
   274         lock = repo.lock()
   274         lock = repo.lock()
   275         kwt.overwrite(None, expand, status[6])
   275         kwt.overwrite(None, expand, clean)
   276     finally:
   276     finally:
   277         release(lock, wlock)
   277         release(lock, wlock)
   278 
   278 
   279 def demo(ui, repo, *args, **opts):
   279 def demo(ui, repo, *args, **opts):
   280     '''print [keywordmaps] configuration and an expansion example
   280     '''print [keywordmaps] configuration and an expansion example