comparison tests/test-evolve.t @ 1697:093c445fd86a mercurial-3.6

merge with stable through 3.7 branch dropped the topic test and updated output with some minor difference Hg: Enter commit message. Lines beginning with 'HG:' are removed.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Thu, 05 May 2016 23:51:35 +0200
parents 61dd08f4dc62 898dfca94433
children dd6f090b7342 c92b286ab6f1
comparison
equal deleted inserted replaced
1604:61dd08f4dc62 1697:093c445fd86a
1 $ cat >> $HGRCPATH <<EOF 1 $ cat >> $HGRCPATH <<EOF
2 > [defaults] 2 > [defaults]
3 > amend=-d "0 0" 3 > amend=-d "0 0"
4 > fold=-d "0 0" 4 > fold=-d "0 0"
5 > metaedit=-d "0 0"
5 > [web] 6 > [web]
6 > push_ssl = false 7 > push_ssl = false
7 > allow_push = * 8 > allow_push = *
8 > [phases] 9 > [phases]
9 > publish = False 10 > publish = False
110 111
111 test kill and immutable changeset 112 test kill and immutable changeset
112 113
113 $ hg log -r 1 --template '{rev} {phase} {obsolete}\n' 114 $ hg log -r 1 --template '{rev} {phase} {obsolete}\n'
114 1 public stable 115 1 public stable
115 $ hg kill 1 116 $ hg prune 1
116 abort: cannot prune immutable changeset: 7c3bad9141dc 117 abort: cannot prune immutable changeset: 7c3bad9141dc
117 (see "hg help phases" for details) 118 (see "hg help phases" for details)
118 [255] 119 [255]
119 $ hg log -r 1 --template '{rev} {phase} {obsolete}\n' 120 $ hg log -r 1 --template '{rev} {phase} {obsolete}\n'
120 1 public stable 121 1 public stable
121 122
122 test simple kill 123 test simple kill
123 124
124 $ hg id -n 125 $ hg id -n
125 5 126 5
126 $ hg kill . 127 $ hg prune .
127 0 files updated, 0 files merged, 1 files removed, 0 files unresolved 128 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
128 working directory now at fbb94e3a0ecf 129 working directory now at fbb94e3a0ecf
129 1 changesets pruned 130 1 changesets pruned
130 $ hg qlog 131 $ hg qlog
131 4 - fbb94e3a0ecf add e (draft) 132 4 - fbb94e3a0ecf add e (draft)
134 1 - 7c3bad9141dc add b (public) 135 1 - 7c3bad9141dc add b (public)
135 0 - 1f0dee641bb7 add a (public) 136 0 - 1f0dee641bb7 add a (public)
136 137
137 test multiple kill 138 test multiple kill
138 139
139 $ hg kill 4 -r 3 140 $ hg prune 4 -r 3
140 0 files updated, 0 files merged, 1 files removed, 0 files unresolved 141 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
141 working directory now at 7c3bad9141dc 142 working directory now at 7c3bad9141dc
142 2 changesets pruned 143 2 changesets pruned
143 $ hg qlog 144 $ hg qlog
144 2 - 4538525df7e2 add c (draft) 145 2 - 4538525df7e2 add c (draft)
149 150
150 $ hg up 2 151 $ hg up 2
151 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 152 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
152 $ echo 4 > g 153 $ echo 4 > g
153 $ hg add g 154 $ hg add g
154 $ hg kill . 155 $ hg prune .
155 0 files updated, 0 files merged, 1 files removed, 0 files unresolved 156 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
156 working directory now at 7c3bad9141dc 157 working directory now at 7c3bad9141dc
157 1 changesets pruned 158 1 changesets pruned
158 $ hg st 159 $ hg st
159 A g 160 A g
787 $ echo b > b 788 $ echo b > b
788 $ hg ci -Am b 789 $ hg ci -Am b
789 adding b 790 adding b
790 $ hg mv a c 791 $ hg mv a c
791 $ hg ci -m c 792 $ hg ci -m c
792 $ hg kill .^ 793 $ hg prune .^
793 1 changesets pruned 794 1 changesets pruned
794 1 new unstable changesets 795 1 new unstable changesets
795 $ hg stab --any 796 $ hg stab --any
796 move:[15] c 797 move:[15] c
797 atop:[13] a 798 atop:[13] a
1446 o 36:43c3f5ef149f@default(draft) add uu 1447 o 36:43c3f5ef149f@default(draft) add uu
1447 | 1448 |
1448 1449
1449 $ hg status newlyadded 1450 $ hg status newlyadded
1450 A newlyadded 1451 A newlyadded
1452
1453 hg metaedit
1454 -----------
1455
1456 $ hg update --clean .
1457 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1458 $ rm newlyadded
1459 $ hg metaedit -r 0
1460 abort: cannot edit commit information for public revisions
1461 [255]
1462 $ hg metaedit --fold
1463 abort: revisions must be specified with --fold
1464 [255]
1465 $ hg metaedit -r 0 --fold
1466 abort: cannot fold public revisions
1467 [255]
1468 $ hg metaedit '36 + 42' --fold
1469 abort: cannot fold non-linear revisions (multiple roots given)
1470 [255]
1471 $ hg metaedit '36::39 + 41' --fold
1472 abort: cannot fold non-linear revisions (multiple heads given)
1473 [255]
1474 check that metaedit respects allowunstable
1475 $ hg metaedit '.^' --config 'experimental.evolution=createmarkers, allnewcommands'
1476 abort: cannot edit commit information in the middle of a stack
1477 (c904da5245b0 will be affected)
1478 [255]
1479 $ hg metaedit '18::20' --fold --config 'experimental.evolution=createmarkers, allnewcommands'
1480 abort: cannot fold chain not ending with a head or with branching
1481 [255]
1482 $ hg metaedit --user foobar
1483 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1484 $ hg log --template '{rev}: {author}\n' -r '42:' --hidden
1485 42: test
1486 43: foobar
1487 $ hg log --template '{rev}: {author}\n' -r .
1488 43: foobar
1489
1490 TODO: support this
1491 $ hg metaedit '.^::.'
1492 abort: editing multiple revisions without --fold is not currently supported
1493 [255]
1494
1495 $ HGEDITOR=cat hg metaedit '.^::.' --fold
1496 HG: This is a fold of 2 changesets.
1497 HG: Commit message of changeset 41.
1498
1499 amended
1500
1501 HG: Commit message of changeset 43.
1502
1503 will be evolved safely
1504
1505
1506
1507 HG: Enter commit message. Lines beginning with 'HG:' are removed.
1508 HG: Leave message empty to abort commit.
1509 HG: --
1510 HG: user: test
1511 HG: branch 'default'
1512 HG: changed a
1513 HG: changed newfile
1514 2 changesets folded
1515 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1516
1517 $ glog -r .
1518 @ 44:41bf1183869c@default(draft) amended
1519 |
1520
1521 no new commit is created here because the date is the same
1522 $ HGEDITOR=cat hg metaedit
1523 amended
1524
1525
1526 will be evolved safely
1527
1528
1529 HG: Enter commit message. Lines beginning with 'HG:' are removed.
1530 HG: Leave message empty to abort commit.
1531 HG: --
1532 HG: user: test
1533 HG: branch 'default'
1534 HG: changed a
1535 HG: changed newfile
1536 nothing changed
1537
1538 $ glog -r '.^::.'
1539 @ 44:41bf1183869c@default(draft) amended
1540 |
1541 o 36:43c3f5ef149f@default(draft) add uu
1542 |
1543
1544 TODO: don't create a new commit in this case
1545 $ hg metaedit --config defaults.metaedit=
1546 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1547 $ hg log -r '.^::.' --template '{rev}: {desc|firstline}\n'
1548 36: add uu
1549 45: amended
1550
1551 $ hg up .^
1552 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1553 $ hg metaedit --user foobar2 45
1554 $ hg log --template '{rev}: {author}\n' -r '42:' --hidden
1555 42: test
1556 43: foobar
1557 44: test
1558 45: test
1559 46: foobar2
1560 $ hg diff -r 45 -r 46 --hidden
1561
1562 'fold' one commit
1563 $ hg metaedit 39 --fold --user foobar3
1564 1 changesets folded
1565 $ hg log -r 47 --template '{rev}: {author}\n'
1566 47: foobar3