Mercurial > hg
comparison hgext/keyword.py @ 6672:6004eedb13f4
keyword: mimic cmdutil.bail_if_changed even more
At the check before overwriting with kwexpand, kwshrink:
- abort when in middle of merge
- give terser abort message
author | Christian Ebert <blacktrash@gmx.net> |
---|---|
date | Thu, 12 Jun 2008 02:27:06 +0200 |
parents | 01e95d4bc66c |
children | 336fda65759a |
comparison
equal
deleted
inserted
replaced
6671:938eddd76237 | 6672:6004eedb13f4 |
---|---|
261 raise util.Abort(_('[keyword] patterns cannot match')) | 261 raise util.Abort(_('[keyword] patterns cannot match')) |
262 raise util.Abort(_('no [keyword] patterns configured')) | 262 raise util.Abort(_('no [keyword] patterns configured')) |
263 | 263 |
264 def _kwfwrite(ui, repo, expand, *pats, **opts): | 264 def _kwfwrite(ui, repo, expand, *pats, **opts): |
265 '''Selects files and passes them to kwtemplater.overwrite.''' | 265 '''Selects files and passes them to kwtemplater.overwrite.''' |
266 if repo.dirstate.parents()[1] != nullid: | |
267 raise util.Abort(_('outstanding uncommitted merge')) | |
266 kwt = kwtools['templater'] | 268 kwt = kwtools['templater'] |
267 status = _status(ui, repo, kwt, *pats, **opts) | 269 status = _status(ui, repo, kwt, *pats, **opts) |
268 modified, added, removed, deleted, unknown, ignored, clean = status | 270 modified, added, removed, deleted, unknown, ignored, clean = status |
269 if modified or added or removed or deleted: | 271 if modified or added or removed or deleted: |
270 raise util.Abort(_('outstanding uncommitted changes in given files')) | 272 raise util.Abort(_('outstanding uncommitted changes')) |
271 wlock = lock = None | 273 wlock = lock = None |
272 try: | 274 try: |
273 wlock = repo.wlock() | 275 wlock = repo.wlock() |
274 lock = repo.lock() | 276 lock = repo.lock() |
275 kwt.overwrite(None, expand, clean) | 277 kwt.overwrite(None, expand, clean) |