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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:09:10+00:00 2026-05-15T08:09:10+00:00

Admittedly a misleading title, but I didn’t know how to put it better. So

  • 0

Admittedly a misleading title, but I didn’t know how to put it better.

So I made the mistake of pushing all my project specific changes BEFORE I opened a branch. That way, there are some changeset sitting in the default branch that does not belong there. They should be in my newly opened branch.

Do I have to backout all the changesets first and then push them again to the correct branch? Does that even work?

Thank you for your help.

  • 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-15T08:09:10+00:00Added an answer on May 15, 2026 at 8:09 am

    Without resorting to EditingHistory (which is generally advised agains, and is certainly in opposition to the mercurial “immutable history” design goals) those changes will be in your history forever. You can, however, undo them in your ‘tip’ revision and then trickle them back in multiple subsequent changesets spread over multiple branches.

    Let’s imagine this is your current history:

    [R0] -> [R1] -> [R2] -> [R3]
    

    Where revisions R2 and R3 have some stuff you wanted in the default branch and some stuff you wish was in a different branch. You can create a new revision, R4, that undoes R2 and R3. That can be done using backout as you suggest, or since you’re doing multiple changesets, perhaps more easily using ‘revert’.

    hg update tip ; hg revert --all -r R2 ; hg commit -m 'undid changes R2 and R3'
    

    then your history will look like this:

    [R0] -> [R1] -> [R2] -> [R3] -> [R4]
    

    then you can split your work into the changesets you wish you’d initially done, yielding a history like this:

    [R0] -> [R1] -> [R2] -> [R3] -> [R4] -> [R5] -> [R7]
                                       \
                                        --> [R6] -> [R8]
    

    R6 and R8 can be on the branch named ‘default’ or on a different named branch. Either way, you can push just R0 through R5 and R7 by doing:

    hg push -r R7
    

    That works because a push pushes a revision and all of its ancestors — but R6 and R8 aren’t ancestors of R7, so they won’t get pushed no matter what branch they’re on.

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

Sidebar

Related Questions

This is an admittedly silly question, but I honestly don't know if this is
I'm admittedly favour DIV, but am working on a project that uses nested tables.
Admittedly not a programming question, but I don't really know where else to ask
Admittedly, this is a strange problem for me to have, but here is what
(The title is admittedly not that great. Please forgive my English, this is the
I am writing a Wordpress shortcodes plugin for a client and admittedly don't know
I'm an amateur, admittedly so, but I'm having fun trying to learn a little
I'm parsing some text (admittedly HTML, but it's small stuff, and RegEx (should) do
I'm admittedly a straight-C newbie, but this has got me stumped. I'm working on
I am admittedly a beginner, but I also did a fair amount of searching

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.