relnotes/next
author Martin von Zweigbergk <martinvonz@google.com>
Tue, 08 Dec 2020 16:45:13 -0800
changeset 46108 bdc2bf68f19e
parent 46107 aa4dbc14f735
child 46139 3ca5ca380a34
permissions -rw-r--r--
mergetools: add new conflict marker format with diffs in I use 3-way conflict markers. Often when I resolve them, I manually compare one the base with one side and apply the differences to the other side. That can be hard when the conflict marker is large. This patch introduces a new type of conflict marker, which I'm hoping will make it easier to resolve conflicts. The new format uses `<<<<<<<` and `>>>>>>>` to open and close the markers, just like our existing 2-way and 3-way conflict markers. Instead of having 2 or 3 snapshots (left+right or left+base+right), it has a sequence of diffs. A diff looks like this: ``` ------- base +++++++ left a -b +c d ``` A diff that adds one side ("diff from nothing") has a `=======` header instead and does not have have `+` prefixed on its lines. A regular 3-way merge can be viewed as adding one side plus a diff between the base and the other side. It thus has two ways of being represented, depending on which side is being diffed: ``` <<<<<<< ======= left contents on left ------- base +++++++ right contents on -left +right >>>>>>> ``` or ``` <<<<<<< ------- base +++++++ left contents on -right +left ======= right contents on right >>>>>>> ``` I've made it so the new merge tool tries to pick a version that has the most common lines (no difference in the example above). I've called the new tool "mergediff" to stick to the convention of starting with "merge" if the tool tries a regular 3-way merge. The idea came from my pet VCS (placeholder name `jj`), which has support for octopus merges and other ways of ending up with merges of more than 3 versions. I wanted to be able to represent such conflicts in the working copy and therefore thought of this format (although I have not yet implemented it in my VCS). I then attended a meeting with Larry McVoy, who said BitKeeper has an option (`bk smerge -g`) for showing a similar format, which reminded me to actually attempt this in Mercurial. Differential Revision: https://phab.mercurial-scm.org/D9551

== New Features ==

 * There is a new config section for templates used by hg commands. It
   is called `[command-templates]`. Some existing config options have
   been deprecated in favor of config options in the new
   section. These are: `ui.logtemplate` to `command-templates.log`,
   `ui.graphnodetemplate` to `command-templates.graphnode`,
   `ui.mergemarkertemplate` to `command-templates.mergemarker`,
   `ui.pre-merge-tool-output-template` to
   `command-templates.pre-merge-tool-output`.

 * There is a new set of config options for the template used for the
   one-line commit summary displayed by various commands, such as `hg
   rebase`. The main one is `command-templates.oneline-summary`. That
   can be overridden per command with
   `command-templates.oneline-summary.<command>`, where `<command>`
   can be e.g. `rebase`. As part of this effort, the default format
   from `hg rebase` was reorganized a bit.

 * `hg strip`, from the strip extension, is now a core command, `hg
   debugstrip`. The extension remains for compatibility.

 * `hg diff` now supports `--from <rev>` and `--to <rev>` arguments as
   clearer alternatives to `-r <revs>`. `-r <revs>` has been
   deprecated.

 * The memory footprint per changeset during pull/unbundle
   operations has been further reduced.

 * There is a new internal merge tool called `internal:mergediff` (can
   be set as the value for the `merge` config in the `[ui]`
   section). It resolves merges the same was as `internal:merge` and
   `internal:merge3`, but it shows conflicts differently. Instead of
   showing 2 or 3 snapshots of the conflicting pieces of code, it
   shows one snapshot and a diff. This may be useful when at least one
   side of the conflict is similar to the base.

== New Experimental Features ==

* `experimental.single-head-per-branch:public-changes-only` can be used
  restrict the single head check to public revision. This is useful for
  overlay repository that have both a publishing and non-publishing view
  of the same storage.


== Bug Fixes ==



== Backwards Compatibility Changes ==



== Internal API Changes ==