diff tests/test-evolve-issue5958.t @ 4997:e989d109ca9c stable

test: add test for content divergence involving a date update In this case, each side update the date.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 10 Dec 2019 19:58:51 +0100
parents 6061995cfad0
children 88b816a9d990
line wrap: on
line diff
--- a/tests/test-evolve-issue5958.t	Tue Dec 10 19:55:37 2019 +0100
+++ b/tests/test-evolve-issue5958.t	Tue Dec 10 19:58:51 2019 +0100
@@ -208,3 +208,53 @@
   $ hg log -r . --hidden -T '{rev} {node|short} {date|isodate}: {join(obsfate, "; ")}\n'
   11 bb2424887202 1970-01-01 00:00 +0000: 
   13 bb2424887202 1970-01-01 00:02 +0000: (false !)
+
+date: updated each side to a different value, newer should win
+
+  $ hg amend --date "235 0"
+  $ hg update --hidden --rev 'predecessors(.)'
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to hidden changeset bb2424887202
+  (hidden revision 'bb2424887202' was rewritten as: 48132e92d706)
+  working directory parent is obsolete! (bb2424887202)
+  (use 'hg evolve' to update to its successor: 48132e92d706)
+  $ hg amend --date "784 0"
+  2 new content-divergent changesets
+  $ hg log -G
+  @  changeset:   14:694c3cf6b929
+  |  tag:         tip
+  |  parent:      0:a24ed8ad918c
+  |  user:        test
+  |  date:        Thu Jan 01 00:13:04 1970 +0000
+  |  instability: content-divergent
+  |  summary:     add foo.txt
+  |
+  | *  changeset:   13:48132e92d706
+  |/   parent:      0:a24ed8ad918c
+  |    user:        test
+  |    date:        Thu Jan 01 00:03:55 1970 +0000
+  |    instability: content-divergent
+  |    summary:     add foo.txt
+  |
+  o  changeset:   0:a24ed8ad918c
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     add r0
+  
+  $ hg evolve --list -r .
+  694c3cf6b929: add foo.txt
+    content-divergent: 48132e92d706 (draft) (precursor bb2424887202)
+  
+  $ hg log -r bb2424887202+48132e92d706+694c3cf6b929 --hidden -T '{rev} {node|short} {date|isodate}: {join(obsfate, "; ")}\n'
+  11 bb2424887202 1970-01-01 00:00 +0000: date-changed using amend as 14:694c3cf6b929; date-changed using amend as 13:48132e92d706
+  13 48132e92d706 1970-01-01 00:03 +0000: 
+  14 694c3cf6b929 1970-01-01 00:13 +0000: 
+  $ hg evolve --content-divergent
+  merge:[13] add foo.txt
+  with: [14] add foo.txt
+  base: [12] add foo.txt
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  working directory is now at a24ed8ad918c
+  $ hg log -r . --hidden -T '{rev} {node|short} {date|isodate}: {join(obsfate, "; ")}\n'
+  0 a24ed8ad918c 1970-01-01 00:00 +0000: 
+  16 bb2424887202 1970-01-01 00:13 +0000: (false !)