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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T23:44:34+00:00 2026-05-19T23:44:34+00:00

We’re currently working on the new version (version 2.0) of an application. We have

  • 0

We’re currently working on the new version (version 2.0) of an application.

We have a customer running version 1.0 of the app who found a bug. We updated to the tagged changeset for version 1.0 and located and fixed the bug.

We committed the change which created a new head in our source tree.

The question is how best to merge this? Ideally I would want to merge it into the changeset that followed version 1.0. I don’t want to merge it into the tip because the code where the bug was found doesn’t actually exist anymore.

I realise I perhaps should have created a separate branch for “v1.0 bug fix”.

Thanks,
Ben

  • 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-19T23:44:34+00:00Added an answer on May 19, 2026 at 11:44 pm

    When moving a change within a repository using merge it’s all about the most recent common ancestor of the place you have the change and the place you want it. If before making this fix your repo looked like this:

    [a]-[b]-[c]-[d]
    

    with the 1.0 tagged changeset being [b] then you now have this:

    [a]-[b]-[c]-[d]
          \
           -[e]
    

    where the fix is in [e]. If that’s the case then you just need to do this:

    hg update d
    hg merge e
    hg commit
    

    Then you’ll have this:

    [a]-[b]-[c]-[d]-[f]
          \         /
           -[e]-----
    

    If on the other hand before making the changes your repo looked like this:

    [a]-[b]-[c]-[d]
          \
           -[e]-[f]
    

    where the 1.0 rag pointed to [f] then you now have this:

    [a]-[b]-[c]-[d]
          \
           -[e]-[f]-[g]
    

    with the fix in [g]. If you want to move the changeset [g] into [d] without bringing [e] and [f] along with it, there’s no good way to do it. The not-so-good way available to you (called cherrypicking) is to use the hg export and hg import commands.

    No workflow requires cherry picking, but avoiding it requires a little forethought. In that second case you would avoid it by making the fix not on the 1.0 series (as a child of [f]) but instead as a child of the most recent common ancestor of the two places you want that change. Since you want that change in both [d] and [f] you look for their most recent common ancestor and see it’s [b] and make the change as a child of that using these commands:

    hg update b
    ..edit..
    hg commit
    

    leaving you with this graph:

    [a]-[b]-[c]-[d]
          \
           \--[g]
            \
             -[e]-[f]
    

    this fix, [g] is a new head, and you can merge it into both [d] (2.0) and [f] (1.0) without any cherry picking at all. The commands for that would be:

    hg update d
    hg merge g
    hg commit
    hg update f
    hg merge g
    hg commit
    

    and the resulting graph would be:

    [a]-[b]-[c]-[d]--[h]
          \         /
           \--[g]----
            \        \
             -[e]-[f]-[i]
    

    where [h] is your new 2.0 with the fix, and [i] is your new 1.0 with the fix.

    Summary: you can always avoid cherry picking with forethought, but it’s not the end of the world if you didn’t

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
I am currently running into a problem where an element is coming back from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.