How does the 3 way merge in Mercurial/Meld work?

前端 未结 2 578
情歌与酒
情歌与酒 2021-01-31 16:16

I\'m working on a project where I have a commit that introduced a feature with major problems that weren\'t discovered immediately. Now I want to completely remove that revision

相关标签:
2条回答
  • 2021-01-31 16:58

    Local is r133

    Other is r134

    Base is r128 (the common ancestor to both r133 and r 134)

    When you perform a 3 way merge it compares all three of those together to help you decide what to take and from where. By seeing what change is in the other revision and what the common ancestor looked like you are able to make a much more informed decision about what to keep and what to change.

    0 讨论(0)
  • 2021-01-31 17:05

    Your question is really confusing, but here are some information that may help you.

    • What is base?

    Base is the unmodified version of the revision that you have currently checked out and worked on. where possibly other changes have forked off (you can have revisions in between your current local and base!). its just where the nearest revision where no other fork has diverted from afterwards (same parent) (in your case r128)

    • What is head?

    Head is the latest revision in version control. if you work alone on only one copy it will probably be base. but a co worker might have modified the same file and checked it into version control, then head is later than your base.

    • What is local?

    Local is your modified version (in your case r133)

    • What is other?

    Other is the some fork/branch that has also your Base as parent (in your case r134)

    • How does 3-way merge work?

    3 way merge works (at least in meld) hierarchically. usually from left to right like this:

    local > base > other / head

    local/base is mostly trivial because its just what you modified

    then you can merge your changes into the head revision or the one of your co worker or whatever.

    There can be multiple other/head revisions, but then it's not your job to merge in and therefore more than 3 way compare doesn't make sense.

    0 讨论(0)
提交回复
热议问题