mercurial/cmdutil.py
branchstable
changeset 38182 79c54e7c0c52
parent 37815 32a75a8a5b0f
child 38239 ead71b15efd5
--- a/mercurial/cmdutil.py	Sat Jun 02 13:25:45 2018 -0400
+++ b/mercurial/cmdutil.py	Sat Jun 02 13:44:44 2018 -0400
@@ -3208,8 +3208,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)