bookmarks features

Chad Dombrova chadrik at gmail.com
Thu Aug 26 16:20:02 CDT 2010


hi all,
i'm planning on implementing some bookmark features that i need at my
workplace, but i thought i'd post the ideas here to see if they could be
improved or would be useful for integration into mercurial.  i've tried to
design them to be fairly generic and hopefully generally useful:


Bookmark Namespaces
===================

use namespaces to avoid name clashes when pushing and pulling, and to inform
of a bookmark's source.

[bookmarks]
default-remote-namespace = remote
use-remote-namespaces = true

if ``bookmarks.use-remote-namespaces`` is enabled, when pulling bookmarks
the first name given to the remote path in [paths] (excluding default and
default-push) will be used for the namespace, otherwise
``bookmarks.default-remote-namespace`` will be used.

the namespace separator defaults to '|' but can also be specified using
``bookmarks.namespace-sep``



Dirstate Bookmarks
==================

allow pushing and pulling of bookmarks representing working copy parents.

to pull a bookmark for the parent of a remote's working copy::

$ hg pull -B . other

this feature requires bookmark namespaces to be enabled, to ensure that each
'.' is given a safe prefix in the local repo. assuming that it is, and that
``other`` appears in the [paths] section, the pulled bookmark would be named
``other|.``

to configure this behavior to happen automatically whenever pull is invoked,
add the following to the hgrc of your local repo::

[bookmarks]
track.remotes = true

to push your own working copy parent as a bookmark to a remote::

$ hg push -B . other

a bookmark will be added to the remote repo only if bookmark namespaces are
enabled there.


Shared Bookmarks
================

allows shared repositories to use a single shared set of bookmarks.

configure by setting::

[bookmarks]
shared = true

shared repositories with ``bookmarks.shared`` enabled use the bookmarks
stored in their source repo (the repo specified in .hg/sharedpath).

when shared bookmarks are enabled locally and bookmark namespaces are
enabled in the share's source repository, bookmarks created by the local
share will be prefixed with the namespace determined by the remote source.

in the following example, commands are executed in a shared repo, and its
source contains an entry in its [paths] section naming it ``share-1``::

$ hg bookmarks foo
$ hg bookmarks
 * share-1|foo

the bookmark ``share-1|foo`` will be available to all repos that share from
this source and that have ``bookmarks.shared`` enabled.


let me know what you think.

-chad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100826/7cecf08a/attachment.htm>


More information about the Mercurial-devel mailing list