Hg: Active bookmark vs. current branch

245 Views Asked by At

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?

1

There are 1 best solutions below

0
On

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.