comparison tests/test-touch.t @ 5987:e97fbded40a5

branching: merge stable into default
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 06 Aug 2021 00:04:46 +0200
parents 65d4e47d7f26 4a09e95d29c9
children 1a13ac9ef30a
comparison
equal deleted inserted replaced
5973:8a7ad6ba2654 5987:e97fbded40a5
210 A a 210 A a
211 A b 211 A b
212 212
213 $ cd .. 213 $ cd ..
214 214
215 Check that touching a merge commit doesn't lose file changes (issue 6416)
216
217 $ hg init issue-6416
218 $ cd issue-6416
219 $ echo base > base
220 $ hg ci -Aqm base
221 $ echo left1 > left1
222 $ hg ci -Aqm left1
223 $ echo left2 > left2
224 $ hg ci -Aqm left2
225 $ hg up 0 -q
226 $ echo right1 > right1
227 $ hg ci -Aqm right1
228 $ echo right2 > right2
229 $ hg ci -Aqm right2
230 $ hg up 2 -q
231 $ hg merge 4 -q
232 $ hg ci -m merge
233 $ hg touch tip
234 $ hg glog --hidden
235 @ 6: merge
236 |\
237 +---x 5: merge
238 | |/
239 | o 4: right2
240 | |
241 | o 3: right1
242 | |
243 o | 2: left2
244 | |
245 o | 1: left1
246 |/
247 o 0: base
248
249 $ hg glog --hidden --rev 'min(desc("merge"))' --rev 'max(desc("merge"))'
250 @ 6: merge
251 |\
252 ~ ~
253 x 5: merge
254 |\
255 ~ ~
256 $ hg status --hidden --change 'min(desc("merge"))'
257 A right1
258 A right2
259 $ hg status --hidden --change 'max(desc("merge"))'
260 A right1
261 A right2
262 $ hg status --hidden --rev 'min(desc("merge"))' --rev 'max(desc("merge"))'
263 $ cd ..
264
265 Check that touching a merge commit doesn't lose copies
266
267 $ hg init merge-copies
268 $ cd merge-copies
269 $ echo base > base
270 $ hg ci -Aqm base
271 $ echo left > left
272 $ hg cp base copy-on-left
273 $ hg ci -Aqm left
274 $ hg up 0 -q
275 $ echo right > right
276 $ hg cp base copy-on-right
277 $ hg ci -Aqm right
278 $ hg up 1 -q
279 $ hg merge 2 -q
280 $ hg cp left merge-copy-left
281 $ hg cp right merge-copy-right
282 $ hg ci -m merge
283 $ hg touch tip
284 $ hg glog --hidden
285 @ 4: merge
286 |\
287 +---x 3: merge
288 | |/
289 | o 2: right
290 | |
291 o | 1: left
292 |/
293 o 0: base
294
295 $ hg glog --hidden --rev 'min(desc("merge"))' --rev 'max(desc("merge"))'
296 @ 4: merge
297 |\
298 ~ ~
299 x 3: merge
300 |\
301 ~ ~
302 $ hg debugpathcopies 'min(desc("base"))' 'min(desc("merge"))'
303 base -> copy-on-left
304 base -> copy-on-right
305 $ hg debugpathcopies 'min(desc("base"))' 'max(desc("merge"))'
306 base -> copy-on-left
307 base -> copy-on-right
308 $ hg debugpathcopies 'min(desc("left"))' 'min(desc("merge"))'
309 base -> copy-on-right
310 left -> merge-copy-left
311 $ hg debugpathcopies 'min(desc("left"))' 'max(desc("merge"))'
312 base -> copy-on-right
313 left -> merge-copy-left
314 $ hg debugpathcopies 'min(desc("right"))' 'min(desc("merge"))'
315 base -> copy-on-left
316 right -> merge-copy-right
317 $ hg debugpathcopies 'min(desc("right"))' 'max(desc("merge"))'
318 base -> copy-on-left
319 right -> merge-copy-right
320 $ cd ..
321
215 Make sure touch doesn't fail to warn about divergence (issue6107) 322 Make sure touch doesn't fail to warn about divergence (issue6107)
216 323
217 $ hg init touchdiv 324 $ hg init touchdiv
218 $ cd touchdiv 325 $ cd touchdiv
219 $ echo c > c 326 $ echo c > c
234 341
235 $ hg touch -r "desc('modified c')" --hidden -A 342 $ hg touch -r "desc('modified c')" --hidden -A
236 1 new content-divergent changesets 343 1 new content-divergent changesets
237 344
238 $ cd .. 345 $ cd ..
346
347 Touch preserves copies
348
349 $ hg init copies
350 $ cd copies
351 $ echo a > a
352 $ hg ci -Aqm a
353 $ hg cp a b
354 $ hg ci -Aqm 'copy a to b'
355 $ hg status --copies --change .
356 A b
357 a
358 $ hg touch
359 $ hg status --copies --change .
360 A b
361 a
362 $ cd ..