[PATCH 3 of 3] merge: add file ancestor linknode to mergestate

Martin von Zweigbergk martinvonz at google.com
Wed Jan 13 12:47:38 CST 2016

On Wed, Jan 6, 2016 at 5:40 PM, Durham Goode <durham at fb.com> wrote:
> # HG changeset patch
> # User Durham Goode <durham at fb.com>
> # Date 1452127911 28800
> #      Wed Jan 06 16:51:51 2016 -0800
> # Node ID a8adf78352f494c7cf88221bd346ecdda2a9cdfa
> # Parent  7afd0e010fd8d7fea0e6339f5f280fa192c1e176
> merge: add file ancestor linknode to mergestate
> During a merge, each file has a current filenode, an other filenode, and an
> ancestor filenode. The ancestor filenode's linknode is not stored though, and we
> rely on the ability for the filectx() to look up the linknode by using the
> revlog's linkrev. In alternative backends (like remotefilelog), linkrev's may
> not be present or may have restriction that prevent arbitrary linkrev look up
> given a filenode.
> This patch accounts for that by storing the ancestor filenode's linknode in the
> merge state so that it is available later at resolution time.
> This results in some minor test changes due to the extra state, and due to us no
> longer always using the earliest commit (i.e. the linkrev target) for that
> filenode (which is ok, since we're still using an ancestor of current and other
> that uses the correct filenode).

Why is the linknode looked up at merge time not always the same as
that looked up at resolution time? I'm guessing I misunderstood the

More information about the Mercurial-devel mailing list