streamclone: fix error when store files grow while stream cloning
Effectively a backout of
9fea6b38a8da, but updated to using 'with'.
tests: add test of stream clone of repo that is changing
This reveals an error introduced by
9fea6b38a8da.
chgserver: handle ParseError during validate
Currently the validate command in chgserver expects config can be loaded
without issues but the config can be broken and chg will print a stacktrace
instead of the parsing error, if a chg server is already running.
This patch adds a handler for ParseError in validate and a new instruction
"exit" to make the client exit without abortmsg. A test is also added to make
sure it will behave as expected.
dispatch: extract common logic for handling ParseError
The way ParseError is handled at two different places in dispatch.py is the
same. Move common logic into _formatparse.
chgserver: resolve relative path before sending via system channel
The chgserver may have a different cwd from the client because of the side
effect of "--cwd" and other possible os.chdir done by extensions. Therefore
relative paths can be misunderstood by the client.
This patch solves it by expanding relative cwd path to absolute one before
sending them via the 'S' channel. It can help chg to pass a testcase in
test-alias.t later.
mercurial: use pure Python module policy on Python 3
The C extensions don't yet work with Python 3. Let's minimize the
work required to get Mercurial running on Python 3 by always using
the pure Python module policy on Python 3.
chg: provide early exception to user
See the previous patch for details. Since the socket will be closed by the
server, handleresponse() will never return:
Traceback (most recent call last):
...
chg: abort: failed to read channel
cmdserver: write early exception to 'e' channel in 'unix' mode
In 'unix' mode, the server is typically detached from the console. Therefore
a client couldn't see the exception that occurred while instantiating the
server object.
This patch tries to catch the early error and send it to 'e' channel even if
the server isn't instantiated yet. This means the error may be sent before the
initial hello message. So it's up to the client implementation whether to
handle the early error message or error out as protocol violation.
The error handling code is also copied to chgserver.py. I'll factor out them
later if we manage to get chg passes the test suite.