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 986801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:22:39+00:00 2026-05-16T05:22:39+00:00

I discovered today that I can switch back to a branch even after I

  • 0

I discovered today that I can switch back to a branch even after I closed it. Why?

hg init abc
cd abc
echo 'readme1' > README1.txt
hg ci -Am "1st commit"
hg branch other-branch
echo 'readme2' > README2.txt
hg ci -Am "2nd commit" 
hg update default
hg merge other-branch
hg ci -m "Merged other-branch into default"
hg update other-branch
hg ci -m "Closing other branch" --close-branch
hg update default

now I think I’m not supposed to do this

hg update other-branch

but it works ok

It confuses me and makes me feel somewhat uneasy.

UPDATE: sorry forgot to indicate that I’m using HG v.1.6

  • 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-16T05:22:39+00:00Added an answer on May 16, 2026 at 5:22 am

    Like Amber said, when you close a branch, it just records that it is closed. As a consequence when you do “hg branches” you will just see “default“, and not “other-branch“.

    However, as soon as you switch to this branch and commit something new, it automatically reopen it (and thus appears again in the list of “hg branches“). You can also re-close it when you are done.

    I find this feature actually desirable: Imagine you have created a “stable” branch in order to stabilize some code for a delivery, only allowing bug fixes on this branch. Now after the delivery, you can close the stable branch and develop new features again on default, switching to the next iteration and preparing the next delivery (assuming you are using scrum for instance). Now when three days after, your delivery customer finds a problem and demand to receive a fixed delivery, not wanting to wait for the next one, then you can easily switch to the stable branch, reproduce the problem, fix it (reopening the branch), redeploy, and finally close the branch again. This seems like a plausible scenario and a good Mercurial behavior to me.

    Just my 0.02€ 🙂

    Cheers,
    Christophe.

    = The illiterate of the 21st century will not be those who cannot read or write; they will be those who cannot learn, unlearn, and relearn. –Alvin Toffler =

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

Sidebar

Related Questions

I was quite suprised today to discover that I can't do the following. public
i discovered today that Windows 7 comes with a very impressive MathPanel utility, for
Today, I discovered that using Collections.synchronizedXXX doesn't play well with reflection. Here's a simple
So we went to implement something today, and discovered that there already is several
I discovered(*) today that, depending on the server, my TSQL commands were case-sensitive, meaning
I discovered today in iReport that I cannot set the initial value expression of
Today i discovered that my dev version of my website do not execute success
Today I discovered that something I had assumed about VB.NET for many years was
Today I discovered that Entity Framework was adding an unnecessary sub query to the
I am not particularly new to C/C++ but today I discovered some things that

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.