##// 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 $ hg init
1 $ hg init
2
2
3 $ echo "[merge]" >> .hg/hgrc
3 $ echo "[merge]" >> .hg/hgrc
4 $ echo "followcopies = 1" >> .hg/hgrc
4 $ echo "followcopies = 1" >> .hg/hgrc
5
5
6 $ echo foo > a
6 $ echo foo > a
7 $ echo foo > a2
7 $ echo foo > a2
8 $ hg add a a2
8 $ hg add a a2
9 $ hg ci -m "start"
9 $ hg ci -m "start"
10
10
11 $ hg mv a b
11 $ hg mv a b
12 $ hg mv a2 b2
12 $ hg mv a2 b2
13 $ hg ci -m "rename"
13 $ hg ci -m "rename"
14
14
15 $ hg co 0
15 $ hg co 0
16 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
16 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
17
17
18 $ echo blahblah > a
18 $ echo blahblah > a
19 $ echo blahblah > a2
19 $ echo blahblah > a2
20 $ hg mv a2 c2
20 $ hg mv a2 c2
21 $ hg ci -m "modify"
21 $ hg ci -m "modify"
22 created new head
22 created new head
23
23
24 $ hg merge -y --debug
24 $ hg merge -y --debug
25 unmatched files in local:
25 unmatched files in local:
26 c2
26 c2
27 unmatched files in other:
27 unmatched files in other:
28 b
28 b
29 b2
29 b2
30 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
30 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
31 src: 'a' -> dst: 'b' *
31 src: 'a' -> dst: 'b' *
32 src: 'a2' -> dst: 'b2' !
32 src: 'a2' -> dst: 'b2' !
33 src: 'a2' -> dst: 'c2' !
33 src: 'a2' -> dst: 'c2' !
34 checking for directory renames
34 checking for directory renames
35 resolving manifests
35 resolving manifests
36 branchmerge: True, force: False, partial: False
36 branchmerge: True, force: False, partial: False
37 ancestor: af1939970a1c, local: 044f8520aeeb+, remote: 85c198ef2f6c
37 ancestor: af1939970a1c, local: 044f8520aeeb+, remote: 85c198ef2f6c
38 note: possible conflict - a2 was renamed multiple times to:
38 note: possible conflict - a2 was renamed multiple times to:
39 b2
39 b2
40 c2
40 c2
41 preserving a for resolve of b
41 preserving a for resolve of b
42 removing a
42 removing a
43 b2: remote created -> g
43 b2: remote created -> g
44 getting b2
44 getting b2
45 b: remote moved from a -> m (premerge)
45 b: remote moved from a -> m (premerge)
46 picked tool ':merge' for b (binary False symlink False changedelete False)
46 picked tool ':merge' for b (binary False symlink False changedelete False)
47 merging a and b to b
47 merging a and b to b
48 my b@044f8520aeeb+ other b@85c198ef2f6c ancestor a@af1939970a1c
48 my b@044f8520aeeb+ other b@85c198ef2f6c ancestor a@af1939970a1c
49 premerge successful
49 premerge successful
50 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
50 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
51 (branch merge, don't forget to commit)
51 (branch merge, don't forget to commit)
52
52
53 $ hg status -AC
53 $ hg status -AC
54 M b
54 M b
55 a
55 a
56 M b2
56 M b2
57 R a
57 R a
58 C c2
58 C c2
59
59
60 $ cat b
60 $ cat b
61 blahblah
61 blahblah
62
62
63 $ hg ci -m "merge"
63 $ hg ci -m "merge"
64
64
65 $ hg debugindex b
65 $ hg debugindex b
66 rev linkrev nodeid p1 p2
66 rev linkrev nodeid p1 p2
67 0 1 57eacc201a7f 000000000000 000000000000
67 0 1 57eacc201a7f 000000000000 000000000000
68 1 3 4727ba907962 000000000000 57eacc201a7f
68 1 3 4727ba907962 000000000000 57eacc201a7f
69
69
70 $ hg debugrename b
70 $ hg debugrename b
71 b renamed from a:dd03b83622e78778b403775d0d074b9ac7387a66
71 b renamed from a:dd03b83622e78778b403775d0d074b9ac7387a66
72
72
73 This used to trigger a "divergent renames" warning, despite no renames
73 This used to trigger a "divergent renames" warning, despite no renames
74
74
75 $ hg cp b b3
75 $ hg cp b b3
76 $ hg cp b b4
76 $ hg cp b b4
77 $ hg ci -A -m 'copy b twice'
77 $ hg ci -A -m 'copy b twice'
78 $ hg up '.^'
78 $ hg up '.^'
79 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
79 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
80 $ hg up
80 $ hg up
81 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
81 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
82 $ hg rm b3 b4
82 $ hg rm b3 b4
83 $ hg ci -m 'clean up a bit of our mess'
83 $ hg ci -m 'clean up a bit of our mess'
84
84
85 We'd rather not warn on divergent renames done in the same changeset (issue2113)
85 We'd rather not warn on divergent renames done in the same changeset (issue2113)
86
86
87 $ hg cp b b3
87 $ hg cp b b3
88 $ hg mv b b4
88 $ hg mv b b4
89 $ hg ci -A -m 'divergent renames in same changeset'
89 $ hg ci -A -m 'divergent renames in same changeset'
90 $ hg up '.^'
90 $ hg up '.^'
91 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
91 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
92 $ hg up
92 $ hg up
93 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
93 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
94
94
95 Check for issue2642
95 Check for issue2642
96
96
97 $ hg init t
97 $ hg init t
98 $ cd t
98 $ cd t
99
99
100 $ echo c0 > f1
100 $ echo c0 > f1
101 $ hg ci -Aqm0
101 $ hg ci -Aqm0
102
102
103 $ hg up null -q
103 $ hg up null -q
104 $ echo c1 > f1 # backport
104 $ echo c1 > f1 # backport
105 $ hg ci -Aqm1
105 $ hg ci -Aqm1
106 $ hg mv f1 f2
106 $ hg mv f1 f2
107 $ hg ci -qm2
107 $ hg ci -qm2
108
108
109 $ hg up 0 -q
109 $ hg up 0 -q
110 $ hg merge 1 -q --tool internal:local
110 $ hg merge 1 -q --tool internal:local
111 $ hg ci -qm3
111 $ hg ci -qm3
112
112
113 $ hg merge 2
113 $ hg merge 2
114 merging f1 and f2 to f2
114 merging f1 and f2 to f2
115 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
115 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
116 (branch merge, don't forget to commit)
116 (branch merge, don't forget to commit)
117
117
118 $ cat f2
118 $ cat f2
119 c0
119 c0
120
120
121 $ cd ..
121 $ cd ..
122
122
123 Check for issue2089
123 Check for issue2089
124
124
125 $ hg init repo2089
125 $ hg init repo2089
126 $ cd repo2089
126 $ cd repo2089
127
127
128 $ echo c0 > f1
128 $ echo c0 > f1
129 $ hg ci -Aqm0
129 $ hg ci -Aqm0
130
130
131 $ hg up null -q
131 $ hg up null -q
132 $ echo c1 > f1
132 $ echo c1 > f1
133 $ hg ci -Aqm1
133 $ hg ci -Aqm1
134
134
135 $ hg up 0 -q
135 $ hg up 0 -q
136 $ hg merge 1 -q --tool internal:local
136 $ hg merge 1 -q --tool internal:local
137 $ echo c2 > f1
137 $ echo c2 > f1
138 $ hg ci -qm2
138 $ hg ci -qm2
139
139
140 $ hg up 1 -q
140 $ hg up 1 -q
141 $ hg mv f1 f2
141 $ hg mv f1 f2
142 $ hg ci -Aqm3
142 $ hg ci -Aqm3
143
143
144 $ hg up 2 -q
144 $ hg up 2 -q
145 $ hg merge 3
145 $ hg merge 3
146 merging f1 and f2 to f2
146 merging f1 and f2 to f2
147 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
147 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
148 (branch merge, don't forget to commit)
148 (branch merge, don't forget to commit)
149
149
150 $ cat f2
150 $ cat f2
151 c2
151 c2
152
152
153 $ cd ..
153 $ cd ..
154
154
155 Check for issue3074
155 Check for issue3074
156
156
157 $ hg init repo3074
157 $ hg init repo3074
158 $ cd repo3074
158 $ cd repo3074
159 $ echo foo > file
159 $ echo foo > file
160 $ hg add file
160 $ hg add file
161 $ hg commit -m "added file"
161 $ hg commit -m "added file"
162 $ hg mv file newfile
162 $ hg mv file newfile
163 $ hg commit -m "renamed file"
163 $ hg commit -m "renamed file"
164 $ hg update 0
164 $ hg update 0
165 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
165 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
166 $ hg rm file
166 $ hg rm file
167 $ hg commit -m "deleted file"
167 $ hg commit -m "deleted file"
168 created new head
168 created new head
169 $ hg merge --debug
169 $ hg merge --debug
170 unmatched files in other:
170 unmatched files in other:
171 newfile
171 newfile
172 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
172 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
173 src: 'file' -> dst: 'newfile' %
173 src: 'file' -> dst: 'newfile' %
174 checking for directory renames
174 checking for directory renames
175 resolving manifests
175 resolving manifests
176 branchmerge: True, force: False, partial: False
176 branchmerge: True, force: False, partial: False
177 ancestor: 19d7f95df299, local: 0084274f6b67+, remote: 5d32493049f0
177 ancestor: 19d7f95df299, local: 0084274f6b67+, remote: 5d32493049f0
178 note: possible conflict - file was deleted and renamed to:
178 note: possible conflict - file was deleted and renamed to:
179 newfile
179 newfile
180 newfile: remote created -> g
180 newfile: remote created -> g
181 getting newfile
181 getting newfile
182 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
182 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
183 (branch merge, don't forget to commit)
183 (branch merge, don't forget to commit)
184 $ hg status
184 $ hg status
185 M newfile
185 M newfile
186 $ cd ..
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