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

  • SEARCH
  • Home
  • 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 8354767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:39:23+00:00 2026-06-09T09:39:23+00:00

My initial situation is similar to the one in this question . Coming from

  • 0

My initial situation is similar to the one in this question. Coming from a strong Git background, I wanted to force-push a cleaned-up version of my private branch (under the same name) where I’ve squashed / folded some commits (using the histedit extension). What I did again is similar to this answer, but I did things in a different order:

$ hg clone -b private_branch <url>
$ hg histedit -r <some_rev> # Fold some commits
$ hg push -f # This creates a second branch head on the server
$ hg update -r <rev_of_original_branch_head>
$ hg commit --close-branch -m 'Closing this branch in favor of a cleaned-up version'
$ hg push

The thing I don’t understand is, if I now set up a new working tree, I get

$ hg clone -b private_branch <url>
$ hg log -l 1
changeset:   <rev>:<sha1>
branch:      private_branch
tag:         tip
parent:      <tip_rev_of_branch_before_folding>:<sha1>
user:        <name> <email>
date:        Wed Aug 08 11:48:25 2012 +0200
summary:     Closing this branch in favor of a cleaned-up version

Why is tip pointing to the closed branch? hg heads is only showing my force-pushed head as expected. However, hg heads -t is showing both heads for private_branch. I’ve also verified that my closing commit is indeed a closing one, hg log --debug shows extra: close=1.

EDIT: The problem with this is, if I do a commit on a fresh clone, I get

$ hg ci -m "test"
created new head
reopening closed branch head <rev>

But I do not want to reopen the closed branch head, I want to commit on top of the open branch head.

How can I fix this, preferably without doing a no-op merge?

  • 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-06-09T09:39:25+00:00Added an answer on June 9, 2026 at 9:39 am

    The solution was to simply do

    $ hg update private_branch
    

    to set the working directory’s parent revision as shown by hg parent(s) to the newly created open branch head, away from the closed branch head. It was somewhat unintuitive to me that I needed to “switch branches” although I already “am on that branch”, but in this case I was not switching branches, but switching heads within a single branch. Something that works completely different than in Git.

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

Sidebar

Related Questions

Initial Question Yesterday i read about ECMAScript 5 Object.create() And I wanted to start
This is a very similar question to AJAX, Subdomains and the 200 OK response
Here's the situation: We have a git repository, managed by gitosis. One user user
[UPDATE] The real situation was a bit more complicated than my initial question made
I hoped the answer to my previous question whould help me with this one,
I'll re-explain my situation because i think my initial story wasn't clear enough. Im
My initial question was here and was related to the postgres backend. Postgres subquery,
Initial situation: I am working with a proprietary framework ( ESRI 's ArcGIS Engine
The initial situation is that I map my domain model into a presentation model.
Here is the situation, I have a login page as the initial rootView of

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.