diff tests/test-topic.t @ 5601:3946ee4ee3ae

topic: add a `exp….topic.linear-merge` option to allow some oedipus If this option is set to `from-branch`, a user can call `hg merge some-topic` from a bare branch even if `some-topic` is a direct descendant of the current working copy parents. This was previously denied if the changesets was on the same branch, since the result would be an "oedipus merge". Some user have been requesting this, and this type of merge is one of Gitlab standard way of merging a "Merge Request". That new option will unlock issue `heptapod#200` and make this mode available for those who wants it.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 14 Oct 2020 15:48:37 +0200
parents 98e2613d797d
children 4ab2f602beb3 e5d91fd1f319 d0f73113fcc0
line wrap: on
line diff
--- a/tests/test-topic.t	Thu Oct 15 19:46:38 2020 +0200
+++ b/tests/test-topic.t	Wed Oct 14 15:48:37 2020 +0200
@@ -134,6 +134,36 @@
     [experimental]
     topic.server-gate-topic-changesets = yes
   
+  Explicitly merging in the target branch
+  =======================================
+  
+  By default, Mercurial will not let your merge a topic into its target branch
+  if that topic is already based on the head of that branch. In other word,
+  Mercurial will not let your create a merge that will eventually have two
+  parents in the same branches, one parent being the ancestors of the other
+  parent. This behavior can be lifted using the following config:
+  
+    [experimental]
+    topic.linear-merge = allow-from-bare-branch
+  
+  When this option is set to 'allow-from-bare-branch', it is possible to merge a
+  topic branch from a bare branch (commit an active topic (eg: public one))
+  regardless of the topology. The result would typically looks like that:
+  
+    @    summary: resulting merge commit
+    |\   branch:  my-branch
+    | |
+    | o  summary: some more change in a topic, the merge "target"
+    | |  branch:  my-branch
+    | |  topic:   my-topic
+    | |
+    | o  summary: some change in a topic
+    |/   branch:  my-branch
+    |    topic:   my-topic
+    |
+    o    summary: previous head of the branch, the merge "source"
+    |    branch:  my-branch
+  
   list of commands:
   
   Change organization: