Mercurial > public > mercurial-scm > hg
diff mercurial/merge.py @ 19799:ab3e42225dbc
update: add error message for dirty non-linear update with no rev
Previously, the error message for a dirty non-linear update was the same (and
relatively unhelpful) whether or not a rev was specified. This patch and an
upcoming one will introduce separate, more helpful hints.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Mon, 23 Sep 2013 20:07:30 -0700 |
parents | 76df01e56e7f |
children | 4894e0d9462d |
line wrap: on
line diff
--- a/mercurial/merge.py Mon Sep 23 17:43:33 2013 -0700 +++ b/mercurial/merge.py Mon Sep 23 20:07:30 2013 -0700 @@ -656,19 +656,21 @@ -c -C dirty rev | linear same cross n n n n | ok (1) x n n n y | ok ok ok - n n y * | merge (2) (2) + n n y n | merge (2) (2) + n n y y | merge (3) (3) n y * * | --- discard --- - y n y * | --- (3) --- + y n y * | --- (4) --- y n n * | --- ok --- - y y * * | --- (4) --- + y y * * | --- (5) --- x = can't happen * = don't-care 1 = abort: not a linear update (merge or update --check to force update) 2 = abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes) - 3 = abort: uncommitted local changes - 4 = incompatible options (checked in commands.py) + 3 = abort: uncommitted changes (commit or update --clean to discard changes) + 4 = abort: uncommitted local changes + 5 = incompatible options (checked in commands.py) Return the same tuple as applyupdates(). """ @@ -726,10 +728,14 @@ # note: the <node> variable contains a random identifier if repo[node].node() in foreground: pa = p1 # allow updating to successors - elif dirty: + elif dirty and onode is None: msg = _("crosses branches (merge branches or use" " --clean to discard changes)") raise util.Abort(msg) + elif dirty: + msg = _("uncommitted changes") + hint = _("commit or update --clean to discard changes") + raise util.Abort(msg, hint=hint) else: # node is none msg = _("not a linear update") hint = _("merge or update --check to force update")