comparison tests/test-split.t @ 2659:166ca0aba0ea stable

split: preserve author of the original changeset in the successors Previously, the new changesets were authored by the default user.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 25 Jun 2017 16:37:56 +0200
parents cbc7a69116bd
children e7079bba383d
comparison
equal deleted inserted replaced
2658:ae822f28b617 2659:166ca0aba0ea
22 > EOF 22 > EOF
23 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH 23 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
24 $ mkcommit() { 24 $ mkcommit() {
25 > echo "$1" > "$1" 25 > echo "$1" > "$1"
26 > hg add "$1" 26 > hg add "$1"
27 > hg ci -m "add $1" 27 > hg ci -m "add $1" $2 $3
28 > } 28 > }
29 29
30 30
31 Basic case, split a head 31 Basic case, split a head
32 $ hg init testsplit 32 $ hg init testsplit
33 $ cd testsplit 33 $ cd testsplit
34 $ mkcommit _a 34 $ mkcommit _a
35 $ mkcommit _b 35 $ mkcommit _b
36 $ mkcommit _c 36 $ mkcommit _c --user other-test-user
37 $ mkcommit _d 37 $ mkcommit _d
38 $ echo "change to a" >> _a 38 $ echo "change to a" >> _a
39 $ hg amend 39 $ hg amend
40 $ hg debugobsolete 40 $ hg debugobsolete
41 9e84a109b8eb081ad754681ee4b1380d17a3741f aa8f656bb307022172d2648be6fb65322f801225 0 (*) {'ef1': '*', 'user': 'test'} (glob) 41 1334a80b33c3f9873edab728fbbcf500eab61d2e d2fe56e71366c2c5376c89960c281395062c0619 0 (*) {'ef1': '8', 'user': 'test'} (glob)
42 f002b57772d7f09b180c407213ae16d92996a988 0 {9e84a109b8eb081ad754681ee4b1380d17a3741f} (*) {'ef1': '*', 'user': 'test'} (glob) 42 06be89dfe2ae447383f30a2984933352757b6fb4 0 {1334a80b33c3f9873edab728fbbcf500eab61d2e} (*) {'ef1': '0', 'user': 'test'} (glob)
43 43
44 To create commits with the number of split 44 To create commits with the number of split
45 $ echo 0 > num 45 $ echo 0 > num
46 $ cat > editor.sh << '__EOF__' 46 $ cat > editor.sh << '__EOF__'
47 > NUM=$(cat num) 47 > NUM=$(cat num)
89 record this change to '_d'? [Ynesfdaq?] y 89 record this change to '_d'? [Ynesfdaq?] y
90 90
91 no more change to split 91 no more change to split
92 92
93 $ hg debugobsolete 93 $ hg debugobsolete
94 9e84a109b8eb081ad754681ee4b1380d17a3741f aa8f656bb307022172d2648be6fb65322f801225 0 (*) {'ef1': '*', 'user': 'test'} (glob) 94 1334a80b33c3f9873edab728fbbcf500eab61d2e d2fe56e71366c2c5376c89960c281395062c0619 0 (*) {'ef1': '8', 'user': 'test'} (glob)
95 f002b57772d7f09b180c407213ae16d92996a988 0 {9e84a109b8eb081ad754681ee4b1380d17a3741f} (*) {'ef1': '*', 'user': 'test'} (glob) 95 06be89dfe2ae447383f30a2984933352757b6fb4 0 {1334a80b33c3f9873edab728fbbcf500eab61d2e} (*) {'ef1': '0', 'user': 'test'} (glob)
96 aa8f656bb307022172d2648be6fb65322f801225 a98b35e86cae589b61892127c5ec1c868e41d910 5410a2352fa3114883327beee89e3085eefac25c 0 (*) {'ef1': '*', 'user': 'test'} (glob) 96 d2fe56e71366c2c5376c89960c281395062c0619 2d8abdb827cdf71ca477ef6985d7ceb257c53c1b 033b3f5ae73db67c10de938fb6f26b949aaef172 0 (*) {'ef1': '13', 'user': 'test'} (glob)
97 $ hg glog 97 $ hg glog
98 @ changeset: 7:5410a2352fa3 98 @ changeset: 7:033b3f5ae73d
99 | tag: tip 99 | tag: tip
100 | user: test 100 | user: test
101 | date: Thu Jan 01 00:00:00 1970 +0000 101 | date: Thu Jan 01 00:00:00 1970 +0000
102 | summary: split2 102 | summary: split2
103 | 103 |
104 o changeset: 6:a98b35e86cae 104 o changeset: 6:2d8abdb827cd
105 | parent: 2:102002290587 105 | parent: 2:52149352b372
106 | user: test 106 | user: test
107 | date: Thu Jan 01 00:00:00 1970 +0000 107 | date: Thu Jan 01 00:00:00 1970 +0000
108 | summary: split1 108 | summary: split1
109 | 109 |
110 o changeset: 2:102002290587 110 o changeset: 2:52149352b372
111 | user: test 111 | user: other-test-user
112 | date: Thu Jan 01 00:00:00 1970 +0000 112 | date: Thu Jan 01 00:00:00 1970 +0000
113 | summary: add _c 113 | summary: add _c
114 | 114 |
115 o changeset: 1:37445b16603b 115 o changeset: 1:37445b16603b
116 | user: test 116 | user: test
142 atop:[9] _cprim 142 atop:[9] _cprim
143 move:[7] split2 143 move:[7] split2
144 atop:[10] split1 144 atop:[10] split1
145 working directory is now at * (glob) 145 working directory is now at * (glob)
146 $ hg log -r "desc(_cprim)" -v -p 146 $ hg log -r "desc(_cprim)" -v -p
147 changeset: 9:719157b217ac 147 changeset: 9:b434287e665c
148 parent: 1:37445b16603b 148 parent: 1:37445b16603b
149 user: test 149 user: other-test-user
150 date: Thu Jan 01 00:00:00 1970 +0000 150 date: Thu Jan 01 00:00:00 1970 +0000
151 files: _b _c 151 files: _b _c
152 description: 152 description:
153 _cprim 153 _cprim
154 154
196 196
197 Stop before splitting the commit completely creates a commit with all the 197 Stop before splitting the commit completely creates a commit with all the
198 remaining changes 198 remaining changes
199 199
200 $ hg debugobsolete 200 $ hg debugobsolete
201 9e84a109b8eb081ad754681ee4b1380d17a3741f aa8f656bb307022172d2648be6fb65322f801225 0 (*) {'ef1': '*', 'user': 'test'} (glob) 201 1334a80b33c3f9873edab728fbbcf500eab61d2e d2fe56e71366c2c5376c89960c281395062c0619 0 (*) {'ef1': '8', 'user': 'test'} (glob)
202 f002b57772d7f09b180c407213ae16d92996a988 0 {9e84a109b8eb081ad754681ee4b1380d17a3741f} (*) {'ef1': '*', 'user': 'test'} (glob) 202 06be89dfe2ae447383f30a2984933352757b6fb4 0 {1334a80b33c3f9873edab728fbbcf500eab61d2e} (*) {'ef1': '0', 'user': 'test'} (glob)
203 aa8f656bb307022172d2648be6fb65322f801225 a98b35e86cae589b61892127c5ec1c868e41d910 5410a2352fa3114883327beee89e3085eefac25c 0 (*) {'ef1': '*', 'user': 'test'} (glob) 203 d2fe56e71366c2c5376c89960c281395062c0619 2d8abdb827cdf71ca477ef6985d7ceb257c53c1b 033b3f5ae73db67c10de938fb6f26b949aaef172 0 (*) {'ef1': '13', 'user': 'test'} (glob)
204 10200229058723ce8d67f6612c1f6b4f73b1fe73 719157b217acc43d397369a448824ed4c7a302f2 0 (*) {'ef1': '*', 'user': 'test'} (glob) 204 52149352b372d39b19127d5bd2d488b1b63f9f85 b434287e665ce757ee5463a965cb3d119ca9e893 0 (*) {'ef1': '9', 'user': 'test'} (glob)
205 5d0c8b0f2d3e5e1ff95f93d7da2ba06650605ab5 0 {10200229058723ce8d67f6612c1f6b4f73b1fe73} (*) {'ef1': '*', 'user': 'test'} (glob) 205 7a4fc25a48a5797bb069563854455aecf738d8f2 0 {52149352b372d39b19127d5bd2d488b1b63f9f85} (*) {'ef1': '0', 'user': 'test'} (glob)
206 a98b35e86cae589b61892127c5ec1c868e41d910 286887947725085e03455d79649197feaef1eb9d 0 (*) {'ef1': '*', 'user': 'test'} (glob) 206 2d8abdb827cdf71ca477ef6985d7ceb257c53c1b e2b4afde39803bd42bb1374b230fca1b1e8cc868 0 (*) {'ef1': '4', 'user': 'test'} (glob)
207 5410a2352fa3114883327beee89e3085eefac25c 0b67cee46a7f2ad664f994027e7af95b36ae25fe 0 (*) {'ef1': '*', 'user': 'test'} (glob) 207 033b3f5ae73db67c10de938fb6f26b949aaef172 bb5e4f6020c74e7961a51fda635ea9df9b04dda8 0 (*) {'ef1': '4', 'user': 'test'} (glob)
208 719157b217acc43d397369a448824ed4c7a302f2 ced8fbcce3a7cd33f0e454d2cd63882ce1b6006b 73309fb98db840ba4ec5ad528346dc6ee0b39dcb 0 (*) {'ef1': '*', 'user': 'test'} (glob) 208 b434287e665ce757ee5463a965cb3d119ca9e893 ead2066d1dbf14833fe1069df1b735e4e9468c40 1188c4216eba37f18a1de6558564601d00ff2143 0 (*) {'ef1': '13', 'user': 'test'} (glob)
209 $ hg evolve --all 209 $ hg evolve --all
210 move:[10] split1 210 move:[10] split1
211 atop:[13] split4 211 atop:[13] split4
212 move:[11] split2 212 move:[11] split2
213 atop:[14] split1 213 atop:[14] split1
214 working directory is now at f200e612ac86 214 working directory is now at d74c6715e706
215 $ hg glog 215 $ hg glog
216 @ changeset: 15:f200e612ac86 216 @ changeset: 15:d74c6715e706
217 | tag: tip 217 | tag: tip
218 | user: test 218 | user: test
219 | date: Thu Jan 01 00:00:00 1970 +0000 219 | date: Thu Jan 01 00:00:00 1970 +0000
220 | summary: split2 220 | summary: split2
221 | 221 |
222 o changeset: 14:aec57822a8ff 222 o changeset: 14:3f134f739075
223 | user: test 223 | user: test
224 | date: Thu Jan 01 00:00:00 1970 +0000 224 | date: Thu Jan 01 00:00:00 1970 +0000
225 | summary: split1 225 | summary: split1
226 | 226 |
227 o changeset: 13:73309fb98db8 227 o changeset: 13:1188c4216eba
228 | user: test 228 | user: other-test-user
229 | date: Thu Jan 01 00:00:00 1970 +0000 229 | date: Thu Jan 01 00:00:00 1970 +0000
230 | summary: split4 230 | summary: split4
231 | 231 |
232 o changeset: 12:ced8fbcce3a7 232 o changeset: 12:ead2066d1dbf
233 | parent: 1:37445b16603b 233 | parent: 1:37445b16603b
234 | user: test 234 | user: other-test-user
235 | date: Thu Jan 01 00:00:00 1970 +0000 235 | date: Thu Jan 01 00:00:00 1970 +0000
236 | summary: split3 236 | summary: split3
237 | 237 |
238 o changeset: 1:37445b16603b 238 o changeset: 1:37445b16603b
239 | user: test 239 | user: test
251 $ hg book bookA 251 $ hg book bookA
252 $ hg book bookB 252 $ hg book bookB
253 $ echo "changetofilea" > _a 253 $ echo "changetofilea" > _a
254 $ hg amend 254 $ hg amend
255 $ hg book 255 $ hg book
256 bookA 17:39d16b69c75d 256 bookA 17:7a6b35779b85
257 * bookB 17:39d16b69c75d 257 * bookB 17:7a6b35779b85
258 $ hg glog -r "14::" 258 $ hg glog -r "14::"
259 @ changeset: 17:39d16b69c75d 259 @ changeset: 17:7a6b35779b85
260 | bookmark: bookA 260 | bookmark: bookA
261 | bookmark: bookB 261 | bookmark: bookB
262 | tag: tip 262 | tag: tip
263 | parent: 14:aec57822a8ff 263 | parent: 14:3f134f739075
264 | user: test 264 | user: test
265 | date: Thu Jan 01 00:00:00 1970 +0000 265 | date: Thu Jan 01 00:00:00 1970 +0000
266 | summary: split2 266 | summary: split2
267 | 267 |
268 o changeset: 14:aec57822a8ff 268 o changeset: 14:3f134f739075
269 | user: test 269 | user: test
270 ~ date: Thu Jan 01 00:00:00 1970 +0000 270 ~ date: Thu Jan 01 00:00:00 1970 +0000
271 summary: split1 271 summary: split1
272 272
273 $ hg split <<EOF 273 $ hg split <<EOF
295 examine changes to '_d'? [Ynesfdaq?] n 295 examine changes to '_d'? [Ynesfdaq?] n
296 296
297 created new head 297 created new head
298 Done splitting? [yN] y 298 Done splitting? [yN] y
299 $ hg glog -r "14::" 299 $ hg glog -r "14::"
300 @ changeset: 19:a2b5c9d9b362 300 @ changeset: 19:60ea019b0f8d
301 | bookmark: bookA 301 | bookmark: bookA
302 | bookmark: bookB 302 | bookmark: bookB
303 | tag: tip 303 | tag: tip
304 | user: test 304 | user: test
305 | date: Thu Jan 01 00:00:00 1970 +0000 305 | date: Thu Jan 01 00:00:00 1970 +0000
306 | summary: split6 306 | summary: split6
307 | 307 |
308 o changeset: 18:bf3402785e72 308 o changeset: 18:2c7a2e53f23b
309 | parent: 14:aec57822a8ff 309 | parent: 14:3f134f739075
310 | user: test 310 | user: test
311 | date: Thu Jan 01 00:00:00 1970 +0000 311 | date: Thu Jan 01 00:00:00 1970 +0000
312 | summary: split5 312 | summary: split5
313 | 313 |
314 o changeset: 14:aec57822a8ff 314 o changeset: 14:3f134f739075
315 | user: test 315 | user: test
316 ~ date: Thu Jan 01 00:00:00 1970 +0000 316 ~ date: Thu Jan 01 00:00:00 1970 +0000
317 summary: split1 317 summary: split1
318 318
319 $ hg book 319 $ hg book
320 bookA 19:a2b5c9d9b362 320 bookA 19:60ea019b0f8d
321 * bookB 19:a2b5c9d9b362 321 * bookB 19:60ea019b0f8d
322 322
323 Lastest revision is selected if multiple are given to -r 323 Lastest revision is selected if multiple are given to -r
324 $ hg split -r "desc(_a)::" 324 $ hg split -r "desc(_a)::"
325 (leaving bookmark bookB) 325 (leaving bookmark bookB)
326 0 files updated, 0 files merged, 1 files removed, 0 files unresolved 326 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
335 > [experimental] 335 > [experimental]
336 > evolution=createmarkers 336 > evolution=createmarkers
337 > evolutioncommands=split 337 > evolutioncommands=split
338 > EOF 338 > EOF
339 $ hg split -r "desc(split3)" 339 $ hg split -r "desc(split3)"
340 abort: cannot split commit: ced8fbcce3a7 not a head 340 abort: cannot split commit: ead2066d1dbf not a head
341 [255] 341 [255]
342 342
343 Changing evolution level to createmarkers 343 Changing evolution level to createmarkers
344 $ echo "[experimental]" >> $HGRCPATH 344 $ echo "[experimental]" >> $HGRCPATH
345 $ echo "evolution=createmarkers" >> $HGRCPATH 345 $ echo "evolution=createmarkers" >> $HGRCPATH