bookmarks and branches

Bill Barry after.fallout at gmail.com
Wed Feb 25 10:37:49 CST 2009


Marko Käning wrote:
> Hi geeks,
>
> can someone tell me in a nutshell what the difference between the bookmark 
> extension over a normal branch is?
>   
The name of a branch is stored in the meta-data for a commit and so is 
part of history. When you commit again, the new commit takes the branch 
name from the first parent unless it was changed.
Bookmarks on the other hand are sorta like tags that automatically move 
when the head of that tree moves. A bookmark is not stored in the commit 
(or even in the repository).

This subtlety means a few things:
1. a bookmark can only point to one revision at a time whereas a named 
branch can have multiple heads
2. as of right now bookmarks do not transfer over the wire whereas 
branches do (I think work is being done on this front though)
3. bookmarks can be deleted, but branches are irrevocably part of 
history forever

I am sure other people can come up with more distinctions between them.
> I know that a branch can't be deleted, but a bookmark can. But is this the 
> only advantage?
>
> >From what I found on the wiki I couldn't really see the benefit, since I 
> thought that a branch would be involved anyway as soon as a change to a 
> bookmarked revision creates a new head. Following that branch wouldn't 
> need the bookmark, instead you'd just use the branch name to set your line 
> of development accordingly.
>
> Isn't this the same what you achieve with the bookmark?
>
> Looks like I am missing a point here... Can't imagine that it is only the 
> advantage of being able to delete bookmarks at any time. (Which is a plus, 
> I agree, but is it all?)
>
> Regards,
> Marko
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial
>
>   



More information about the Mercurial mailing list