Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/merge.py @ 19800:4894e0d9462d
update: improve error message for dirty non-linear update with rev
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Mon, 23 Sep 2013 20:08:52 -0700 |
parents | ab3e42225dbc |
children | 41abe2e3e3b7 |
comparison
equal
deleted
inserted
replaced
19799:ab3e42225dbc | 19800:4894e0d9462d |
---|---|
664 y y * * | --- (5) --- | 664 y y * * | --- (5) --- |
665 | 665 |
666 x = can't happen | 666 x = can't happen |
667 * = don't-care | 667 * = don't-care |
668 1 = abort: not a linear update (merge or update --check to force update) | 668 1 = abort: not a linear update (merge or update --check to force update) |
669 2 = abort: crosses branches (use 'hg merge' to merge or | 669 2 = abort: uncommitted changes (commit and merge, or update --clean to |
670 use 'hg update -C' to discard changes) | 670 discard changes) |
671 3 = abort: uncommitted changes (commit or update --clean to discard changes) | 671 3 = abort: uncommitted changes (commit or update --clean to discard changes) |
672 4 = abort: uncommitted local changes | 672 4 = abort: uncommitted local changes |
673 5 = incompatible options (checked in commands.py) | 673 5 = incompatible options (checked in commands.py) |
674 | 674 |
675 Return the same tuple as applyupdates(). | 675 Return the same tuple as applyupdates(). |
726 # amount of call to obsolete.background. | 726 # amount of call to obsolete.background. |
727 foreground = obsolete.foreground(repo, [p1.node()]) | 727 foreground = obsolete.foreground(repo, [p1.node()]) |
728 # note: the <node> variable contains a random identifier | 728 # note: the <node> variable contains a random identifier |
729 if repo[node].node() in foreground: | 729 if repo[node].node() in foreground: |
730 pa = p1 # allow updating to successors | 730 pa = p1 # allow updating to successors |
731 elif dirty and onode is None: | |
732 msg = _("crosses branches (merge branches or use" | |
733 " --clean to discard changes)") | |
734 raise util.Abort(msg) | |
735 elif dirty: | 731 elif dirty: |
736 msg = _("uncommitted changes") | 732 msg = _("uncommitted changes") |
737 hint = _("commit or update --clean to discard changes") | 733 if onode is None: |
734 hint = _("commit and merge, or update --clean to" | |
735 " discard changes") | |
736 else: | |
737 hint = _("commit or update --clean to discard" | |
738 " changes") | |
738 raise util.Abort(msg, hint=hint) | 739 raise util.Abort(msg, hint=hint) |
739 else: # node is none | 740 else: # node is none |
740 msg = _("not a linear update") | 741 msg = _("not a linear update") |
741 hint = _("merge or update --check to force update") | 742 hint = _("merge or update --check to force update") |
742 raise util.Abort(msg, hint=hint) | 743 raise util.Abort(msg, hint=hint) |