comparison tests/test-evolve-issue5958.t @ 4995:d31d39ea0fe4 stable

test: add test for content divergence involving a date update In this case, one side update to an older date.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 10 Dec 2019 19:27:55 +0100
parents 8b6e2565aaf3
children 6061995cfad0
comparison
equal deleted inserted replaced
4994:8b6e2565aaf3 4995:d31d39ea0fe4
19 $ hg metaedit -r . -d '0 2' 19 $ hg metaedit -r . -d '0 2'
20 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 20 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
21 21
22 (Make changes in unrelated files so that we don't have any merge conflicts 22 (Make changes in unrelated files so that we don't have any merge conflicts
23 during the rebase, but the two touched revisions aren't identical) 23 during the rebase, but the two touched revisions aren't identical)
24
25 date: updated on both side to the same value
24 26
25 $ echo hi > bar.txt 27 $ echo hi > bar.txt
26 $ hg add -q bar.txt 28 $ hg add -q bar.txt
27 $ hg amend -q 29 $ hg amend -q
28 $ hg metaedit -r 1 -d '0 1' --hidden 30 $ hg metaedit -r 1 -d '0 1' --hidden
97 working directory is now at 2372e6d39855 99 working directory is now at 2372e6d39855
98 $ hg log -r 'desc("add foo.txt")' -T '{rev} {node|short} {date|isodate}: {join(obsfate, "; ")}\n' 100 $ hg log -r 'desc("add foo.txt")' -T '{rev} {node|short} {date|isodate}: {join(obsfate, "; ")}\n'
99 4 c17bf400a278 1969-12-31 23:59 -0000: rewritten using evolve as 7:2372e6d39855 101 4 c17bf400a278 1969-12-31 23:59 -0000: rewritten using evolve as 7:2372e6d39855
100 7 2372e6d39855 1970-01-01 00:00 +0000: 102 7 2372e6d39855 1970-01-01 00:00 +0000:
101 7 bb2424887202 1969-12-31 23:59 +0000: (false !) 103 7 bb2424887202 1969-12-31 23:59 +0000: (false !)
104
105 date: updated one one side to an older value
106
107 $ hg evolve -r .
108 move:[7] add foo.txt
109 atop:[0] add r0
110 working directory is now at 2b9788beff53
111 $ hg update --hidden --rev 'predecessors(.)'
112 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
113 updated to hidden changeset 2372e6d39855
114 (hidden revision '2372e6d39855' was rewritten as: 2b9788beff53)
115 working directory parent is obsolete! (2372e6d39855)
116 (use 'hg evolve' to update to its successor: 2b9788beff53)
117 $ hg amend --date "0 2"
118 1 new orphan changesets
119 2 new content-divergent changesets
120 $ hg rebase -r . -d 0
121 rebasing 9:88085147662e "add foo.txt" (tip)
122 $ hg log -G
123 @ changeset: 10:873d828420d8
124 | tag: tip
125 | parent: 0:a24ed8ad918c
126 | user: test
127 | date: Wed Dec 31 23:59:58 1969 -0000
128 | instability: content-divergent
129 | summary: add foo.txt
130 |
131 | * changeset: 8:2b9788beff53
132 |/ parent: 0:a24ed8ad918c
133 | user: test
134 | date: Thu Jan 01 00:00:00 1970 +0000
135 | instability: content-divergent
136 | summary: add foo.txt
137 |
138 o changeset: 0:a24ed8ad918c
139 user: test
140 date: Thu Jan 01 00:00:00 1970 +0000
141 summary: add r0
142
143 $ hg evolve --list -r .
144 873d828420d8: add foo.txt
145 content-divergent: 2b9788beff53 (draft) (precursor 2372e6d39855)
146
147 $ hg log -r 2372e6d39855+873d828420d8+2b9788beff53 --hidden -T '{rev} {node|short} {date|isodate}: {join(obsfate, "; ")}\n'
148 7 2372e6d39855 1970-01-01 00:00 +0000: date-changed using amend as 9:88085147662e; rebased using evolve as 8:2b9788beff53
149 10 873d828420d8 1969-12-31 23:59 -0000:
150 8 2b9788beff53 1970-01-01 00:00 +0000:
151 $ hg evolve --content-divergent
152 merge:[8] add foo.txt
153 with: [10] add foo.txt
154 base: [7] add foo.txt
155 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
156 working directory is now at bb2424887202
157 $ hg log -r . --hidden -T '{rev} {node|short} {date|isodate}: {join(obsfate, "; ")}\n'
158 11 bb2424887202 1970-01-01 00:00 +0000:
159 11 bb2424887202 1969-12-31 23:59 +0000: (false !)