contrib: refactor preparation logic for patterns of check-code.py
This is a part of preparation to apply checking with check-code.py on
code fragments embedded in *.t test scripts.
Before this patch, preparation logic in _preparepats() of
check-code.py is not reusable. It can handle only module global list
"checks".
This patch splits preparation logic into small internal functions, and
add the loop to invoke them, in order to increase reusability of the
logic.
"c[-2]" is equivalent to "c[3]" for "checks". This patch uses the
former, because it will be more reusable for subsequent patch than the
latter.
contrib: split pypats list in check-code.py
This is a part of preparation to apply checking with check-code.py on
code fragments embedded in *.t test scripts.
Ideally, all patterns in "pypats" before this patch should be applied
on not only normal *.py files but also code fragments embedded in *.t
test scripts. But fixing test scripts for some patterns requires
many changes, and has less profit than effort.
Therefore, this patch splits pypats list into two below:
- commonpypats, which are applied on all (= including code fragments
embedded in *.t test scripts) *.py files
- pypats, which are applied only on normal *.py
tests: remove useless line wrapping in a code fragment embedded in test script
This is a part of preparation to apply checking with check-code.py on
code fragments embedded in *.t test scripts.
This revision avoids error of check-code.py below.
Use () to wrap long lines in Python, not \
storage: introduce a `revlog.reuse-external-delta` config
This option goes a bit further and provides a way to get the same behavior as the
`re-delta-all` optimisation from `hg debugupgraderepo`.
The effect of the option is a bit hard to test as we do not have multiple diff
algorithm at hand. However, we at least make sure the code path run.
storage: introduce a `revlog.reuse-external-delta-parent` config
As pointed in
c59987ab96b4, we had no simple way to get a client to not blindly
reuse the delta parent from a bundle. Instead one had to rely on a side effect
of the deprecated `format.generaldelta` configuration.
We introduce an explicit `revlog.reuse-external-delta-parent` configuration
option (default to True) to control this behavior. If the option is not set,
`format.generaldelta` still control this behavior.
To test the new option, we convert a couple of place where `generaldelta` have
been used for its side effects.
py3: convert return values of inspect.getabsfile() to bytes
It's weird that python docs for inspect does not mention getabsfile().
Differential Revision: https://phab.mercurial-scm.org/D6033