mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 23:07:18 +03:00
histedit: limit mentioning histedit-last-edit.txt
Before histedit-last-edit.txt would be mentioned for any failure. After, it should only be mentioned for failures relating to user input.
This commit is contained in:
parent
d96f3f0401
commit
81170df509
@ -902,11 +902,6 @@ def histedit(ui, repo, *freeargs, **opts):
|
||||
state.wlock = repo.wlock()
|
||||
state.lock = repo.lock()
|
||||
_histedit(ui, repo, state, *freeargs, **opts)
|
||||
except error.Abort:
|
||||
if repo.vfs.exists('histedit-last-edit.txt'):
|
||||
ui.warn(_('warning: histedit rules saved '
|
||||
'to: .hg/histedit-last-edit.txt\n'))
|
||||
raise
|
||||
finally:
|
||||
release(state.lock, state.wlock)
|
||||
|
||||
@ -987,7 +982,7 @@ def _histedit(ui, repo, state, *freeargs, **opts):
|
||||
actions = parserules(rules, state)
|
||||
ctxs = [repo[act.nodetoverify()] \
|
||||
for act in state.actions if act.nodetoverify()]
|
||||
verifyactions(actions, state, ctxs)
|
||||
warnverifyactions(ui, repo, actions, state, ctxs)
|
||||
state.actions = actions
|
||||
state.write()
|
||||
return
|
||||
@ -1070,7 +1065,7 @@ def _histedit(ui, repo, state, *freeargs, **opts):
|
||||
rules = f.read()
|
||||
f.close()
|
||||
actions = parserules(rules, state)
|
||||
verifyactions(actions, state, ctxs)
|
||||
warnverifyactions(ui, repo, actions, state, ctxs)
|
||||
|
||||
parentctxnode = repo[root].parents()[0].node()
|
||||
|
||||
@ -1222,6 +1217,15 @@ def parserules(rules, state):
|
||||
actions.append(action)
|
||||
return actions
|
||||
|
||||
def warnverifyactions(ui, repo, actions, state, ctxs):
|
||||
try:
|
||||
verifyactions(actions, state, ctxs)
|
||||
except error.Abort:
|
||||
if repo.vfs.exists('histedit-last-edit.txt'):
|
||||
ui.warn(_('warning: histedit rules saved '
|
||||
'to: .hg/histedit-last-edit.txt\n'))
|
||||
raise
|
||||
|
||||
def verifyactions(actions, state, ctxs):
|
||||
"""Verify that there exists exactly one action per given changeset and
|
||||
other constraints.
|
||||
|
Loading…
Reference in New Issue
Block a user