Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hg: Active bookmark vs. current branch

Tags:

mercurial

I'm new to Hg bookmarks, have only used Hg branches before (and Git experience). Though I have read the bookmarks documentation, it's not clear to me whether they work on-top of branches or independent on them. Is it possible that a branch is checked out as well as a bookmark (active bookmark)? If that's the case, will the bookmark always have precedence? If not, does checking out a bookmark "deactivates" the current branch or visa versa? Is it possible to have a bookmark has the same name as a branch?

like image 611
Thomas S. Avatar asked Nov 16 '25 18:11

Thomas S.


1 Answers

Generally you check out a single changeset. A bookmark always indicates a single changeset. A (named) branch usually has many changesets (which all are part of that branch). When you update to a branch, mercurial updates to the newest changeset in that branch.

Bookmarks and branches are independent. However, you can of course have checked out bookmark FUNNY_STUFF which incidentially is part of your branch JOYRIDE. And when bookmark FUNNY_STUFF is even the newest commit in branch JOYRIDE, then checking out FUNNY_STUFF or JOYRIDE will even result in the same changeset being checked out.

like image 58
planetmaker Avatar answered Nov 19 '25 11:11

planetmaker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!