mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 23:38:50 +03:00
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
This commit is contained in:
parent
9861703d4b
commit
dba21309cf
@ -263,11 +263,13 @@ def _status(ui, repo, kwt, *pats, **opts):
|
||||
|
||||
def _kwfwrite(ui, repo, expand, *pats, **opts):
|
||||
'''Selects files and passes them to kwtemplater.overwrite.'''
|
||||
if repo.dirstate.parents()[1] != nullid:
|
||||
raise util.Abort(_('outstanding uncommitted merge'))
|
||||
kwt = kwtools['templater']
|
||||
status = _status(ui, repo, kwt, *pats, **opts)
|
||||
modified, added, removed, deleted, unknown, ignored, clean = status
|
||||
if modified or added or removed or deleted:
|
||||
raise util.Abort(_('outstanding uncommitted changes in given files'))
|
||||
raise util.Abort(_('outstanding uncommitted changes'))
|
||||
wlock = lock = None
|
||||
try:
|
||||
wlock = repo.wlock()
|
||||
|
@ -350,7 +350,7 @@ rolling back last transaction
|
||||
% kwexpand a
|
||||
overwriting a expanding keywords
|
||||
% kwexpand x/a should abort
|
||||
abort: outstanding uncommitted changes in given files
|
||||
abort: outstanding uncommitted changes
|
||||
x/a
|
||||
x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
|
||||
overwriting x/a expanding keywords
|
||||
|
Loading…
Reference in New Issue
Block a user