Mercurial > hg
comparison tests/test-graft.t @ 38149:d1690a64268e
graft: add test for reading old graftstate files with new mechanism
This tests the reading of old graftstate file using the new logic. The tests
shows that if user is in middle of a graft and then updates their mercurial to
the version where we have new graftstate format, we can still read the old graft
state format files correctly.
Differential Revision: https://phab.mercurial-scm.org/D2597
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Wed, 28 Feb 2018 03:07:48 +0530 |
parents | 4441705b7111 |
children | 108ebd8eff5c |
comparison
equal
deleted
inserted
replaced
38148:476324a304b2 | 38149:d1690a64268e |
---|---|
1371 grafting 2:42127f193bcd "b" | 1371 grafting 2:42127f193bcd "b" |
1372 grafting 7:d3c3f2b38ecc "xx" | 1372 grafting 7:d3c3f2b38ecc "xx" |
1373 note: graft of 7:d3c3f2b38ecc created no changes to commit | 1373 note: graft of 7:d3c3f2b38ecc created no changes to commit |
1374 | 1374 |
1375 $ cd .. | 1375 $ cd .. |
1376 | |
1377 Testing the reading of old format graftstate file with newer mercurial | |
1378 | |
1379 $ hg init oldgraft | |
1380 $ cd oldgraft | |
1381 $ for ch in a b c; do echo foo > $ch; hg add $ch; hg ci -Aqm "added "$ch; done; | |
1382 $ hg log -GT "{rev}:{node|short} {desc}\n" | |
1383 @ 2:8be98ac1a569 added c | |
1384 | | |
1385 o 1:80e6d2c47cfe added b | |
1386 | | |
1387 o 0:f7ad41964313 added a | |
1388 | |
1389 $ hg up 0 | |
1390 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
1391 $ echo bar > b | |
1392 $ hg add b | |
1393 $ hg ci -m "bar to b" | |
1394 created new head | |
1395 $ hg graft -r 1 -r 2 | |
1396 grafting 1:80e6d2c47cfe "added b" | |
1397 merging b | |
1398 warning: conflicts while merging b! (edit, then use 'hg resolve --mark') | |
1399 abort: unresolved conflicts, can't continue | |
1400 (use 'hg resolve' and 'hg graft --continue') | |
1401 [255] | |
1402 | |
1403 Writing the nodes in old format to graftstate | |
1404 | |
1405 $ hg log -r 1 -r 2 -T '{node}\n' > .hg/graftstate | |
1406 $ echo foo > b | |
1407 $ hg resolve -m | |
1408 (no more unresolved files) | |
1409 continue: hg graft --continue | |
1410 $ hg graft --continue | |
1411 grafting 1:80e6d2c47cfe "added b" | |
1412 grafting 2:8be98ac1a569 "added c" |