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
https://bitbucket.org/facebook/hg-experimental/issues/1/hg-revert-r-then-hg-shelve-can-cause-bad)
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.