Mercurial > hg
comparison tests/test-backout.t @ 28011:8abd9f785030
merge: add file ancestor linknode to mergestate
During a merge, each file has a current commitnode+filenode, an other
commitnode+filenode, and an ancestor commitnode+filenode. The ancestor
commitnode is not stored though, and we rely on the ability for the filectx() to
look up the commitnode by using the filenode's linkrev. In alternative backends
(like remotefilelog), linkrevs may have restriction that prevent arbitrary
linkrev look up given a filenode.
This patch accounts for that by storing the ancestor commitnode in
the merge state so that it is available later at resolve time.
This results in some test changes because the ancestor commitnode we're using at
resolve time changes slightly. Before, we used the linkrev commit, which is the
earliest commit that introduced that particular filenode (which may not be the
latest common ancestor of the commits being merged). Now we use the latest
common ancestor of the merged commits as the commitnode. This is fine though,
because that commit contains the same filenode as the linkrev'd commit.
author | Durham Goode <durham@fb.com> |
---|---|
date | Fri, 05 Feb 2016 10:22:14 -0800 |
parents | 9960b6369e7f |
children | 318a24b52eeb |
comparison
equal
deleted
inserted
replaced
28010:eb22def9db3b | 28011:8abd9f785030 |
---|---|
684 $ hg status | 684 $ hg status |
685 $ hg debugmergestate | 685 $ hg debugmergestate |
686 * version 2 records | 686 * version 2 records |
687 local: b71750c4b0fdf719734971e3ef90dbeab5919a2d | 687 local: b71750c4b0fdf719734971e3ef90dbeab5919a2d |
688 other: a30dd8addae3ce71b8667868478542bc417439e6 | 688 other: a30dd8addae3ce71b8667868478542bc417439e6 |
689 file extras: foo (ancestorlinknode = 91360952243723bd5b1138d5f26bd8c8564cb553) | |
689 file: foo (record type "F", state "u", hash 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33) | 690 file: foo (record type "F", state "u", hash 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33) |
690 local path: foo (flags "") | 691 local path: foo (flags "") |
691 ancestor path: foo (node f89532f44c247a0e993d63e3a734dd781ab04708) | 692 ancestor path: foo (node f89532f44c247a0e993d63e3a734dd781ab04708) |
692 other path: foo (node f50039b486d6fa1a90ae51778388cad161f425ee) | 693 other path: foo (node f50039b486d6fa1a90ae51778388cad161f425ee) |
693 $ mv .hg/merge/state2 .hg/merge/state2-moved | 694 $ mv .hg/merge/state2 .hg/merge/state2-moved |