tests: check-code more python files without py extension
files found by running
$ hg manifest | grep -v "\." | xargs file | grep python
test-pathencode: randomize length of each path component
This makes it possible for long and short components to exist in the same path.
This also makes shorter path components more likely. For
randint(1, randint(1, n)), the likelihood that one sees a number k
(1 <= k <= n) is 1/n * (\sum_{k=i}^n 1/i). This decreases with k, much like in
the real world where shorter paths are more common than longer ones.
The previous fix and this one together cause
issue3958 to be detected by this
test with reasonable frequency. When this test was run 100 times in a loop, the
issue was detected 30 of those times.
test-pathencode: reduce makepart length requirement by 1
This allows path components of length 1 to be generated.
pathencode: fix hashmangle short dir limit (
issue3958)
The Python version of this (see mercurial/store.py:_hashencode) copies path
components up to a limit of maxshortdirslen bytes. The Python version does not
consider the initial "dh/" to be part of the this, though, while the C version
currently does. Adding len("dh/") == 3 to the limit for the C version brings it
in line with the Python version.
This was not caught by the randomized testing scheme in test-pathencode.py
because of a couple of flaws with the test. Upcoming patches will fix those
problems.
docs: change description to synopsis in hgrc.5
Spotted by Eric S. Raymond.
run-tests: sort missing files first instead of raising an error
sort first for early telling typos in test names
filectx: remove dependencies on filerev
Removing dependencies on filectx.filerev() makes it easier to create a filelog
implementation that doesn't have rev numbers.
hg: move return statement after finally block
return is always run after finally block. Now we have same functionality,
but clearer readability.
run-tests: call Threads constructor with keyword arguments
This is suggested in the python documentation
(on http://docs.python.org/2/library/threading.html#thread-objects)
run-tests: ignoring tests works again
running with --retest did not work anymore because runone still returned None
for this case. But this is not allowed since
6a127fa5de23.
check-code: introduce function for using re2 when available
Do it similar as in mercurial.util. For simplicity only support flag
multiline which is the only one used.
check-code: compile all patterns on initialisation
They where compiled once for every checked file (when calling finditer).