Mercurial > public > mercurial-scm > hg
diff hgext/histedit.py @ 28519:518a5030acba
histedit: have dropmissing abort on empty plan
We noticed that many users have the intuition of laving the editor empty when
they want to abort the operation. The fact that dropmissing allows user to
delete all edited commits is not intuitive even for users that asked for it.
Let's prevent people from this footgun.
author | Mateusz Kwapich <mitrandir@fb.com> |
---|---|
date | Sun, 13 Mar 2016 16:46:49 -0700 |
parents | 5490b04e6132 |
children | e2b9145e35d8 |
line wrap: on
line diff
--- a/hgext/histedit.py Mon Mar 14 12:52:35 2016 +0000 +++ b/hgext/histedit.py Sun Mar 13 16:46:49 2016 -0700 @@ -1379,6 +1379,10 @@ missing = sorted(expected - seen) # sort to stabilize output if state.repo.ui.configbool('histedit', 'dropmissing'): + if len(actions) == 0: + raise error.ParseError(_('no rules provided'), + hint=_('use strip extension to remove commits')) + drops = [drop(state, node.bin(n)) for n in missing] # put the in the beginning so they execute immediately and # don't show in the edit-plan in the future