A Scalable, User-Friendly Source Control System.
Go to file
Ryan McElroy 4d32a9e3bd remotenames: refactor outputname to outputbranches
Now that we have outputbookmarks that sorts differently for bookmarks,
rename outputname and make it simpler and less generic
2015-01-28 15:26:42 -08:00
tests remotenames: let's not crash when remotenames don't exist 2015-01-16 16:08:04 -08:00
.hgignore remotebranches: add hgignore 2010-01-25 16:48:45 -06:00
Makefile all-version-tests: add 3.1.1 2014-10-03 12:43:22 -04:00
README remotenames: do a bulk search and replace 2014-03-31 19:27:54 -05:00
remotenames.py remotenames: refactor outputname to outputbranches 2015-01-28 15:26:42 -08:00
setup.py remotenames: do a bulk search and replace 2014-03-31 19:27:54 -05:00

.. -*-restructuredtext-*-

==============
remotenames
==============
Keep track of remote branch heads in Mercurial.

With this extension installed, Mercurial gains one new feature: when
you pull from a repository listed in .hg/hgrc's ``[paths]`` section,
you get output similar to the following::

 @  3[tip]   7c2fd3b9020c   2009-04-27 18:04 -0500   durin42
 |    Add delta
 |
 o  2[default/default]   030b686bedc4   2009-04-27 18:04 -0500   durin42
 |    Add gamma
 |
 o  1[stable/default]   c561b4e977df   2009-04-27 18:04 -0500   durin42
 |    Add beta
 |
 o  0   d8d2fcd0e319   2009-04-27 18:04 -0500   durin42
      Add alpha

What this output is showing is that the head of the default branch in
a repo at path ``stable`` is ``c561b4e977df``, and the head of default
in the repo at path ``default`` is at ``030b686bedc4``. This is
accomplished by sending a single extra request to the Mercurial server
after the pull is complete.  The nature of this request (branchheads)
requires that the server be Mercurial 1.3 or newer.

This extension should work properly with paths from the schemes extension
included with Mercurial 1.4 and later. Other extensions which perform varying
kinds of manipulation on the repository path may not function as expected.

When revsets are available (Mercurial 1.7 and later), remotenames
makes three new revsets available: ``pushed()``, ``upstream()`` and
``remotenames()``. The ``pushed()`` revset returns all revisions
that are have been pushed to any repository tracked by
remotenames. The ``upstream()`` set is those revisions which are in
a repository whose path is listed in the ``upstream`` field of the
``[remotenames]`` configuration section. If there is no
``remotenames.upstream`` setting, it defaults to behaving
identically to ``pushed()``. The ``remotenames()`` revset simply
returns all remote branches head changesets.

When template keywords can be registered (Mercurial 1.5 and later),
remotenames adds a ``remotenames`` keyword returning a space
separated list of all names of remote branches heads on a changeset.