The statement was added at a lot of places and was going to be added at more
places. So before that, let's turn that into a function.
Also this is turned into a function so that we can plug in the support for
shared repositories in future which is supported by hgremotenames extension.
This is not a great name. It implies it's a vfs on a remote peer, which is definitely not what we want to imply.
We might just call it getvfs in this case -- it's already in the remotenames module so it's obvious what it is if it's used outside of the module.
After reading the description, I see that this is for shared usage in the future. You should add a comment here in the code explaining that.
Also, a better way to deal with that is to build a shared vfs in core -- but that's outside of the scope of this change.