changeset 48971:4057563ebc6b

branching: merge stable into default
author Raphaël Gomès <rgomes@octobus.net>
date Thu, 17 Mar 2022 12:27:40 +0100
parents 890db1c97218 (current diff) 4a8eff64860a (diff)
children 6b31c0676147
files mercurial/filemerge.py
diffstat 3 files changed, 39 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/filemerge.py	Tue Mar 15 10:36:28 2022 +0100
+++ b/mercurial/filemerge.py	Thu Mar 17 12:27:40 2022 +0100
@@ -754,8 +754,7 @@
         # Remove the .orig to make syntax-highlighting more likely.
         if localoutputpath.endswith(b'.orig'):
             localoutputpath, ext = os.path.splitext(localoutputpath)
-        localdata = util.readfile(localpath)
-        files.append((b"local", localoutputpath, localdata))
+        files.append((b"local", localoutputpath, backup.data()))
 
     with _maketempfiles(files) as temppaths:
         basepath, otherpath = temppaths[:2]
--- a/tests/test-clone-stream.t	Tue Mar 15 10:36:28 2022 +0100
+++ b/tests/test-clone-stream.t	Thu Mar 17 12:27:40 2022 +0100
@@ -316,8 +316,8 @@
 #endif
 #if zstd no-rust
   $ f --size --hex --bytes 256 body
-  body: size=116310
-  body: size=116335 (bigendian !)
+  body: size=116310 (no-bigendian !)
+  body: size=116305 (bigendian !)
   0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
   0010: 7c 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 ||.STREAM2.......|
   0020: 06 09 04 0c 40 62 79 74 65 63 6f 75 6e 74 31 30 |....@bytecount10|
--- a/tests/test-merge-tools.t	Tue Mar 15 10:36:28 2022 +0100
+++ b/tests/test-merge-tools.t	Thu Mar 17 12:27:40 2022 +0100
@@ -1213,6 +1213,42 @@
   # 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
+  revision 1
+  space
+  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