1500 | |
1500 | |
1501 ~ |
1501 ~ |
1502 |
1502 |
1503 $ hg status newlyadded |
1503 $ hg status newlyadded |
1504 A newlyadded |
1504 A newlyadded |
1505 |
|
1506 hg metaedit |
|
1507 ----------- |
|
1508 |
|
1509 $ hg update --clean . |
|
1510 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1511 $ rm newlyadded |
|
1512 $ hg metaedit -r 0 |
|
1513 abort: cannot edit commit information for public revisions |
|
1514 [255] |
|
1515 $ hg metaedit --fold |
|
1516 abort: revisions must be specified with --fold |
|
1517 [255] |
|
1518 $ hg metaedit -r 0 --fold |
|
1519 abort: cannot fold public revisions |
|
1520 [255] |
|
1521 $ hg metaedit '36 + 42' --fold |
|
1522 abort: cannot fold non-linear revisions (multiple roots given) |
|
1523 [255] |
|
1524 $ hg metaedit '36::39 + 41' --fold |
|
1525 abort: cannot fold non-linear revisions (multiple heads given) |
|
1526 [255] |
|
1527 check that metaedit respects allowunstable |
|
1528 $ hg metaedit '.^' --config 'experimental.evolution=createmarkers, allnewcommands' |
|
1529 abort: cannot edit commit information in the middle of a stack |
|
1530 (c904da5245b0 will become unstable and new unstable changes are not allowed) |
|
1531 [255] |
|
1532 $ hg metaedit '18::20' --fold --config 'experimental.evolution=createmarkers, allnewcommands' |
|
1533 abort: cannot fold chain not ending with a head or with branching |
|
1534 (new unstable changesets are not allowed) |
|
1535 [255] |
|
1536 $ hg metaedit --user foobar |
|
1537 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1538 $ hg log --template '{rev}: {author}\n' -r '42:' --hidden |
|
1539 42: test |
|
1540 43: foobar |
|
1541 $ hg log --template '{rev}: {author}\n' -r . |
|
1542 43: foobar |
|
1543 |
|
1544 TODO: support this |
|
1545 $ hg metaedit '.^::.' |
|
1546 abort: editing multiple revisions without --fold is not currently supported |
|
1547 [255] |
|
1548 |
|
1549 $ HGEDITOR=cat hg metaedit '.^::.' --fold |
|
1550 HG: This is a fold of 2 changesets. |
|
1551 HG: Commit message of changeset 41. |
|
1552 |
|
1553 amended |
|
1554 |
|
1555 HG: Commit message of changeset 43. |
|
1556 |
|
1557 will be evolved safely |
|
1558 |
|
1559 |
|
1560 |
|
1561 HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
1562 HG: Leave message empty to abort commit. |
|
1563 HG: -- |
|
1564 HG: user: test |
|
1565 HG: branch 'default' |
|
1566 HG: changed a |
|
1567 HG: changed newfile |
|
1568 2 changesets folded |
|
1569 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1570 |
|
1571 $ glog -r . |
|
1572 @ 44:41bf1183869c@default(draft) amended |
|
1573 | |
|
1574 ~ |
|
1575 |
|
1576 no new commit is created here because the date is the same |
|
1577 $ HGEDITOR=cat hg metaedit |
|
1578 amended |
|
1579 |
|
1580 |
|
1581 will be evolved safely |
|
1582 |
|
1583 |
|
1584 HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
1585 HG: Leave message empty to abort commit. |
|
1586 HG: -- |
|
1587 HG: user: test |
|
1588 HG: branch 'default' |
|
1589 HG: changed a |
|
1590 HG: changed newfile |
|
1591 nothing changed |
|
1592 |
|
1593 $ glog -r '.^::.' |
|
1594 @ 44:41bf1183869c@default(draft) amended |
|
1595 | |
|
1596 o 36:43c3f5ef149f@default(draft) add uu |
|
1597 | |
|
1598 ~ |
|
1599 |
|
1600 TODO: don't create a new commit in this case, we should take the date of the |
|
1601 old commit (we add a default date with a value to show that metaedit is taking |
|
1602 the current date to generate the hash, this way we still have a stable hash |
|
1603 but highlight the bug) |
|
1604 $ hg metaedit --config defaults.metaedit= --config devel.default-date="42 0" |
|
1605 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1606 $ hg log -r '.^::.' --template '{rev}: {desc|firstline}\n' |
|
1607 36: add uu |
|
1608 45: amended |
|
1609 |
|
1610 $ hg up .^ |
|
1611 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1612 $ hg metaedit --user foobar2 45 |
|
1613 $ hg log --template '{rev}: {author}\n' -r '42:' --hidden |
|
1614 42: test |
|
1615 43: foobar |
|
1616 44: test |
|
1617 45: test |
|
1618 46: foobar2 |
|
1619 $ hg diff -r 45 -r 46 --hidden |
|
1620 |
|
1621 'fold' one commit |
|
1622 $ hg metaedit 39 --fold --user foobar3 |
|
1623 1 changesets folded |
|
1624 $ hg log -r 47 --template '{rev}: {author}\n' |
|
1625 47: foobar3 |
|