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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:15:35+00:00 2026-05-25T18:15:35+00:00

I have a changeset that is uncommitted. I noticed that I am currently on

  • 0

I have a changeset that is uncommitted. I noticed that I am currently on the wrong branch, so before I commit this, I would like to switch to the branch that I meant to be on, then commit.

How difficult is this to achieve in Hg?

  • 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-25T18:15:36+00:00Added an answer on May 25, 2026 at 6:15 pm

    If there is a linear path between the current parent revision and the target revision, then you can just issue

    hg update right-branch
    

    and Mercurial will merge the changes in your working copy into the target revision.

    This is done using the full merge tool machinery so things like renames are taken into account and you’ll get a three-way merge program in case of conflicts. The shelve- and diff-based approaches lack this and requires you to fix conflicts by hand using .rej files. You can even see the current merge status with hg resolve --list and re-merge selected files since Mercurial makes the necessary backups for you.

    If there is not a linear path, you will get this warning:

    abort: crosses branches (merge branches or use --clean to discard changes)
    

    You can then get what you want by first updating back to a common ancestor, and then updating forward again. I’m not 100% sure why we issue this warning, but searching the mailinglist archives should give you the answer if you’re curious.

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

Sidebar

Related Questions

I have a specific changeset that I want to rollback my Development branch to,
Given a changeset c and given that c contains merge operations, I would like
Variations of this question have been asked before, but it seems like the issue
I have a commit c. I want to get the changeset of that exact
Suppose that: I have a repo called MyRepo. I have uncommitted changes in my
I have this method that changes an larger image source on click. I need
I have this code that changes the opacity of the div on hover. $(#navigationcontainer).fadeTo(slow,0.6);
I would like to mark an arbitrary group of commits/changesets with a label. Commit
It seems like I have inadvertently modified my git config such that when I
Currently, our DBAs require the TFS changeset number for any scripts/stored procedures/functions that need

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.