tinyproxy: explicitly flush logged messages
On Windows, output streams are buffered when redirected to a file, and
TerminateProcess() apparently doesn't trigger a flush. This left
test-http-proxy.t missing part of the last line when it cat'd proxy.log[1].
Flushing stderr is all that is needed (on py27 anyway). I originally flushed
stdout too, but that added additional output to the log:
$ cat proxy.log
+ Accept: $LOCALIP (localhost)\r (esc)
+ Serving HTTP on 0.0.0.0 port 20810 ...\r (esc)
+ connect to localhost:$HGPORT\r (esc)
* - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
+ bye\r (esc)
+ connect to localhost:$HGPORT\r (esc)
* - - [*] "GET http://localhost:$HGPORT/?cmd=branchmap HTTP/1.1" - - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
+ bye\r (esc)
+ connect to localhost:$HGPORT\r (esc)
* - - [*] "GET http://localhost:$HGPORT/?cmd=stream_out HTTP/1.1" - - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
+ bye\r (esc)
+ connect to localhost:$HGPORT\r (esc)
...
[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-April/096987.html
help: clarify ancestors() and descendants() include given set (
issue5594)
Also unified "a changeset" to "changesets".
dagop: move blockancestors() and blockdescendants() from context
context.py seems not a good place to host these functions.
% wc -l mercurial/context.py mercurial/dagop.py
2306 mercurial/context.py
424 mercurial/dagop.py
2730 total
dagop: split module hosting DAG-related algorithms from revset
This module hosts the following functions. They are somewhat similar (e.g.
scanning revisions using heap queue or stack) and seem non-trivial in
algorithmic point of view.
- _revancestors()
- _revdescendants()
- reachableroots()
- _toposort()
I was thinking of adding revset._fileancestors() generator for better follow()
implementation, but it would be called from context.py as well. So I decided
to create new module.
Naming is hard. I couldn't come up with any better module name, so it's called
"dag operation" now. I rejected the following candidates:
- ancestor.py - existing, revlog-level DAG algorithm
- ancestorset.py - doesn't always return a set
- dagalgorithm.py - hard to type
- dagutil.py - existing
- revancestor.py - I want to add fileancestors()
% wc -l mercurial/dagop.py mercurial/revset.py
339 mercurial/dagop.py
2020 mercurial/revset.py
2359 total
hghave: add has_git_range for testing if git understands ext::sh
Even on CentOS 7, git is at version 1.8. It seems git 1.9 is when
ext::sh was introduced so we a check for that. The way these functions
are written follows the same style and format for the way we check svn
and bzr versions.