##// END OF EJS Templates
tests: optimize test-copytrace-heuristics.t...
Pulkit Goyal -
r34568:1b261be2 default
parent child Browse files
Show More
@@ -6,6 +6,7 b' Test for the heuristic copytracing algor'
6 > cat >> $1/.hg/hgrc <<EOF
6 > cat >> $1/.hg/hgrc <<EOF
7 > [experimental]
7 > [experimental]
8 > copytrace = heuristics
8 > copytrace = heuristics
9 > copytrace.sourcecommitlimit = -1
9 > EOF
10 > EOF
10 > }
11 > }
11 > __EOF__
12 > __EOF__
@@ -17,9 +18,16 b' Test for the heuristic copytracing algor'
17 > shelve=
18 > shelve=
18 > EOF
19 > EOF
19
20
21 NOTE: calling initclient() set copytrace.sourcecommitlimit=-1 as we want to
22 prevent the full copytrace algorithm to run and test the heuristic algorithm
23 without complexing the test cases with public and draft commits.
24
20 Check filename heuristics (same dirname and same basename)
25 Check filename heuristics (same dirname and same basename)
21 $ hg init server
26 ----------------------------------------------------------
22 $ cd server
27
28 $ hg init repo
29 $ initclient repo
30 $ cd repo
23 $ echo a > a
31 $ echo a > a
24 $ mkdir dir
32 $ mkdir dir
25 $ echo a > dir/file.txt
33 $ echo a > dir/file.txt
@@ -30,22 +38,18 b' Check filename heuristics (same dirname '
30 $ hg mv a b
38 $ hg mv a b
31 $ hg mv -q dir dir2
39 $ hg mv -q dir dir2
32 $ hg ci -m 'mv a b, mv dir/ dir2/'
40 $ hg ci -m 'mv a b, mv dir/ dir2/'
33 $ cd ..
34 $ hg clone -q server repo
35 $ initclient repo
36 $ cd repo
37 $ hg up -q 0
41 $ hg up -q 0
38 $ echo b > a
42 $ echo b > a
39 $ echo b > dir/file.txt
43 $ echo b > dir/file.txt
40 $ hg ci -qm 'mod a, mod dir/file.txt'
44 $ hg ci -qm 'mod a, mod dir/file.txt'
41
45
42 $ hg log -G -T 'changeset: {node}\n desc: {desc}, phase: {phase}\n'
46 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
43 @ changeset: 557f403c0afd2a3cf15d7e2fb1f1001a8b85e081
47 @ changeset: 557f403c0afd2a3cf15d7e2fb1f1001a8b85e081
44 | desc: mod a, mod dir/file.txt, phase: draft
48 | desc: mod a, mod dir/file.txt
45 | o changeset: 928d74bc9110681920854d845c06959f6dfc9547
49 | o changeset: 928d74bc9110681920854d845c06959f6dfc9547
46 |/ desc: mv a b, mv dir/ dir2/, phase: public
50 |/ desc: mv a b, mv dir/ dir2/
47 o changeset: 3c482b16e54596fed340d05ffaf155f156cda7ee
51 o changeset: 3c482b16e54596fed340d05ffaf155f156cda7ee
48 desc: initial, phase: public
52 desc: initial
49
53
50 $ hg rebase -s . -d 1
54 $ hg rebase -s . -d 1
51 rebasing 2:557f403c0afd "mod a, mod dir/file.txt" (tip)
55 rebasing 2:557f403c0afd "mod a, mod dir/file.txt" (tip)
@@ -53,12 +57,14 b' Check filename heuristics (same dirname '
53 merging dir2/file.txt and dir/file.txt to dir2/file.txt
57 merging dir2/file.txt and dir/file.txt to dir2/file.txt
54 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/557f403c0afd-9926eeff-rebase.hg (glob)
58 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/557f403c0afd-9926eeff-rebase.hg (glob)
55 $ cd ..
59 $ cd ..
56 $ rm -rf server
57 $ rm -rf repo
60 $ rm -rf repo
58
61
59 Make sure filename heuristics do not when they are not related
62 Make sure filename heuristics do not when they are not related
60 $ hg init server
63 --------------------------------------------------------------
61 $ cd server
64
65 $ hg init repo
66 $ initclient repo
67 $ cd repo
62 $ echo 'somecontent' > a
68 $ echo 'somecontent' > a
63 $ hg add a
69 $ hg add a
64 $ hg ci -m initial
70 $ hg ci -m initial
@@ -66,21 +72,17 b' Make sure filename heuristics do not whe'
66 $ echo 'completelydifferentcontext' > b
72 $ echo 'completelydifferentcontext' > b
67 $ hg add b
73 $ hg add b
68 $ hg ci -m 'rm a, add b'
74 $ hg ci -m 'rm a, add b'
69 $ cd ..
70 $ hg clone -q server repo
71 $ initclient repo
72 $ cd repo
73 $ hg up -q 0
75 $ hg up -q 0
74 $ printf 'somecontent\nmoarcontent' > a
76 $ printf 'somecontent\nmoarcontent' > a
75 $ hg ci -qm 'mode a'
77 $ hg ci -qm 'mode a'
76
78
77 $ hg log -G -T 'changeset: {node}\n desc: {desc}, phase: {phase}\n'
79 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
78 @ changeset: d526312210b9e8f795d576a77dc643796384d86e
80 @ changeset: d526312210b9e8f795d576a77dc643796384d86e
79 | desc: mode a, phase: draft
81 | desc: mode a
80 | o changeset: 46985f76c7e5e5123433527f5c8526806145650b
82 | o changeset: 46985f76c7e5e5123433527f5c8526806145650b
81 |/ desc: rm a, add b, phase: public
83 |/ desc: rm a, add b
82 o changeset: e5b71fb099c29d9172ef4a23485aaffd497e4cc0
84 o changeset: e5b71fb099c29d9172ef4a23485aaffd497e4cc0
83 desc: initial, phase: public
85 desc: initial
84
86
85 $ hg rebase -s . -d 1
87 $ hg rebase -s . -d 1
86 rebasing 2:d526312210b9 "mode a" (tip)
88 rebasing 2:d526312210b9 "mode a" (tip)
@@ -90,49 +92,14 b' Make sure filename heuristics do not whe'
90 [1]
92 [1]
91
93
92 $ cd ..
94 $ cd ..
93 $ rm -rf server
94 $ rm -rf repo
95 $ rm -rf repo
95
96
96 Test when lca didn't modified the file that was moved
97 Test when lca didn't modified the file that was moved
97 $ hg init server
98 -----------------------------------------------------
98 $ cd server
99
99 $ echo 'somecontent' > a
100 $ hg init repo
100 $ hg add a
101 $ hg ci -m initial
102 $ echo c > c
103 $ hg add c
104 $ hg ci -m randomcommit
105 $ hg mv a b
106 $ hg ci -m 'mv a b'
107 $ cd ..
108 $ hg clone -q server repo
109 $ initclient repo
101 $ initclient repo
110 $ cd repo
102 $ cd repo
111 $ hg up -q 1
112 $ echo b > a
113 $ hg ci -qm 'mod a'
114
115 $ hg log -G -T 'changeset: {node}\n desc: {desc}, phase: {phase}\n'
116 @ changeset: 9d5cf99c3d9f8e8b05ba55421f7f56530cfcf3bc
117 | desc: mod a, phase: draft
118 | o changeset: d760186dd240fc47b91eb9f0b58b0002aaeef95d
119 |/ desc: mv a b, phase: public
120 o changeset: 48e1b6ba639d5d7fb313fa7989eebabf99c9eb83
121 | desc: randomcommit, phase: public
122 o changeset: e5b71fb099c29d9172ef4a23485aaffd497e4cc0
123 desc: initial, phase: public
124
125 $ hg rebase -s . -d 2
126 rebasing 3:9d5cf99c3d9f "mod a" (tip)
127 merging b and a to b
128 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9d5cf99c3d9f-f02358cc-rebase.hg (glob)
129 $ cd ..
130 $ rm -rf server
131 $ rm -rf repo
132
133 Rebase "backwards"
134 $ hg init server
135 $ cd server
136 $ echo 'somecontent' > a
103 $ echo 'somecontent' > a
137 $ hg add a
104 $ hg add a
138 $ hg ci -m initial
105 $ hg ci -m initial
@@ -141,65 +108,68 b' Rebase "backwards"'
141 $ hg ci -m randomcommit
108 $ hg ci -m randomcommit
142 $ hg mv a b
109 $ hg mv a b
143 $ hg ci -m 'mv a b'
110 $ hg ci -m 'mv a b'
111 $ hg up -q 1
112 $ echo b > a
113 $ hg ci -qm 'mod a'
114
115 $ hg log -G -T 'changeset: {node}\n desc: {desc}, phase: {phase}\n'
116 @ changeset: 9d5cf99c3d9f8e8b05ba55421f7f56530cfcf3bc
117 | desc: mod a, phase: draft
118 | o changeset: d760186dd240fc47b91eb9f0b58b0002aaeef95d
119 |/ desc: mv a b, phase: draft
120 o changeset: 48e1b6ba639d5d7fb313fa7989eebabf99c9eb83
121 | desc: randomcommit, phase: draft
122 o changeset: e5b71fb099c29d9172ef4a23485aaffd497e4cc0
123 desc: initial, phase: draft
124
125 $ hg rebase -s . -d 2
126 rebasing 3:9d5cf99c3d9f "mod a" (tip)
127 merging b and a to b
128 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9d5cf99c3d9f-f02358cc-rebase.hg (glob)
144 $ cd ..
129 $ cd ..
145 $ hg clone -q server repo
130 $ rm -rf repo
131
132 Rebase "backwards"
133 ------------------
134
135 $ hg init repo
146 $ initclient repo
136 $ initclient repo
147 $ cd repo
137 $ cd repo
138 $ echo 'somecontent' > a
139 $ hg add a
140 $ hg ci -m initial
141 $ echo c > c
142 $ hg add c
143 $ hg ci -m randomcommit
144 $ hg mv a b
145 $ hg ci -m 'mv a b'
148 $ hg up -q 2
146 $ hg up -q 2
149 $ echo b > b
147 $ echo b > b
150 $ hg ci -qm 'mod b'
148 $ hg ci -qm 'mod b'
151
149
152 $ hg log -G -T 'changeset: {node}\n desc: {desc}, phase: {phase}\n'
150 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
153 @ changeset: fbe97126b3969056795c462a67d93faf13e4d298
151 @ changeset: fbe97126b3969056795c462a67d93faf13e4d298
154 | desc: mod b, phase: draft
152 | desc: mod b
155 o changeset: d760186dd240fc47b91eb9f0b58b0002aaeef95d
153 o changeset: d760186dd240fc47b91eb9f0b58b0002aaeef95d
156 | desc: mv a b, phase: public
154 | desc: mv a b
157 o changeset: 48e1b6ba639d5d7fb313fa7989eebabf99c9eb83
155 o changeset: 48e1b6ba639d5d7fb313fa7989eebabf99c9eb83
158 | desc: randomcommit, phase: public
156 | desc: randomcommit
159 o changeset: e5b71fb099c29d9172ef4a23485aaffd497e4cc0
157 o changeset: e5b71fb099c29d9172ef4a23485aaffd497e4cc0
160 desc: initial, phase: public
158 desc: initial
161
159
162 $ hg rebase -s . -d 0
160 $ hg rebase -s . -d 0
163 rebasing 3:fbe97126b396 "mod b" (tip)
161 rebasing 3:fbe97126b396 "mod b" (tip)
164 merging a and b to a
162 merging a and b to a
165 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/fbe97126b396-cf5452a1-rebase.hg (glob)
163 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/fbe97126b396-cf5452a1-rebase.hg (glob)
166 $ cd ..
164 $ cd ..
167 $ rm -rf server
168 $ rm -rf repo
165 $ rm -rf repo
169
166
170 Rebase draft commit on top of draft commit
167 Check a few potential move candidates
168 -------------------------------------
169
171 $ hg init repo
170 $ hg init repo
172 $ initclient repo
171 $ initclient repo
173 $ cd repo
172 $ cd repo
174 $ echo 'somecontent' > a
175 $ hg add a
176 $ hg ci -m initial
177 $ hg mv a b
178 $ hg ci -m 'mv a b'
179 $ hg up -q ".^"
180 $ echo b > a
181 $ hg ci -qm 'mod a'
182
183 $ hg log -G -T 'changeset: {node}\n desc: {desc}, phase: {phase}\n'
184 @ changeset: 5268f05aa1684cfb5741e9eb05eddcc1c5ee7508
185 | desc: mod a, phase: draft
186 | o changeset: 542cb58df733ee48fa74729bd2cdb94c9310d362
187 |/ desc: mv a b, phase: draft
188 o changeset: e5b71fb099c29d9172ef4a23485aaffd497e4cc0
189 desc: initial, phase: draft
190
191 $ hg rebase -s . -d 1
192 rebasing 2:5268f05aa168 "mod a" (tip)
193 merging b and a to b
194 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/5268f05aa168-284f6515-rebase.hg (glob)
195 $ cd ..
196 $ rm -rf server
197 $ rm -rf repo
198
199 Check a few potential move candidates
200 $ hg init server
201 $ initclient server
202 $ cd server
203 $ mkdir dir
173 $ mkdir dir
204 $ echo a > dir/a
174 $ echo a > dir/a
205 $ hg add dir/a
175 $ hg add dir/a
@@ -210,43 +180,36 b' Check a few potential move candidates'
210 $ echo b > dir2/a
180 $ echo b > dir2/a
211 $ hg add dir2/a
181 $ hg add dir2/a
212 $ hg ci -qm 'create dir2/a'
182 $ hg ci -qm 'create dir2/a'
213 $ cd ..
214 $ hg clone -q server repo
215 $ initclient repo
216 $ cd repo
217 $ hg up -q 0
183 $ hg up -q 0
218 $ echo b > dir/a
184 $ echo b > dir/a
219 $ hg ci -qm 'mod dir/a'
185 $ hg ci -qm 'mod dir/a'
220
186
221 $ hg log -G -T 'changeset: {node}\n desc: {desc}, phase: {phase}\n'
187 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
222 @ changeset: 6b2f4cece40fd320f41229f23821256ffc08efea
188 @ changeset: 6b2f4cece40fd320f41229f23821256ffc08efea
223 | desc: mod dir/a, phase: draft
189 | desc: mod dir/a
224 | o changeset: 4494bf7efd2e0dfdd388e767fb913a8a3731e3fa
190 | o changeset: 4494bf7efd2e0dfdd388e767fb913a8a3731e3fa
225 | | desc: create dir2/a, phase: public
191 | | desc: create dir2/a
226 | o changeset: b1784dfab6ea6bfafeb11c0ac50a2981b0fe6ade
192 | o changeset: b1784dfab6ea6bfafeb11c0ac50a2981b0fe6ade
227 |/ desc: mv dir/a dir/b, phase: public
193 |/ desc: mv dir/a dir/b
228 o changeset: 36859b8907c513a3a87ae34ba5b1e7eea8c20944
194 o changeset: 36859b8907c513a3a87ae34ba5b1e7eea8c20944
229 desc: initial, phase: public
195 desc: initial
230
196
231 $ hg rebase -s . -d 2
197 $ hg rebase -s . -d 2
232 rebasing 3:6b2f4cece40f "mod dir/a" (tip)
198 rebasing 3:6b2f4cece40f "mod dir/a" (tip)
233 merging dir/b and dir/a to dir/b
199 merging dir/b and dir/a to dir/b
234 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/6b2f4cece40f-503efe60-rebase.hg (glob)
200 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/6b2f4cece40f-503efe60-rebase.hg (glob)
235 $ cd ..
201 $ cd ..
236 $ rm -rf server
237 $ rm -rf repo
202 $ rm -rf repo
238
203
239 Move file in one branch and delete it in another
204 Move file in one branch and delete it in another
240 $ hg init server
205 -----------------------------------------------
241 $ initclient server
206
242 $ cd server
207 $ hg init repo
208 $ initclient repo
209 $ cd repo
243 $ echo a > a
210 $ echo a > a
244 $ hg add a
211 $ hg add a
245 $ hg ci -m initial
212 $ hg ci -m initial
246 $ cd ..
247 $ hg clone -q server repo
248 $ initclient repo
249 $ cd repo
250 $ hg mv a b
213 $ hg mv a b
251 $ hg ci -m 'mv a b'
214 $ hg ci -m 'mv a b'
252 $ hg up -q ".^"
215 $ hg up -q ".^"
@@ -260,7 +223,7 b' Move file in one branch and delete it in'
260 | o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
223 | o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
261 |/ desc: mv a b, phase: draft
224 |/ desc: mv a b, phase: draft
262 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
225 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
263 desc: initial, phase: public
226 desc: initial, phase: draft
264
227
265 $ hg rebase -s 1 -d 2
228 $ hg rebase -s 1 -d 2
266 rebasing 1:472e38d57782 "mv a b"
229 rebasing 1:472e38d57782 "mv a b"
@@ -269,34 +232,31 b' Move file in one branch and delete it in'
269 $ ls
232 $ ls
270 b
233 b
271 $ cd ..
234 $ cd ..
272 $ rm -rf server
273 $ rm -rf repo
235 $ rm -rf repo
274
236
275 Move a directory in draft branch
237 Move a directory in draft branch
276 $ hg init server
238 --------------------------------
277 $ initclient server
239
278 $ cd server
240 $ hg init repo
241 $ initclient repo
242 $ cd repo
279 $ mkdir dir
243 $ mkdir dir
280 $ echo a > dir/a
244 $ echo a > dir/a
281 $ hg add dir/a
245 $ hg add dir/a
282 $ hg ci -qm initial
246 $ hg ci -qm initial
283 $ cd ..
284 $ hg clone -q server repo
285 $ initclient repo
286 $ cd repo
287 $ echo b > dir/a
247 $ echo b > dir/a
288 $ hg ci -qm 'mod dir/a'
248 $ hg ci -qm 'mod dir/a'
289 $ hg up -q ".^"
249 $ hg up -q ".^"
290 $ hg mv -q dir/ dir2
250 $ hg mv -q dir/ dir2
291 $ hg ci -qm 'mv dir/ dir2/'
251 $ hg ci -qm 'mv dir/ dir2/'
292
252
293 $ hg log -G -T 'changeset: {node}\n desc: {desc}, phase: {phase}\n'
253 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
294 @ changeset: a33d80b6e352591dfd82784e1ad6cdd86b25a239
254 @ changeset: a33d80b6e352591dfd82784e1ad6cdd86b25a239
295 | desc: mv dir/ dir2/, phase: draft
255 | desc: mv dir/ dir2/
296 | o changeset: 6b2f4cece40fd320f41229f23821256ffc08efea
256 | o changeset: 6b2f4cece40fd320f41229f23821256ffc08efea
297 |/ desc: mod dir/a, phase: draft
257 |/ desc: mod dir/a
298 o changeset: 36859b8907c513a3a87ae34ba5b1e7eea8c20944
258 o changeset: 36859b8907c513a3a87ae34ba5b1e7eea8c20944
299 desc: initial, phase: public
259 desc: initial
300
260
301 $ hg rebase -s . -d 1
261 $ hg rebase -s . -d 1
302 rebasing 2:a33d80b6e352 "mv dir/ dir2/" (tip)
262 rebasing 2:a33d80b6e352 "mv dir/ dir2/" (tip)
@@ -307,9 +267,11 b' Move a directory in draft branch'
307 $ rm -rf repo
267 $ rm -rf repo
308
268
309 Move file twice and rebase mod on top of moves
269 Move file twice and rebase mod on top of moves
310 $ hg init server
270 ----------------------------------------------
311 $ initclient server
271
312 $ cd server
272 $ hg init repo
273 $ initclient repo
274 $ cd repo
313 $ echo a > a
275 $ echo a > a
314 $ hg add a
276 $ hg add a
315 $ hg ci -m initial
277 $ hg ci -m initial
@@ -317,60 +279,54 b' Move file twice and rebase mod on top of'
317 $ hg ci -m 'mv a b'
279 $ hg ci -m 'mv a b'
318 $ hg mv b c
280 $ hg mv b c
319 $ hg ci -m 'mv b c'
281 $ hg ci -m 'mv b c'
320 $ cd ..
321 $ hg clone -q server repo
322 $ initclient repo
323 $ cd repo
324 $ hg up -q 0
325 $ echo c > a
326 $ hg ci -m 'mod a'
327 created new head
328 $ hg log -G -T 'changeset: {node}\n desc: {desc}, phase: {phase}\n'
329 @ changeset: d413169422167a3fa5275fc5d71f7dea9f5775f3
330 | desc: mod a, phase: draft
331 | o changeset: d3efd280421d24f9f229997c19e654761c942a71
332 | | desc: mv b c, phase: public
333 | o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
334 |/ desc: mv a b, phase: public
335 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
336 desc: initial, phase: public
337 $ hg rebase -s . -d 2
338 rebasing 3:d41316942216 "mod a" (tip)
339 merging c and a to c
340 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/d41316942216-2b5949bc-rebase.hg (glob)
341
342 $ cd ..
343 $ rm -rf server
344 $ rm -rf repo
345
346 Move file twice and rebase moves on top of mods
347 $ hg init server
348 $ initclient server
349 $ cd server
350 $ echo a > a
351 $ hg add a
352 $ hg ci -m initial
353 $ cd ..
354 $ hg clone -q server repo
355 $ initclient repo
356 $ cd repo
357 $ hg mv a b
358 $ hg ci -m 'mv a b'
359 $ hg mv b c
360 $ hg ci -m 'mv b c'
361 $ hg up -q 0
282 $ hg up -q 0
362 $ echo c > a
283 $ echo c > a
363 $ hg ci -m 'mod a'
284 $ hg ci -m 'mod a'
364 created new head
285 created new head
365 $ hg log -G -T 'changeset: {node}\n desc: {desc}, phase: {phase}\n'
286
287 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
366 @ changeset: d413169422167a3fa5275fc5d71f7dea9f5775f3
288 @ changeset: d413169422167a3fa5275fc5d71f7dea9f5775f3
367 | desc: mod a, phase: draft
289 | desc: mod a
368 | o changeset: d3efd280421d24f9f229997c19e654761c942a71
290 | o changeset: d3efd280421d24f9f229997c19e654761c942a71
369 | | desc: mv b c, phase: draft
291 | | desc: mv b c
370 | o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
292 | o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
371 |/ desc: mv a b, phase: draft
293 |/ desc: mv a b
372 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
294 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
373 desc: initial, phase: public
295 desc: initial
296 $ hg rebase -s . -d 2
297 rebasing 3:d41316942216 "mod a" (tip)
298 merging c and a to c
299 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/d41316942216-2b5949bc-rebase.hg (glob)
300
301 $ cd ..
302 $ rm -rf repo
303
304 Move file twice and rebase moves on top of mods
305 -----------------------------------------------
306
307 $ hg init repo
308 $ initclient repo
309 $ cd repo
310 $ echo a > a
311 $ hg add a
312 $ hg ci -m initial
313 $ hg mv a b
314 $ hg ci -m 'mv a b'
315 $ hg mv b c
316 $ hg ci -m 'mv b c'
317 $ hg up -q 0
318 $ echo c > a
319 $ hg ci -m 'mod a'
320 created new head
321 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
322 @ changeset: d413169422167a3fa5275fc5d71f7dea9f5775f3
323 | desc: mod a
324 | o changeset: d3efd280421d24f9f229997c19e654761c942a71
325 | | desc: mv b c
326 | o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
327 |/ desc: mv a b
328 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
329 desc: initial
374 $ hg rebase -s 1 -d .
330 $ hg rebase -s 1 -d .
375 rebasing 1:472e38d57782 "mv a b"
331 rebasing 1:472e38d57782 "mv a b"
376 merging a and b to b
332 merging a and b to b
@@ -379,13 +335,14 b' Move file twice and rebase moves on top '
379 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/472e38d57782-ab8d3c58-rebase.hg (glob)
335 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/472e38d57782-ab8d3c58-rebase.hg (glob)
380
336
381 $ cd ..
337 $ cd ..
382 $ rm -rf server
383 $ rm -rf repo
338 $ rm -rf repo
384
339
385 Move one file and add another file in the same folder in one branch, modify file in another branch
340 Move one file and add another file in the same folder in one branch, modify file in another branch
386 $ hg init server
341 --------------------------------------------------------------------------------------------------
387 $ initclient server
342
388 $ cd server
343 $ hg init repo
344 $ initclient repo
345 $ cd repo
389 $ echo a > a
346 $ echo a > a
390 $ hg add a
347 $ hg add a
391 $ hg ci -m initial
348 $ hg ci -m initial
@@ -394,24 +351,20 b' Move one file and add another file in th'
394 $ echo c > c
351 $ echo c > c
395 $ hg add c
352 $ hg add c
396 $ hg ci -m 'add c'
353 $ hg ci -m 'add c'
397 $ cd ..
398 $ hg clone -q server repo
399 $ initclient repo
400 $ cd repo
401 $ hg up -q 0
354 $ hg up -q 0
402 $ echo b > a
355 $ echo b > a
403 $ hg ci -m 'mod a'
356 $ hg ci -m 'mod a'
404 created new head
357 created new head
405
358
406 $ hg log -G -T 'changeset: {node}\n desc: {desc}, phase: {phase}\n'
359 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
407 @ changeset: ef716627c70bf4ca0bdb623cfb0d6fe5b9acc51e
360 @ changeset: ef716627c70bf4ca0bdb623cfb0d6fe5b9acc51e
408 | desc: mod a, phase: draft
361 | desc: mod a
409 | o changeset: b1a6187e79fbce851bb584eadcb0cc4a80290fd9
362 | o changeset: b1a6187e79fbce851bb584eadcb0cc4a80290fd9
410 | | desc: add c, phase: public
363 | | desc: add c
411 | o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
364 | o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
412 |/ desc: mv a b, phase: public
365 |/ desc: mv a b
413 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
366 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
414 desc: initial, phase: public
367 desc: initial
415
368
416 $ hg rebase -s . -d 2
369 $ hg rebase -s . -d 2
417 rebasing 3:ef716627c70b "mod a" (tip)
370 rebasing 3:ef716627c70b "mod a" (tip)
@@ -422,10 +375,14 b' Move one file and add another file in th'
422 c
375 c
423 $ cat b
376 $ cat b
424 b
377 b
378 $ rm -rf repo
425
379
426 Merge test
380 Merge test
427 $ hg init server
381 ----------
428 $ cd server
382
383 $ hg init repo
384 $ initclient repo
385 $ cd repo
429 $ echo a > a
386 $ echo a > a
430 $ hg add a
387 $ hg add a
431 $ hg ci -m initial
388 $ hg ci -m initial
@@ -435,19 +392,15 b' Merge test'
435 $ hg mv a b
392 $ hg mv a b
436 $ hg ci -m 'mv a b'
393 $ hg ci -m 'mv a b'
437 created new head
394 created new head
438 $ cd ..
439 $ hg clone -q server repo
440 $ initclient repo
441 $ cd repo
442 $ hg up -q 2
395 $ hg up -q 2
443
396
444 $ hg log -G -T 'changeset: {node}\n desc: {desc}, phase: {phase}\n'
397 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
445 @ changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
398 @ changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
446 | desc: mv a b, phase: public
399 | desc: mv a b
447 | o changeset: b0357b07f79129a3d08a68621271ca1352ae8a09
400 | o changeset: b0357b07f79129a3d08a68621271ca1352ae8a09
448 |/ desc: modify a, phase: public
401 |/ desc: modify a
449 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
402 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
450 desc: initial, phase: public
403 desc: initial
451
404
452 $ hg merge 1
405 $ hg merge 1
453 merging b and a to b
406 merging b and a to b
@@ -457,35 +410,32 b' Merge test'
457 $ ls
410 $ ls
458 b
411 b
459 $ cd ..
412 $ cd ..
460 $ rm -rf server
461 $ rm -rf repo
413 $ rm -rf repo
462
414
463 Copy and move file
415 Copy and move file
464 $ hg init server
416 ------------------
465 $ initclient server
417
466 $ cd server
418 $ hg init repo
419 $ initclient repo
420 $ cd repo
467 $ echo a > a
421 $ echo a > a
468 $ hg add a
422 $ hg add a
469 $ hg ci -m initial
423 $ hg ci -m initial
470 $ hg cp a c
424 $ hg cp a c
471 $ hg mv a b
425 $ hg mv a b
472 $ hg ci -m 'cp a c, mv a b'
426 $ hg ci -m 'cp a c, mv a b'
473 $ cd ..
474 $ hg clone -q server repo
475 $ initclient repo
476 $ cd repo
477 $ hg up -q 0
427 $ hg up -q 0
478 $ echo b > a
428 $ echo b > a
479 $ hg ci -m 'mod a'
429 $ hg ci -m 'mod a'
480 created new head
430 created new head
481
431
482 $ hg log -G -T 'changeset: {node}\n desc: {desc}, phase: {phase}\n'
432 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
483 @ changeset: ef716627c70bf4ca0bdb623cfb0d6fe5b9acc51e
433 @ changeset: ef716627c70bf4ca0bdb623cfb0d6fe5b9acc51e
484 | desc: mod a, phase: draft
434 | desc: mod a
485 | o changeset: 4fc3fd13fbdb89ada6b75bfcef3911a689a0dde8
435 | o changeset: 4fc3fd13fbdb89ada6b75bfcef3911a689a0dde8
486 |/ desc: cp a c, mv a b, phase: public
436 |/ desc: cp a c, mv a b
487 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
437 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
488 desc: initial, phase: public
438 desc: initial
489
439
490 $ hg rebase -s . -d 1
440 $ hg rebase -s . -d 1
491 rebasing 2:ef716627c70b "mod a" (tip)
441 rebasing 2:ef716627c70b "mod a" (tip)
@@ -500,37 +450,34 b' Copy and move file'
500 $ cat c
450 $ cat c
501 b
451 b
502 $ cd ..
452 $ cd ..
503 $ rm -rf server
504 $ rm -rf repo
453 $ rm -rf repo
505
454
506 Do a merge commit with many consequent moves in one branch
455 Do a merge commit with many consequent moves in one branch
507 $ hg init server
456 ----------------------------------------------------------
508 $ initclient server
457
509 $ cd server
458 $ hg init repo
459 $ initclient repo
460 $ cd repo
510 $ echo a > a
461 $ echo a > a
511 $ hg add a
462 $ hg add a
512 $ hg ci -m initial
463 $ hg ci -m initial
513 $ echo b > a
464 $ echo b > a
514 $ hg ci -qm 'mod a'
465 $ hg ci -qm 'mod a'
515 $ cd ..
516 $ hg clone -q server repo
517 $ initclient repo
518 $ cd repo
519 $ hg up -q ".^"
466 $ hg up -q ".^"
520 $ hg mv a b
467 $ hg mv a b
521 $ hg ci -qm 'mv a b'
468 $ hg ci -qm 'mv a b'
522 $ hg mv b c
469 $ hg mv b c
523 $ hg ci -qm 'mv b c'
470 $ hg ci -qm 'mv b c'
524 $ hg up -q 1
471 $ hg up -q 1
525 $ hg log -G -T 'changeset: {node}\n desc: {desc}, phase: {phase}\n'
472 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
526 o changeset: d3efd280421d24f9f229997c19e654761c942a71
473 o changeset: d3efd280421d24f9f229997c19e654761c942a71
527 | desc: mv b c, phase: draft
474 | desc: mv b c
528 o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
475 o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
529 | desc: mv a b, phase: draft
476 | desc: mv a b
530 | @ changeset: ef716627c70bf4ca0bdb623cfb0d6fe5b9acc51e
477 | @ changeset: ef716627c70bf4ca0bdb623cfb0d6fe5b9acc51e
531 |/ desc: mod a, phase: public
478 |/ desc: mod a
532 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
479 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
533 desc: initial, phase: public
480 desc: initial
534
481
535 $ hg merge 3
482 $ hg merge 3
536 merging a and c to c
483 merging a and c to c
@@ -545,26 +492,23 b' Do a merge commit with many consequent m'
545 | o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
492 | o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
546 | | desc: mv a b, phase: draft
493 | | desc: mv a b, phase: draft
547 o | changeset: ef716627c70bf4ca0bdb623cfb0d6fe5b9acc51e
494 o | changeset: ef716627c70bf4ca0bdb623cfb0d6fe5b9acc51e
548 |/ desc: mod a, phase: public
495 |/ desc: mod a, phase: draft
549 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
496 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
550 desc: initial, phase: public
497 desc: initial, phase: draft
551 $ ls
498 $ ls
552 c
499 c
553 $ cd ..
500 $ cd ..
554 $ rm -rf server
555 $ rm -rf repo
501 $ rm -rf repo
556
502
557 Test shelve/unshelve
503 Test shelve/unshelve
558 $ hg init server
504 -------------------
559 $ initclient server
505
560 $ cd server
506 $ hg init repo
507 $ initclient repo
508 $ cd repo
561 $ echo a > a
509 $ echo a > a
562 $ hg add a
510 $ hg add a
563 $ hg ci -m initial
511 $ hg ci -m initial
564 $ cd ..
565 $ hg clone -q server repo
566 $ initclient repo
567 $ cd repo
568 $ echo b > a
512 $ echo b > a
569 $ hg shelve
513 $ hg shelve
570 shelved as default
514 shelved as default
@@ -572,11 +516,11 b' Test shelve/unshelve'
572 $ hg mv a b
516 $ hg mv a b
573 $ hg ci -m 'mv a b'
517 $ hg ci -m 'mv a b'
574
518
575 $ hg log -G -T 'changeset: {node}\n desc: {desc}, phase: {phase}\n'
519 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
576 @ changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
520 @ changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
577 | desc: mv a b, phase: draft
521 | desc: mv a b
578 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
522 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
579 desc: initial, phase: public
523 desc: initial
580 $ hg unshelve
524 $ hg unshelve
581 unshelving change 'default'
525 unshelving change 'default'
582 rebasing shelved changes
526 rebasing shelved changes
@@ -587,7 +531,6 b' Test shelve/unshelve'
587 $ cat b
531 $ cat b
588 b
532 b
589 $ cd ..
533 $ cd ..
590 $ rm -rf server
591 $ rm -rf repo
534 $ rm -rf repo
592
535
593 Test full copytrace ability on draft branch
536 Test full copytrace ability on draft branch
@@ -619,7 +562,7 b' File directory and base name changed in '
619 o changeset 81973cd24b58db2fdf18ce3d64fb2cc3284e9ab3
562 o changeset 81973cd24b58db2fdf18ce3d64fb2cc3284e9ab3
620 desc initial, phase: draft
563 desc initial, phase: draft
621
564
622 $ hg rebase -s . -d 1
565 $ hg rebase -s . -d 1 --config experimental.copytrace.sourcecommitlimit=100
623 rebasing 2:6207d2d318e7 "mod a" (tip)
566 rebasing 2:6207d2d318e7 "mod a" (tip)
624 merging dir2/b and dir1/a to dir2/b
567 merging dir2/b and dir1/a to dir2/b
625 saved backup bundle to $TESTTMP/repo/repo/.hg/strip-backup/6207d2d318e7-1c9779ad-rebase.hg (glob)
568 saved backup bundle to $TESTTMP/repo/repo/.hg/strip-backup/6207d2d318e7-1c9779ad-rebase.hg (glob)
@@ -627,11 +570,11 b' File directory and base name changed in '
627 a
570 a
628 b
571 b
629 $ cd ..
572 $ cd ..
630 $ rm -rf server
631 $ rm -rf repo
573 $ rm -rf repo
632
574
633 Move directory in one merge parent, while adding file to original directory
575 Move directory in one merge parent, while adding file to original directory
634 in other merge parent. File moved on rebase.
576 in other merge parent. File moved on rebase.
577
635 $ hg init repo
578 $ hg init repo
636 $ initclient repo
579 $ initclient repo
637 $ mkdir repo/dir1
580 $ mkdir repo/dir1
@@ -657,16 +600,16 b' in other merge parent. File moved on reb'
657 o changeset a235dcce55dcf42034c4e374cb200662d0bb4a13
600 o changeset a235dcce55dcf42034c4e374cb200662d0bb4a13
658 desc initial, phase: draft
601 desc initial, phase: draft
659
602
660 $ hg rebase -s . -d 1
603 $ hg rebase -s . -d 1 --config experimental.copytrace.sourcecommitlimit=100
661 rebasing 2:e8919e7df8d0 "mv dir1 dir2" (tip)
604 rebasing 2:e8919e7df8d0 "mv dir1 dir2" (tip)
662 saved backup bundle to $TESTTMP/repo/repo/.hg/strip-backup/e8919e7df8d0-f62fab62-rebase.hg (glob)
605 saved backup bundle to $TESTTMP/repo/repo/.hg/strip-backup/e8919e7df8d0-f62fab62-rebase.hg (glob)
663 $ ls dir2
606 $ ls dir2
664 a
607 a
665 dummy
608 dummy
666 $ rm -rf server
667 $ rm -rf repo
609 $ rm -rf repo
668
610
669 Testing the sourcecommitlimit config
611 Testing the sourcecommitlimit config
612 -----------------------------------
670
613
671 $ hg init repo
614 $ hg init repo
672 $ initclient repo
615 $ initclient repo
@@ -694,7 +637,7 b' Testing the sourcecommitlimit config'
694
637
695 When the sourcecommitlimit is small and we have more drafts, we use heuristics only
638 When the sourcecommitlimit is small and we have more drafts, we use heuristics only
696
639
697 $ hg rebase -s 8b6e13696 -d . --config experimental.copytrace.sourcecommitlimit=0
640 $ hg rebase -s 8b6e13696 -d .
698 rebasing 1:8b6e13696c38 "added more things to a"
641 rebasing 1:8b6e13696c38 "added more things to a"
699 other [source] changed a which local [dest] deleted
642 other [source] changed a which local [dest] deleted
700 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
643 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
@@ -706,7 +649,7 b' fullcopytracing'
706
649
707 $ hg rebase --abort
650 $ hg rebase --abort
708 rebase aborted
651 rebase aborted
709 $ hg rebase -s 8b6e13696 -d .
652 $ hg rebase -s 8b6e13696 -d . --config experimental.copytrace.sourcecommitlimit=100
710 rebasing 1:8b6e13696c38 "added more things to a"
653 rebasing 1:8b6e13696c38 "added more things to a"
711 merging foo/bar and a to foo/bar
654 merging foo/bar and a to foo/bar
712 saved backup bundle to $TESTTMP/repo/repo/repo/.hg/strip-backup/8b6e13696c38-fc14ac83-rebase.hg (glob)
655 saved backup bundle to $TESTTMP/repo/repo/repo/.hg/strip-backup/8b6e13696c38-fc14ac83-rebase.hg (glob)
General Comments 0
You need to be logged in to leave comments. Login now