1542 'working directory and its descendants')), |
1542 'working directory and its descendants')), |
1543 ('c', 'continue', False, _('continue an interrupted evolution')), |
1543 ('c', 'continue', False, _('continue an interrupted evolution')), |
1544 ] + mergetoolopts, |
1544 ] + mergetoolopts, |
1545 _('[OPTIONS]...')) |
1545 _('[OPTIONS]...')) |
1546 def evolve(ui, repo, **opts): |
1546 def evolve(ui, repo, **opts): |
1547 """solve troubles in your repository |
1547 """solve troubled changesets in your repository |
1548 |
1548 |
1549 - rebase unstable changesets to make them stable again, |
1549 Modifying history can lead to various types of troubled changesets: unstable, |
1550 - create proper diffs from bumped changesets, |
1550 bumped, or divergent. The evolve command resolves your troubles by executing one |
1551 - fuse divergent changesets back together, |
1551 of the following actions: |
1552 - update to a successor if the working directory parent is |
1552 |
1553 obsolete |
1553 - update working copy to a successor |
1554 |
1554 - rebase an unstable changeset |
1555 If no argument are passed and the current working copy parent is obsolete, |
1555 - extract the desired changes from a bumped changeset |
1556 :hg:`evolve` will update the working copy to the successors of this working |
1556 - fuse divergent changesets back together |
1557 copy parent. If the working copy parent is not obsolete (and still no |
1557 |
1558 argument passed) each invocation of :hg:`evolve` will evolve a single |
1558 If you pass no arguments, evolve works in automatic mode: it will execute a |
1559 unstable changeset, It will only select a changeset to be evolved if it |
1559 single action to reduce instability related to your working copy. There are two |
1560 will result in a new children for the current working copy parent or its |
1560 cases for this action. First, if the parent of your working copy is obsolete, |
1561 descendants. The working copy will be updated on the result |
1561 evolve updates to the parent's successor. Second, if the working copy parent is |
1562 (this last behavior will most likely to change in the future). |
1562 not obsolete but has obsolete predecessors, then evolve determines if there is an |
1563 You can evolve all the unstable changesets that will be evolved on the |
1563 unstable changeset that can be rebased onto the working copy parent in order to |
1564 parent of the working copy and all its descendants recursively by using |
1564 reduce instability. If so, evolve rebases that changeset. If not, evolve refuses |
1565 :hg:`evolve` --all. |
1565 to guess your intention, and gives a hint about what you might want to do next. |
1566 |
1566 |
1567 You can decide to evolve other categories of trouble using the --divergent |
1567 Any time evolve creates a changeset, it updates the working copy to the new |
1568 and --bumped flags. If no other option are specified, this will try to |
1568 changeset. (Currently, every successful evolve operation involves an update as |
1569 solve the specified troubles for the working copy parent. |
1569 well; this may change in future.) |
1570 |
1570 |
1571 You can also evolve changesets affected by troubles of the selected |
1571 Automatic mode only handles common use cases. For example, it avoids taking |
1572 category using the --rev options. You can pick the next one anywhere in the |
1572 action in the case of ambiguity, and it ignores unstable changesets that are not |
1573 repo using --any. |
1573 related to your working copy. It also refuses to solve bumped or divergent |
1574 |
1574 changesets unless you explicity request such behavior (see below). |
1575 You can evolve all the changesets affected by troubles of the selected |
1575 |
1576 category using --all --any. |
1576 Eliminating all instability around your working copy may require multiple |
1577 |
1577 invocations of :hg:`evolve`. Alternately, use ``--all`` to recursively select and |
1578 The working directory is updated to the newly created revision. |
1578 evolve all unstable changesets that can be rebased onto the working copy parent. |
|
1579 This is more powerful than successive invocations, since ``--all`` handles |
|
1580 ambiguous cases (e.g. unstable changesets with multiple children) by evolving all |
|
1581 branches. |
|
1582 |
|
1583 When your repository cannot be handled by automatic mode, you might need to use |
|
1584 ``--rev`` to specify a changeset to evolve. For example, if you have an unstable |
|
1585 changeset that is not related to the working copy parent, you could use ``--rev`` |
|
1586 to evolve it. Or, if some changeset has multiple unstable children, evolve in |
|
1587 automatic mode refuses to guess which one to evolve; you have to use ``--rev`` |
|
1588 in that case. |
|
1589 |
|
1590 Alternately, ``--any`` makes evolve search for the next evolvable changeset |
|
1591 regardless of whether it is related to the working copy parent. |
|
1592 |
|
1593 You can supply multiple revisions to evolve multiple troubled changesets in a |
|
1594 single invocation. In revset terms, ``--any`` is equivalent to ``--rev |
|
1595 first(unstable())``. ``--rev`` and ``--all`` are mutually exclusive, as are |
|
1596 ``--rev`` and ``--any``. |
|
1597 |
|
1598 ``hg evolve --any --all`` is useful for cleaning up instability across all |
|
1599 branches, letting evolve figure out the appropriate order and destination. |
|
1600 |
|
1601 When you have troubled changesets that are not unstable, :hg:`evolve` refuses to |
|
1602 consider them unless you specify the category of trouble you wish to resolve, |
|
1603 with ``--bumped`` or ``--divergent``. These options are currently mutually |
|
1604 exclusive with each other and with ``--unstable`` (the default). You can combine |
|
1605 ``--bumped`` or ``--divergent`` with ``--rev``, ``--all``, or ``--any``. |
|
1606 |
1579 """ |
1607 """ |
1580 |
1608 |
1581 # Options |
1609 # Options |
1582 contopt = opts['continue'] |
1610 contopt = opts['continue'] |
1583 anyopt = opts['any'] |
1611 anyopt = opts['any'] |