Page MenuHomePhabricator

remotefilectx: when looking for linknodes, use unfiltered repo

Authored by spectral on Jun 15 2018, 5:17 PM.



Currently, remotefilelog updates the linknode whenever a commit containing the
file is created, including during things like amend - even if the file is not
touched. This causes some issues if that node is subsequently stripped for
whatever reason, either manually or as part of a --abort of the operation that
created it (for more information and a sample way of reproducing this, see

We are experimenting with *not* updating the linknode if the file revision
exists already and the existing one is valid. This is the behavior that stock
Mercurial seems to have, it will not update the linkrev unless it needs to.

Since the linknode is not updated, it is very likely for it to point to a
filtered node. When tracing file moves, we try to use the linknode and then
either fall back to a slow path or fail completely because it's filtered. This
patch resolves that issue: when looking for linknodes, use the unfiltered repo.
This also mimics what Mercurial does.

Diff Detail

rFBHGX Facebook Mercurial Extensions
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

spectral created this revision.Jun 15 2018, 5:17 PM
Herald added a reviewer: Restricted Project. · View Herald TranscriptJun 15 2018, 5:17 PM
quark accepted this revision.Jun 15 2018, 10:42 PM
quark added a subscriber: quark.

Pushed. Thanks!

This revision is now accepted and ready to land.Jun 15 2018, 10:42 PM
This revision was automatically updated to reflect the committed changes.