bundlespec: make the `stream` case less special
The handling of the stream case seems fragile (does not account for newer parts
and options that will arise) and has special code dedicated to it.
To simplify and strengthen things, we make it use the same mechanism as the other
options. So we make it less special by making it a special value in the common case.
bundlespec: phase out the `_bundlespeccgversions` mapping
The `_bundlespeccgversions` mapping is redundant with the `cg.version`
parameter. We move all users to the `cg.version` version and phase out the
`_bundlespeccgversions` mapping.
commit: allow to close branch when committing change over a closed head
Otherwise, an explicit other commit become necessary, which seems both silly and
verbose.
This is useful when merging closed heads on the same branches, for example when
merging multiple repositories together.
windows: drop some py2 compatibility code
The comment was wrong- the exception handler was the py3 case.
windows: prevent bytes from being passed to registry APIs
There was a TortoiseHg bug report in this area[1], and from inspection, it looks
like passing `b""` as `valname` would fail to convert to unicode. The
underlying API allows both `""` and `NULL` to return the default value for the
key.
[1] https://foss.heptapod.net/mercurial/tortoisehg/thg/-/issues/5803
logcmdutil: use the same data as {file*} template keywords (
issue6642)
Since
0c72eddb4be5 template keywords that show files use a different source of
data than ctx.p1().status(ctx). These two functions in logcmdutil also show
file lists when needed (e.g. log with --debug flag), but previously they used
the old way of just looking at status compared to p1 and it resulted in
differences between e.g. hg log --debug and hg log -T '{file*}'.
test-phases.t needs an adjustment because 7 is a merge commit of two
topological branches and one of them introduces files C, D and E.
tests: show that hg log --debug output differs from {file*} template keywords
hg log --debug -T xml doesn't differ, but let's test it because we can.
commit: remove special handling of IOError (actually dead code)
In the past, IOError was used to mark a file as removed. The differentiation
between OSError and IOError in this place was introduced in
e553a425751d, to
avoid that “normal” OSErrors / IOErrors accidentally mark files as removed.
This weird internal API was removed in
650b5b6e75ed. It seems like that
changeset should have removed the differentiation, at least I don’t see any
reason for keeping it.
On Python 3, OSError and IOError are aliased. Therefore the removed code was
actually dead.
py3: catch specific OSError subclasses instead of checking errno
On Python 3, the "not a directory" error is mapped to ENOTDIR instead of
EINVAL. Therefore, catching the NotADirectoryError subclass is sufficient.