Announce hg bookmarks extension
David Soria Parra
sn_ at gmx.net
Wed Oct 8 18:50:50 CDT 2008
Hi list,
as some of you might have already noticed, I recently worked on
a extension that brings commit bookmarks to Mercurial. It is loosely
based on Matt's conception of bookmarks [1]. I want to announce it on
the list to get a little bit more attention and maybe there are people
interested in joining the project, enhancing the code base and the
extensions usability.
Bookmarks are markers on commits that move on commit. Therefore you can
do a 'hg book newfeature' and work on that and the bookmark will move
forward with every commit you do.
Bookmarks can be used to access the commit whenever a usual lookup is
allowed, therefore you can merge and update bookmarks by their names.
A short example would be
$ hg book ds/feature-x
.. hack .. hack ..
$ hg commit
.. hack .. hack ..
$ hg commit
$ hg update 4
# go back to old rev
$ hg merge ds/feature-x
As people might think of bookmarks as git branches, they should be aware
that in some cases bookmarks differ from git branches. The most
important difference, I guess is, that 'every' bookmark on a certain
commit moves if you put another commit on top of it.
$ hg book ds/feature-x
$ hg book ds/feature-y
$ hg book
* ds/feature-x 12:560c33810ecf
* ds/feature-y 12:560c33810ecf
$ hg commit
* ds/feature-x 13:a44cdef33fab
* ds/feature-y 13:a44cdef33fab
A disucssion if we want to introduce a HEAD ref like git does which
forces just one bookmark
to be updated at a time is welcomed.
Code
You find the code of the current version 0.2.0 at
http://www.bitbucket.org/segv/hgbookmarks/overview/
For sure patches are always welcomed.
Stability
The base api should be stable, but as we recently changed the way how
we interact with the repository, there might be some userbility issues.
Nevertheless the extension will not screw your repository.
The extension was tested with recent crew repository of Mercurial
and mq enabled.
Known issues
hg rollback doesn't rollback bookmarks
Thanks
#mercurial for suggestions
Ronny for getting rid of 'monkeypatching'
Martin for Python 2.4 compatibility
David
[1] http://www.selenic.com/pipermail/mercurial-devel/2008-March/005602.html
More information about the Mercurial
mailing list