##// END OF EJS Templates
tests: test merge of renames of different sources to same target...
Martin von Zweigbergk -
r44621:d7622fde default
parent child Browse files
Show More
@@ -1,186 +1,255 b''
1 1 $ hg init
2 2
3 3 $ echo "[merge]" >> .hg/hgrc
4 4 $ echo "followcopies = 1" >> .hg/hgrc
5 5
6 6 $ echo foo > a
7 7 $ echo foo > a2
8 8 $ hg add a a2
9 9 $ hg ci -m "start"
10 10
11 11 $ hg mv a b
12 12 $ hg mv a2 b2
13 13 $ hg ci -m "rename"
14 14
15 15 $ hg co 0
16 16 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
17 17
18 18 $ echo blahblah > a
19 19 $ echo blahblah > a2
20 20 $ hg mv a2 c2
21 21 $ hg ci -m "modify"
22 22 created new head
23 23
24 24 $ hg merge -y --debug
25 25 unmatched files in local:
26 26 c2
27 27 unmatched files in other:
28 28 b
29 29 b2
30 30 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
31 31 src: 'a' -> dst: 'b' *
32 32 src: 'a2' -> dst: 'b2' !
33 33 src: 'a2' -> dst: 'c2' !
34 34 checking for directory renames
35 35 resolving manifests
36 36 branchmerge: True, force: False, partial: False
37 37 ancestor: af1939970a1c, local: 044f8520aeeb+, remote: 85c198ef2f6c
38 38 note: possible conflict - a2 was renamed multiple times to:
39 39 b2
40 40 c2
41 41 preserving a for resolve of b
42 42 removing a
43 43 b2: remote created -> g
44 44 getting b2
45 45 b: remote moved from a -> m (premerge)
46 46 picked tool ':merge' for b (binary False symlink False changedelete False)
47 47 merging a and b to b
48 48 my b@044f8520aeeb+ other b@85c198ef2f6c ancestor a@af1939970a1c
49 49 premerge successful
50 50 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
51 51 (branch merge, don't forget to commit)
52 52
53 53 $ hg status -AC
54 54 M b
55 55 a
56 56 M b2
57 57 R a
58 58 C c2
59 59
60 60 $ cat b
61 61 blahblah
62 62
63 63 $ hg ci -m "merge"
64 64
65 65 $ hg debugindex b
66 66 rev linkrev nodeid p1 p2
67 67 0 1 57eacc201a7f 000000000000 000000000000
68 68 1 3 4727ba907962 000000000000 57eacc201a7f
69 69
70 70 $ hg debugrename b
71 71 b renamed from a:dd03b83622e78778b403775d0d074b9ac7387a66
72 72
73 73 This used to trigger a "divergent renames" warning, despite no renames
74 74
75 75 $ hg cp b b3
76 76 $ hg cp b b4
77 77 $ hg ci -A -m 'copy b twice'
78 78 $ hg up '.^'
79 79 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
80 80 $ hg up
81 81 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
82 82 $ hg rm b3 b4
83 83 $ hg ci -m 'clean up a bit of our mess'
84 84
85 85 We'd rather not warn on divergent renames done in the same changeset (issue2113)
86 86
87 87 $ hg cp b b3
88 88 $ hg mv b b4
89 89 $ hg ci -A -m 'divergent renames in same changeset'
90 90 $ hg up '.^'
91 91 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
92 92 $ hg up
93 93 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
94 94
95 95 Check for issue2642
96 96
97 97 $ hg init t
98 98 $ cd t
99 99
100 100 $ echo c0 > f1
101 101 $ hg ci -Aqm0
102 102
103 103 $ hg up null -q
104 104 $ echo c1 > f1 # backport
105 105 $ hg ci -Aqm1
106 106 $ hg mv f1 f2
107 107 $ hg ci -qm2
108 108
109 109 $ hg up 0 -q
110 110 $ hg merge 1 -q --tool internal:local
111 111 $ hg ci -qm3
112 112
113 113 $ hg merge 2
114 114 merging f1 and f2 to f2
115 115 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
116 116 (branch merge, don't forget to commit)
117 117
118 118 $ cat f2
119 119 c0
120 120
121 121 $ cd ..
122 122
123 123 Check for issue2089
124 124
125 125 $ hg init repo2089
126 126 $ cd repo2089
127 127
128 128 $ echo c0 > f1
129 129 $ hg ci -Aqm0
130 130
131 131 $ hg up null -q
132 132 $ echo c1 > f1
133 133 $ hg ci -Aqm1
134 134
135 135 $ hg up 0 -q
136 136 $ hg merge 1 -q --tool internal:local
137 137 $ echo c2 > f1
138 138 $ hg ci -qm2
139 139
140 140 $ hg up 1 -q
141 141 $ hg mv f1 f2
142 142 $ hg ci -Aqm3
143 143
144 144 $ hg up 2 -q
145 145 $ hg merge 3
146 146 merging f1 and f2 to f2
147 147 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
148 148 (branch merge, don't forget to commit)
149 149
150 150 $ cat f2
151 151 c2
152 152
153 153 $ cd ..
154 154
155 155 Check for issue3074
156 156
157 157 $ hg init repo3074
158 158 $ cd repo3074
159 159 $ echo foo > file
160 160 $ hg add file
161 161 $ hg commit -m "added file"
162 162 $ hg mv file newfile
163 163 $ hg commit -m "renamed file"
164 164 $ hg update 0
165 165 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
166 166 $ hg rm file
167 167 $ hg commit -m "deleted file"
168 168 created new head
169 169 $ hg merge --debug
170 170 unmatched files in other:
171 171 newfile
172 172 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
173 173 src: 'file' -> dst: 'newfile' %
174 174 checking for directory renames
175 175 resolving manifests
176 176 branchmerge: True, force: False, partial: False
177 177 ancestor: 19d7f95df299, local: 0084274f6b67+, remote: 5d32493049f0
178 178 note: possible conflict - file was deleted and renamed to:
179 179 newfile
180 180 newfile: remote created -> g
181 181 getting newfile
182 182 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
183 183 (branch merge, don't forget to commit)
184 184 $ hg status
185 185 M newfile
186 186 $ cd ..
187
188 Create x and y, then modify y and rename x to z on one side of merge, and
189 modify x and rename y to z on the other side.
190 $ hg init conflicting-target
191 $ cd conflicting-target
192 $ echo x > x
193 $ echo y > y
194 $ hg ci -Aqm 'add x and y'
195 $ hg mv x z
196 $ echo foo >> y
197 $ hg ci -qm 'modify y, rename x to z'
198 $ hg co -q 0
199 $ hg mv y z
200 $ echo foo >> x
201 $ hg ci -qm 'modify x, rename y to z'
202 # We should probably tell the user about the conflicting rename sources.
203 # Depending on which side they pick, we should take that rename and get
204 # the changes to the source from the other side. The unchanged file should
205 # remain.
206 # we should not get the prompts about modify/delete conflicts
207 $ hg merge --debug 1 -t :merge3
208 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
209 src: 'x' -> dst: 'z'
210 checking for directory renames
211 resolving manifests
212 branchmerge: True, force: False, partial: False
213 ancestor: 5151c134577e, local: 07fcbc9a74ed+, remote: f21419739508
214 preserving x for resolve of x
215 preserving z for resolve of z
216 x: prompt changed/deleted -> m (premerge)
217 picked tool ':prompt' for x (binary False symlink False changedelete True)
218 file 'x' was deleted in other [merge rev] but was modified in local [working copy].
219 You can use (c)hanged version, (d)elete, or leave (u)nresolved.
220 What do you want to do? u
221 y: prompt deleted/changed -> m (premerge)
222 picked tool ':prompt' for y (binary False symlink False changedelete True)
223 file 'y' was deleted in local [working copy] but was modified in other [merge rev].
224 You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
225 What do you want to do? u
226 z: both created -> m (premerge)
227 picked tool ':merge3' for z (binary False symlink False changedelete False)
228 merging z
229 my z@07fcbc9a74ed+ other z@f21419739508 ancestor z@000000000000
230 z: both created -> m (merge)
231 picked tool ':merge3' for z (binary False symlink False changedelete False)
232 my z@07fcbc9a74ed+ other z@f21419739508 ancestor z@000000000000
233 warning: conflicts while merging z! (edit, then use 'hg resolve --mark')
234 0 files updated, 0 files merged, 0 files removed, 3 files unresolved
235 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
236 [1]
237 $ ls
238 x
239 y
240 z
241 z.orig
242 $ cat x
243 x
244 foo
245 $ cat y
246 y
247 foo
248 # 'z' should have had the added 'foo' line
249 $ cat z
250 <<<<<<< working copy: 07fcbc9a74ed - test: modify x, rename y to z
251 y
252 ||||||| base
253 =======
254 x
255 >>>>>>> merge rev: f21419739508 - test: modify y, rename x to z
General Comments 0
You need to be logged in to leave comments. Login now