D12378: tests: demonstrate how conflict markers end up $local *and* $output

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Tue Mar 15 20:52:36 UTC 2022


martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  When a merge tool is configured to keep conflict markers, they are
  supposed to be written to `$local` if `$output` is not mentioned in
  the tool's `merge-tools.<tool>.args` config, and in `$output` if it is
  mentioned. However, I broke the latter case in D12190 <https://phab.mercurial-scm.org/D12190>.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12378

AFFECTED FILES
  tests/test-merge-tools.t

CHANGE DETAILS

diff --git a/tests/test-merge-tools.t b/tests/test-merge-tools.t
--- a/tests/test-merge-tools.t
+++ b/tests/test-merge-tools.t
@@ -1213,6 +1213,46 @@
   # hg resolve --list
   R f
 
+with premerge=keep and $output in tool args, $local does not have markers:
+
+  $ beforemerge
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  true.executable=cat
+  # hg update -C 1
+  $ hg merge -r 4 --config merge-tools.true.premerge=keep --config 'merge-tools.true.args=$base $local $other $output'
+  merging f
+  revision 0
+  space
+  <<<<<<< working copy: ef83787e2614 - test: revision 1 (known-bad-output !)
+  revision 1
+  space
+  ======= (known-bad-output !)
+  revision 4 (known-bad-output !)
+  >>>>>>> merge rev:    81448d39c9a0 - test: revision 4 (known-bad-output !)
+  revision 4
+  <<<<<<< working copy: ef83787e2614 - test: revision 1
+  revision 1
+  space
+  =======
+  revision 4
+  >>>>>>> merge rev:    81448d39c9a0 - test: revision 4
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ aftermerge
+  # cat f
+  <<<<<<< working copy: ef83787e2614 - test: revision 1
+  revision 1
+  space
+  =======
+  revision 4
+  >>>>>>> merge rev:    81448d39c9a0 - test: revision 4
+  # hg stat
+  M f
+  # hg resolve --list
+  R f
+
 premerge=keep-merge3 keeps conflict markers with base content:
 
   $ beforemerge



To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel


More information about the Mercurial-devel mailing list