sapling/eden/scm/newdoc/dev/internals/Visibility.rst
Mark Thomas 12e94a142a newdoc: Add mutation and visibility documentation
Summary: Add Mercurial Developer Guide documentation for Mutation and Visibility.

Reviewed By: quark-zju

Differential Revision: D20534279

fbshipit-source-id: 3f06de79b5efe3903f4d1baf76fa2030ee58e7f4
2020-03-20 04:09:32 -07:00

41 lines
1.4 KiB
ReStructuredText

Visibility
==========
.. note::
This document describes new-style visibility and narrow-heads.
The data storage of Mercurial repositories can contain commits other than the
ones that are currently visible in the repository. For example, when a commit
is amended, the old commit is hidden.
There are three categories of commits: public, draft, and hidden.
* Mercurial considers any commit that is an ancestor of a non-scratch remote
bookmark to be **public**.
* For draft commits, Mercurial explicitly tracks visible draft heads, which are
the heads of all draft stacks. These are kept in ``.hg/store/visibleheads``
and in the metalog. Commits which are not public, but are ancestors of draft
heads, are **draft**.
* All other commits are **hidden**.
Hidden commits are still accessible via commit hashes or revsets like
``predecessors()``, however revsets like ``all()``, ``children()`` and
``descendants()`` will not expose hidden commits by default. Accessing a
hidden commit used to be an error before narrow-heads.
A commit is visible, and so shows up in commands like ``smartlog`` if it is an
ancestor of:
* Any non-scratch remote bookmark. These are public commits.
* Any visible draft head. These are draft commits.
* The current working copy. Checking out a hidden commit temporarily makes it
and its ancestors visible.
The ``directaccess`` extension also temporarily unhides any commit specified by
hash for the duration of the command.