Patchwork update: remove dead (?) code about non-linear updates

login
register
mail settings
Submitter via Mercurial-devel
Date Feb. 7, 2017, 9:29 p.m.
Message ID <0659349ff46b2d449ceb.1486502945@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/18341/
State Superseded
Headers show

Comments

via Mercurial-devel - Feb. 7, 2017, 9:29 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1486501890 28800
#      Tue Feb 07 13:11:30 2017 -0800
# Node ID 0659349ff46b2d449ceb02fe01b63053d8a43a13
# Parent  1f51b4658f21bbb797e922d155c1046eddccf91d
update: remove dead (?) code about non-linear updates

IIUC, the non-linear updates no longer happen by default since
6b1fc09c699a (update: change default destination to tipmost descendant
(issue4673) (BC), 2016-02-02), and it was only if they happened by
default that we used to error out, so there is no longer a need to
handle this case.
via Mercurial-devel - Feb. 9, 2017, 6:41 a.m.
On Tue, Feb 7, 2017 at 1:29 PM, Martin von Zweigbergk
<martinvonz@google.com> wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1486501890 28800
> #      Tue Feb 07 13:11:30 2017 -0800
> # Node ID 0659349ff46b2d449ceb02fe01b63053d8a43a13
> # Parent  1f51b4658f21bbb797e922d155c1046eddccf91d
> update: remove dead (?) code about non-linear updates

Please ignore this patch. I think I can do it in a clearer way.

Patch

diff -r 1f51b4658f21 -r 0659349ff46b mercurial/destutil.py
--- a/mercurial/destutil.py	Thu Feb 02 14:19:48 2017 +0100
+++ b/mercurial/destutil.py	Tue Feb 07 13:11:30 2017 -0800
@@ -37,10 +37,6 @@ 
                     hint = _("commit and merge, or update --clean to"
                              " discard changes")
                     raise error.UpdateAbort(msg, hint=hint)
-                elif not check:  # destination is not a descendant.
-                    msg = _("not a linear update")
-                    hint = _("merge or update --check to force update")
-                    raise error.UpdateAbort(msg, hint=hint)
 
 def _destupdateobs(repo, clean, check):
     """decide of an update destination from obsolescence markers"""
diff -r 1f51b4658f21 -r 0659349ff46b mercurial/merge.py
--- a/mercurial/merge.py	Thu Feb 02 14:19:48 2017 +0100
+++ b/mercurial/merge.py	Tue Feb 07 13:11:30 2017 -0800
@@ -1566,10 +1566,6 @@ 
                             hint = _("commit or update --clean to discard"
                                      " changes")
                         raise error.Abort(msg, hint=hint)
-                    else:  # node is none
-                        msg = _("not a linear update")
-                        hint = _("merge or update --check to force update")
-                        raise error.Abort(msg, hint=hint)
                 else:
                     # Allow jumping branches if clean and specific rev given
                     pas = [p1]