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

The Archive Base Latest Questions

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

It seems naming a previously unnamed branch doesn’t really work out. It creates a

  • 0

It seems naming a previously unnamed branch doesn’t really work out. It creates a nasty multiple heads problem that I can’t find a solution for.

Here is the workflow…

UserA starts working on feature that they expect to be small, so they just start working(off the default branch). The change turns out to be a large project and will need multiple contributors. So UserA issues… hg branch "Feature1" and continues working, committing locally s needed.

UserA then pulls down the changes from the central repo so he can push.

At this point, why does hg heads return 3 heads? It shows 2 for default and 1 for Feature1. The first head for default is the latest change by another user on the branch(irrelevant). The second default head is the commit prior to the hg branch "Feature1" commit.

The central repository has rules enforced so that only 1 head per branch is allowed, so forcing a push isn’t an option. The repo doesn’t want multiple heads on the default branch.

UserA should be able to push these changes so that other users can see the Feature1 branch and help out. I can’t seem to find a way to “correct” this. I don’t think I can re-write the branch of the initial commits for the feature, before it was a named branch.

I know the initial changes before the named branch are technically on the default branch, but does that mean they will be heads until that Feature1 branch is merged?

  • 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-15T05:36:40+00:00Added an answer on May 15, 2026 at 5:36 am

    I have found a solution without have to re-clone and merge changes in. I prefer this method mainly for historical purposes as I think it’s valuable information on what happened with the feature (aka it started small and then was re-thought to be larger etc..)

    In my example, UserA should update to the unwanted head on default and close that branch of default, as it is unwanted. This will leave 2 heads one for default and one for Feature1 as expected.

    hg update -r X // X is the rev of the unwanted head.
    hg commit --close-branch -m "Moved to Named Branch Feature1, cleaning up initial work"
    

    Then update to the Feature1 branch, push and continue working.

    Another workflow is almost the same except the UserA decided to push Feature1 for others to help and default has not been moved forward by anyone else. The local repo only has 2 heads and the user could push, but UserA does NOT want to just push as the tip of default would now be the changeset that really “belongs” to Feature1.

    UserA should update to the latest, unwanted changeset of default. Then revert the default back to the revision before UserA starting working.

    hg update default
    hg revert -r Y // Y is the changeset before UserA started working on the feature
    hg commit -m "Reverting changes that now exist in Feature1 branch"
    

    Then update to the Feature1 branch, push and continue working.

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

Sidebar

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.