mpatch: be more careful about parsing binary patch data (SEC)
It appears to have been possible to trivially walk off the end of an
allocated region with a malformed patch. Oops.
Caught when writing an mpatch fuzzer for oss-fuzz.
This defect is OVE-
20180430-0001. A CVE has not been obtained as of
this writing.
zstandard: pull in bug fixes from upstream 0.9.1 release (
issue5884)
This changeset contains the meaningful code changes from
python-zstandard's 0.9.1 release. The main fix is to restore
support for compiling with mingw.
templatefuncs: only render text portion of minirst.format() result
When "keep" argument is provided, the function returns (text, pruned), where
pruned is a list of sections from the original plain text that were pruned from
the rendered result. Let's not output it together with the rendered HTML.
tests: demonstrate that hgweb renders "pruned" that minirst.format() returns
Notice at the bottom of the help text there's "windows". It's a section that is
in the original help text, but was pruned (because hgweb didn't ask for it).
rebase: avoid RevlogError when computing obsoletenotrebased (
issue5907)
The key to reproducing this seems to be missing an obsolete node that is not an
ancestor of the destination.
rebase: prioritize indicating an interrupted rebase over update (
issue5838)
This should also cover the transplant extension, and any other non clearable
states.
tests: adapt test-check-pylint to run on Windows
The line endings are explicitly converted because this was ending up with
'\r (no-eol) (esc)' lines, in addition to the usual '\r (esc)' lines. I've seen
the fakerc output on other recently installed systems though (10.13 and/or
Fedora 26). Unfortunately, the output here uses '\\' on Windows, so glob away
the whole path.
hghave: avoid a deadlock reading the child process's output
The output of `pylint` is voluminous enough that it fills the buffer on Windows,
and waited for the parent to read it out. But the parent was waiting on the
child to exit.
I'm not sure what the intent of setting `ret = -1` in the exception handler just
above this was...
lfs: bypass wrapped functions when reposetup() hasn't been called (
issue5902)
There are only a handful of methods that access repo attributes that are applied
in reposetup(). The `diff` test covers all of the commands that call
scmutil.prefetchfiles(). Along the way, I saw that adding files and upgrading
the repo format were also problems (also tested here).
I don't think running `hg serve` through the commandserver is sane, but I
conditionalized both the capabilities and the wsgirequest handler because it's
trivially correct. It doesn't look like there has ever been a caller of
candownload(), so there's no test for that path.
The upload case isn't testable, because uploadblobs() bails if there are no
pointers. The requirement should be added any time pointers are introduced, and
that would force the extension to be loaded specifically for the repo. This
covers `debuglfsupload`, the pre-push hook (which isn't set until the repo is
promoted to LFS), and uploadblobsfromrevs(), which can be called by other
extensions.
I think readfromstore() and writetostore() are only reachable as a flag
processor for revlog.REVIDX_EXTSTORED, and a requirement is added as soon as
that is seen, so I don't think those are a problem.