diff -r 2b8c8b8d1a06 -r ead71b15efd5 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Sat May 26 03:01:14 2018 +0530 +++ b/mercurial/cmdutil.py Wed Jun 06 13:31:24 2018 -0400 @@ -3187,8 +3187,16 @@ if found. It's probably good to check this right before bailifchanged(). ''' + # Check for non-clearable states first, so things like rebase will take + # precedence over update. for f, clearable, allowcommit, msg, hint in unfinishedstates: - if commit and allowcommit: + if clearable or (commit and allowcommit): + continue + if repo.vfs.exists(f): + raise error.Abort(msg, hint=hint) + + for f, clearable, allowcommit, msg, hint in unfinishedstates: + if not clearable or (commit and allowcommit): continue if repo.vfs.exists(f): raise error.Abort(msg, hint=hint)