run-tests: allow run-tests.py to run tests outside current directory
When reloading tests, run-tests.py was assuming that it could look
up the test by the basename, which only works if you are running
tests which are in the current directory.
This patch changes that lookup to use the full path. This is all
that was needed, and does not appear to cause any problems for
any of the existing testing work flows based on running the
suggested commands at the top of run-tests.py.
Motivation: In order to test Mercurial with Hypothesis (according
to https://www.mercurial-scm.org/wiki/HypothesisPlan) it is
useful to be able to generate temporary test files and execute
them. Generating temporary files in the tests/ directory leads to
a lot of suboptimal clutter.
histedit: unifying the way replacements are computed for abort and success
This is a part of a bigger refactoring effort with the ultimate goal of
better understanding of how histedit works and fixing
issue4800.
templater: factor out type conversion of revset() result
This makes it clear why we have to do repo[int(x)].
templater: evaluate each item of revset() as integer revision
Because templater.revset() returns a list of strings, repo["-1"] was mapped to
the tipmost revision. Ideally, we should make revset() return a list of integer
revisions, but it turned out not simple. If revset() is a list of integers,
"{ifcontains(rev, revset(), ...)}" would fail because "ifcontains" casts "rev"
to a string.
So this patch just converts a string back to an integer revision.
demandimport: blacklist sqlalchemy.events as it has side effects (
issue5085)
Importing sqlalchemy.events cannot be delayed as it registers classes to
their event mechanism. It worked fine before
4f1144c3c72b, since they use
new-style imports. But now we have to blacklist it because our demandimport
can handle new-style imports.
This patch series isn't intended for stable as we don't guarantee API
compatibility with 3rd-party extensions. They can temporarily disable the
demand importer to work around the issue.
demandimport: enforce ignore list while processing modules in fromlist
If a module is loaded as "from . import x" form, there has been no way to
disable demand loading for that module because name is ''. This patch makes
it possible to prevent demand loading by '<package-name>.x'.
We don't use _hgextimport(_origimport) here since attr is known to be a
sub-module name. Adding hgext_ to attr wouldn't make sense.
test-paths: fix up json output to match $TESTTMP on Windows
Without this, the paths were in the form "C:\\Users\\Matt\\AppData...". The
test runner wouldn't collapse it down to $TESTTMP, which uses single
backslashes.