comparison docs/user-guide.rst @ 1270:0683e3030316 stable

docs: cover 'touch' command
author Greg Ward <greg@gerg.ca>
date Tue, 14 Apr 2015 12:01:05 -0400
parents 250835154f8f
children 83d2c9637e89
comparison
equal deleted inserted replaced
1269:250835154f8f 1270:0683e3030316
570 570
571 571
572 Example 11: Recover an obsolete changeset 572 Example 11: Recover an obsolete changeset
573 ========================================= 573 =========================================
574 574
575 TODO 575 Sometimes you might obsolete a changeset, and then change your mind. You'll
576 probably start looking for an “unobsolete” command to restore a changeset
577 to normal state. For complicated implementation reasons, that command
578 doesn't exist. (If you have already pushed an obsolescence marker to
579 another repo, then Mercurial would need a way to revoke that remote
580 obsolesence marker. That's a hard problem.)
581
582 Instead, ``evolve`` provides a ``touch`` command to resurrect an
583 obsolete changeset. An unexpected quirk: you almost certainly need to
584 use ``--hidden``, since obsolete changesets tend to be hidden, and you
585 can't reference a hidden changeset otherwise. Typical usage thus looks
586 like ::
587
588 $ hg --hidden touch REV
589
590 This creates a new, normal changeset which is the same as ``REV``—except
591 with a different changeset ID. The new changeset will have the same parent
592 as ``REV``, and will be a successor of ``REV``.
593
594 The current implementation of ``hg touch`` is not ideal, and is likely to
595 change in the future. Consider the history in Figure 12, where revision 27
596 is obsolete and the child of 26, also obsolete. If we ``hg touch 27``, that
597 creates a new revision which is a non-obsolete child of 26—i.e., it is
598 unstable. It's also *divergent*, another type of trouble that we'll learn
599 about in the `next section`_.
600
601 .. _`next section`: sharing.html