Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3480856
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:23:31+00:00 2026-05-18T10:23:31+00:00

I read this document: A Guide to Branching with Mercurial , specifically the section

  • 0

I read this document: A Guide to Branching with Mercurial, specifically the section titled Branching with Bookmarks.

It says:

Now you’ve got two bookmarks (essentially a tag) for your two branches at the current changeset.

To switch to one of these branches you can use hg update feature to update to the tip changeset of that branch and mark yourself as working on that branch. When you commit, it will move the bookmark to the newly created changeset.

I tried this, but it ended up moving both bookmarks at the same time.

Is that guide wrong, outdated, or did I do something wrong? Note that I know that having bookmarks on separate branches only moves the bookmark related to the branch I’m currently working on, but that guide (which a lot of people says is the definite guide to this) specifically says the above text, which indicates that it should’ve worked by "telling" Mercurial which bookmark (branch) I’m working on.

Testing shows otherwise though.

Any ideas?

Example:

> hg init
> echo 1 >test.txt
> hg commit -m "initial" --addremove
adding test.txt

> hg bookmark main
> hg bookmark feature
> hg log
changeset:   0:c56ceb49ee20
tag:         feature
tag:         main
tag:         tip
user:        Lasse V. Karlsen <lasse@vkarlsen.no>
date:        Tue Nov 30 23:06:16 2010 +0100
summary:     initial

> hg update feature
0 files updated, 0 files merged, 0 files removed, 0 files unresolved

> echo 2 >test2.txt
> hg commit -m "feature 1" --addremove
adding test2.txt

> hg log
changeset:   1:9f2f5869b57b
tag:         feature                             <---- both were moved
tag:         main                                <----
tag:         tip
user:        Lasse V. Karlsen <lasse@vkarlsen.no>
date:        Tue Nov 30 23:06:45 2010 +0100
summary:     feature 1

changeset:   0:c56ceb49ee20
user:        Lasse V. Karlsen <lasse@vkarlsen.no>
date:        Tue Nov 30 23:06:16 2010 +0100
summary:     initial
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T10:23:32+00:00Added an answer on May 18, 2026 at 10:23 am

    If I got you right, you want only the bookmark you’ve updated to move on the next commit. For this purpose the bookmarks extensions has the track.current option.

    From BookmarksExtension:

    By default, when several bookmarks point to the same changeset, they will all move forward together. It is possible to obtain a more Git-like experience by adding the following configuration option to your .hgrc

    [bookmarks]
    track.current = True
    

    In your example, this would keep the main bookmark at revision 0.

    If the track.current option is enabled, the currently active bookmark is annotated with an asterisk in the output of hg bookmarks.

    UPDATE: Since Mercurial 1.8 the default behavior is to only move the current bookmark, i.e. the above mentioned option is not needed anymore [1].

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i read this statement from a book i read The Document Object Model or
Recently I read through this Developer Works Document . The document is all about
I'd like to add search interface in TabView. I read this document. But it
I have read this document Initializing static array of strings (C++)? and tried to
I have a query that looks like this Document document = DocDAO.getSession().read(someId); MyFile file
I read this PHP RegEx page , but either I'm missing something, misreading something,
I read this answer and its comments and I'm curious: Are there any reasons
I read this post last night, and I noticed it was from 2006. I
I read This article and i found it interesting. To sum it up for
I read this story on slashdot today where they announce a new parallel programming

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.