tests: add a substitution for ENOENT/ERROR_FILE_NOT_FOUND messages
Automatic replacement seems better than trying to figure out a check-code rule.
I didn't bother looking to see why the error message and file name is reversed
in the annotate and histedit tests, based on Windows or not.
I originally had this as a list of tuples, conditional on the platform. But
there are a couple of 'No such file or directory' messages emitted by Mercurial
itself, so unconditional is required for stability. There are also several
variants of what I assume is 'connection refused' and 'unknown host' in
test-clone.t and test-clonebundles.t for Docker, FreeBSD jails, etc. Yes, these
are handled by (re) tags, but maybe it would be better to capture those strings
in order to avoid whack-a-mole in future tests. All of this points to using a
dictionary containing one or more strings-to-be-replaced values.
setup: only write some autogenerated files if they change
Without this change, setup.py always writes some files on every
invocation. This prevents some builds from being a no-op when they
should. And, since times can sneak into generated .pyc files,
this prevents file content from being deterministic between
builds.
As part of the refactor, we treat file content as bytes.
The only potential regression from this would be if some tool
is looking at mtimes of the changed files to determine if
further action should be taken. But I don't think anything
critically important is keyed off the mtimes of these specific files.
Differential Revision: https://phab.mercurial-scm.org/D1580
python3: whitelist many more passing tests
Differential Revision: https://phab.mercurial-scm.org/D1584
fancyopts: use getopt.gnu_getopt()
The issue described in the docstring has been fixed since Python
20ab2260dc93,
which is in 2.7.
https://hg.python.org/cpython/rev/
20ab2260dc93
https://bugs.python.org/
issue4458
This fixes the handling of '--' value.
dispatch: replace _earlygetopt(strip=True) with new parser
The execution order in cmdalias.__init__() is adjusted to set stripped args
to self.givenargs, which is no longer updated in place.