Mercurial distributions like those produced with py2exe store
their data/resource files relative to the executable. For
example, in our Windows distributions, help files are in
the help/ directory relative to hg.exe.
In a future world where we are using the ResourceReader API
for accessing package resources, we need a way to provide
a ResourceReader for these pieces of data without breaking
these Mercurial distributions.
This commit introduces logic into resourcereader() which will
return a filesystem-based ResourceReader if resources are
relative to the executable and we are requesting resources for
the "mercurial" package.
Ideally we wouldn't need to do this and would instead change
packaging. However, various downstream consumers may be sensitive
to changes in the on-disk layout of Mercurial installs. I'm
unwilling to cross this bridge at this time. I think it is more
important to get things working with the ResourceReader API first.
Then we can tackle better resource packaging/installation.
It is also likely that we'll need more logic to handle additional
packages/resources. For example, help resources are always in a
help/ directory and map cleanly, but templates resources are in a
Templates/ directory and there are case-sensitivity concerns.
Our initial target for using the resource reading API is help.
So we can defer on additional complexity.