obsstore: move header encoding to a separate function
This patch moves encodeheader from encodemarkers. So markers and header
could be encoded separately.
obsstore: move _version to a propertycache
This makes sure _version is correct even if "_all" is not called.
obsstore: separate marker parsing from obsstore reading
This allows us to get raw obsstore content without parsing any markers.
Reading obsstore is much cheaper than parsing markers.
obsstore: move marker version reading to a separate function
This allows us to read marker version without reading markers.
obsstore: minor optimization for the obsolete revset
Use local variables in a loop.
dispatch: do not close stdout and stderr, just flush() instead
Since
3a4c0905f357 "util: always force line buffered stdout when stdout is
a tty", we have two file objects attached to the same STDOUT_FILENO. If one
is closed, the underlying file descriptor is also closed, and writing to
the other file object would crash the Python interpreter in a hard way, at
least on Windows.
So, it seems safer to not close the standard streams. This also matches
the behavior of the default sys.stdout/stderr.close(), which never close
the FILE* streams in C layer.
https://hg.python.org/cpython/file/v2.7.13/Python/sysmodule.c#l1401
windows: do not close stdout on flush() failure
It's been there since
e817c68edfed (2007-02-19), but seems wrong since any
I/O operations to a closed file would raise ValueError, not IOError. We should
keep the file object open even if the underlying file descriptor is half dead.
test-obsolete-bundle-strip: do not include \n in filename (
issue5586)
revlog: add support for partial matching of wdir node id
The idea is simple. If the given node id prefix is 'ff...f', add +1 to the
number of matches (e.g. ambiguous if partial + maybewdir > 1).
This patch also fixes id() revset and shortest() template since _partialmatch()
can raise WdirUnsupported exception.