435 '''Selects files and passes them to kwtemplater.overwrite.''' |
435 '''Selects files and passes them to kwtemplater.overwrite.''' |
436 if repo.dirstate.parents()[1] != nullid: |
436 if repo.dirstate.parents()[1] != nullid: |
437 raise util.Abort(_('outstanding uncommitted merge')) |
437 raise util.Abort(_('outstanding uncommitted merge')) |
438 kwt = kwtools['templater'] |
438 kwt = kwtools['templater'] |
439 status = _status(ui, repo, kwt, False, *pats, **opts) |
439 status = _status(ui, repo, kwt, False, *pats, **opts) |
440 modified, added, removed, deleted = status[:4] |
440 modified, added, removed, deleted, unknown, ignored, clean = status |
441 if modified or added or removed or deleted: |
441 if modified or added or removed or deleted: |
442 raise util.Abort(_('outstanding uncommitted changes')) |
442 raise util.Abort(_('outstanding uncommitted changes')) |
443 wlock = lock = None |
443 wlock = lock = None |
444 try: |
444 try: |
445 wlock = repo.wlock() |
445 wlock = repo.wlock() |
446 lock = repo.lock() |
446 lock = repo.lock() |
447 kwt.overwrite(None, expand, status[6]) |
447 kwt.overwrite(None, expand, clean) |
448 finally: |
448 finally: |
449 del wlock, lock |
449 del wlock, lock |
450 |
450 |
451 |
451 |
452 def demo(ui, repo, *args, **opts): |
452 def demo(ui, repo, *args, **opts): |