comparison tests/test-evolve.t @ 1696:898dfca94433 mercurial-3.7

mercurial-3.7: revert output change No feature regression but various output change
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Thu, 05 May 2016 22:22:30 +0200
parents 474db2d60202
children 093c445fd86a 83cf722eafc3
comparison
equal deleted inserted replaced
1676:9e18bcf5e850 1696:898dfca94433
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
788 $ echo b > b 789 $ echo b > b
789 $ hg ci -Am b 790 $ hg ci -Am b
790 adding b 791 adding b
791 $ hg mv a c 792 $ hg mv a c
792 $ hg ci -m c 793 $ hg ci -m c
793 $ hg kill .^ 794 $ hg prune .^
794 1 changesets pruned 795 1 changesets pruned
795 1 new unstable changesets 796 1 new unstable changesets
796 $ hg stab --any 797 $ hg stab --any
797 move:[15] c 798 move:[15] c
798 atop:[13] a 799 atop:[13] a
1447 o 36:43c3f5ef149f@default(draft) add uu 1448 o 36:43c3f5ef149f@default(draft) add uu
1448 | 1449 |
1449 1450
1450 $ hg status newlyadded 1451 $ hg status newlyadded
1451 A newlyadded 1452 A newlyadded
1453
1454 hg metaedit
1455 -----------
1456
1457 $ hg update --clean .
1458 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1459 $ rm newlyadded
1460 $ hg metaedit -r 0
1461 abort: cannot edit commit information for public revisions
1462 [255]
1463 $ hg metaedit --fold
1464 abort: revisions must be specified with --fold
1465 [255]
1466 $ hg metaedit -r 0 --fold
1467 abort: cannot fold public revisions
1468 [255]
1469 $ hg metaedit '36 + 42' --fold
1470 abort: cannot fold non-linear revisions (multiple roots given)
1471 [255]
1472 $ hg metaedit '36::39 + 41' --fold
1473 abort: cannot fold non-linear revisions (multiple heads given)
1474 [255]
1475 check that metaedit respects allowunstable
1476 $ hg metaedit '.^' --config 'experimental.evolution=createmarkers, allnewcommands'
1477 abort: cannot edit commit information in the middle of a stack
1478 (c904da5245b0 will be affected)
1479 [255]
1480 $ hg metaedit '18::20' --fold --config 'experimental.evolution=createmarkers, allnewcommands'
1481 abort: cannot fold chain not ending with a head or with branching
1482 [255]
1483 $ hg metaedit --user foobar
1484 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1485 $ hg log --template '{rev}: {author}\n' -r '42:' --hidden
1486 42: test
1487 43: foobar
1488 $ hg log --template '{rev}: {author}\n' -r .
1489 43: foobar
1490
1491 TODO: support this
1492 $ hg metaedit '.^::.'
1493 abort: editing multiple revisions without --fold is not currently supported
1494 [255]
1495
1496 $ HGEDITOR=cat hg metaedit '.^::.' --fold
1497 HG: This is a fold of 2 changesets.
1498 HG: Commit message of changeset 41.
1499
1500 amended
1501
1502 HG: Commit message of changeset 43.
1503
1504 will be evolved safely
1505
1506
1507
1508 HG: Enter commit message. Lines beginning with 'HG:' are removed.
1509 HG: Leave message empty to abort commit.
1510 HG: --
1511 HG: user: test
1512 HG: branch 'default'
1513 HG: changed a
1514 HG: changed newfile
1515 2 changesets folded
1516 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1517
1518 $ glog -r .
1519 @ 44:41bf1183869c@default(draft) amended
1520 |
1521
1522 no new commit is created here because the date is the same
1523 $ HGEDITOR=cat hg metaedit
1524 amended
1525
1526
1527 will be evolved safely
1528
1529
1530 HG: Enter commit message. Lines beginning with 'HG:' are removed.
1531 HG: Leave message empty to abort commit.
1532 HG: --
1533 HG: user: test
1534 HG: branch 'default'
1535 HG: changed a
1536 HG: changed newfile
1537 nothing changed
1538
1539 $ glog -r '.^::.'
1540 @ 44:41bf1183869c@default(draft) amended
1541 |
1542 o 36:43c3f5ef149f@default(draft) add uu
1543 |
1544
1545 TODO: don't create a new commit in this case
1546 $ hg metaedit --config defaults.metaedit=
1547 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1548 $ hg log -r '.^::.' --template '{rev}: {desc|firstline}\n'
1549 36: add uu
1550 45: amended
1551
1552 $ hg up .^
1553 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1554 $ hg metaedit --user foobar2 45
1555 $ hg log --template '{rev}: {author}\n' -r '42:' --hidden
1556 42: test
1557 43: foobar
1558 44: test
1559 45: test
1560 46: foobar2
1561 $ hg diff -r 45 -r 46 --hidden
1562
1563 'fold' one commit
1564 $ hg metaedit 39 --fold --user foobar3
1565 1 changesets folded
1566 $ hg log -r 47 --template '{rev}: {author}\n'
1567 47: foobar3