changeset 42338:78530404d00b

convert: demonstrate broken {files} list in merge commits with file flags When there is a merge in which the flags for a file from p2 is non-empty, `hg convert` will incorrectly include that in the changeset's files list. Differential Revision: https://phab.mercurial-scm.org/D6408
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 17 May 2019 11:32:48 -0700
parents 832c59d1196e
children c0e1ea0c4cee
files tests/test-convert-hg-sink.t
diffstat 1 files changed, 48 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-convert-hg-sink.t	Sat May 18 19:56:06 2019 -0400
+++ b/tests/test-convert-hg-sink.t	Fri May 17 11:32:48 2019 -0700
@@ -573,3 +573,51 @@
   M f
   A b-only
   R a-only
+
+Recorded {files} list does not get confused about flags on merge commits
+
+#if execbit
+  $ cd ..
+  $ hg init merge-flags-orig
+  $ cd merge-flags-orig
+  $ echo 0 > 0
+  $ hg ci -Aqm 'add 0'
+  $ echo a > a
+  $ chmod +x a
+  $ hg ci -qAm 'add executable file'
+  $ hg co -q 0
+  $ echo b > b
+  $ hg ci -qAm 'add file'
+  $ hg merge -q
+  $ hg ci -m 'merge'
+  $ hg log -G -T '{rev} {desc}\n'
+  @    3 merge
+  |\
+  | o  2 add file
+  | |
+  o |  1 add executable file
+  |/
+  o  0 add 0
+  
+
+# No files changed
+  $ hg log -r 3 -T '{files}\n'
+  
+
+  $ cd ..
+  $ hg convert merge-flags-orig merge-flags-new -q
+  $ cd merge-flags-new
+  $ hg log -G -T '{rev} {desc}\n'
+  o    3 merge
+  |\
+  | o  2 add file
+  | |
+  o |  1 add executable file
+  |/
+  o  0 add 0
+  
+BROKEN: now 'a' appears changed
+  $ hg log -r 3 -T '{files}\n'
+  a
+
+#endif