Raphaël Gomès <rgomes@octobus.net> [Thu, 09 Jun 2022 10:45:27 +0200] rev 49348
hg-cpython: fallback when encountering an unknown matcher
At this point in the process, nothing user-visible has happened, it is still
safe to fallback. This can happen now that we're going to be using
"container matchers" like unionmatcher and intersectionmatcher.
This is easier and less error-prone than recursive checking beforehand since
only the presence of a transformation case will allow the process to continue.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 14 Jun 2022 19:40:35 +0200] rev 49347
auto-upgrade: add an option to silence the safe-mismatch message
For well tested case, the message can get in the way, so we add a way to disable
it.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 14 Jun 2022 15:22:05 +0200] rev 49346
auto-upgrade: add an option to silence the tracked-hint message
For well tested case, the message can get in the way, so we add a way to disable
it.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 14 Jun 2022 15:19:45 +0200] rev 49345
auto-upgrade: add an option to silence the dirstate-v2 message
For well tested case, the message can get in the way, so we add a way to disable
it.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 14 Jun 2022 15:17:51 +0200] rev 49344
auto-upgrade: rename a variable to match the actual content
This was the result of a copy paste.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 14 Jun 2022 15:11:36 +0200] rev 49343
auto-upgrade: add an option to silence the share-safe message
For well tested case, the message can get in the way, so we add a way to disable
it.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 14 Jun 2022 15:45:37 +0200] rev 49342
auto-upgrade: add a test that will host "quiet" testing
We will add options to suppress the message in the coming changeset. The changes
will be clearer if the full test is already in place.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 18 May 2022 10:39:45 +0100] rev 49341
bundlespec: check the `obsolescence` value before adding the caps
This does not really matters as the logic to decide wether or not adding the
part is correct and elsewhere. However this seems like a good idea to align
this logic witht he semantic of the option.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 25 May 2022 11:53:34 +0200] rev 49340
bundlespec: handle the presence of obsmarker part
This make `hg debugbundle --spec` more informative about extra part in the
bundle.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 18 May 2022 12:07:50 +0100] rev 49339
bundlespec: fix the generation of bundlespec for `cg.version`
If the value is non-default, we display it.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 18 May 2022 11:55:21 +0100] rev 49338
bundlespec: allow the bundle spec to control the bundle version
This makes it possible to create bundle using changelog-v3.
The `hg debugbundle --spec` output is borked, but this will be fixed in coming
changesets.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 25 May 2022 11:27:16 +0200] rev 49337
bundlespec: do not check for `-` in the params portion of the bundlespec
Otherwise bundle parameter with `-` in their names result in a crash.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 18 May 2022 10:38:11 +0100] rev 49336
bundlespec: add processing of some parameter value
The boolean option needs to be turned into boolean.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 18 May 2022 10:06:43 +0100] rev 49335
bundlespec: extract the parseparams closure
It has no value being a closure. We extract it before modifying it further.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 25 May 2022 10:30:11 +0200] rev 49334
bundlespec: test `no` value for the `obsolescence` parameter
This is currently broken, but let us test for it first.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 25 May 2022 03:18:47 +0200] rev 49333
bundlespec: test that parameter overwrite the local config
This is currently working, but havint it explicitly tested seems useful.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 24 May 2022 18:43:24 +0200] rev 49332
bundlespec: do not overwrite bundlespec value with the config one
This is finally making the `obsolete` bundlespec paramater work.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 17 May 2022 18:14:32 +0100] rev 49331
bundlespec: add a `overwrite` parameter to set_param
This will open the way for the configuration value to yield in front of the
explicit bundle type.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 17 May 2022 16:36:32 +0100] rev 49330
bundlespec: merge the contentopts and params dictionnary
They are content using the same keys. Using differents object for access open
the gates for confusion in the code using them (this is already the case). So we
start fusing their usages to make the parameters more useful.
More work will be needed to make them really useful, but the first step is
here: not throwing the value away.
However this is still not making the previously introduced test useful because
currently, the default config value overwrite the one from the bundlespec. We
will fix this in the coming changesets.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 25 May 2022 03:16:53 +0200] rev 49329
bundlespec: test if the "obsolete=" parameter is read
Narrator voice: Actually it is not.
We will fix it in the next changeset.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 17 May 2022 16:59:31 +0100] rev 49328
bundlespec: fix lack of title in a evolve tests
This is a full new test case and should be "flagged" as such.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 17 May 2022 14:25:53 +0100] rev 49327
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.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 17 May 2022 11:57:17 +0100] rev 49326
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.
Matt Harbison <matt_harbison@yahoo.com> [Mon, 13 Jun 2022 11:20:57 -0400] rev 49325
typing: add a missing suppression directive for `msvcrt`
Matt Harbison <matt_harbison@yahoo.com> [Mon, 13 Jun 2022 11:18:41 -0400] rev 49324
windows: drop some py2 compatibility code
The comment was wrong- the exception handler was the py3 case.
Matt Harbison <matt_harbison@yahoo.com> [Mon, 13 Jun 2022 11:06:33 -0400] rev 49323
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
Raphaël Gomès <rgomes@octobus.net> [Thu, 02 Jun 2022 16:56:39 +0200] rev 49322
relnotes: add 6.1.3
Manuel Jacob <me@manueljacob.de> [Wed, 01 Jun 2022 01:45:49 +0200] rev 49321
cleanup: return directly instead of assigning variable
Manuel Jacob <me@manueljacob.de> [Wed, 01 Jun 2022 01:30:48 +0200] rev 49320
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.
Manuel Jacob <me@manueljacob.de> [Wed, 01 Jun 2022 02:21:41 +0200] rev 49319
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.
Manuel Jacob <me@manueljacob.de> [Wed, 01 Jun 2022 00:47:25 +0200] rev 49318
py3: catch specific OSError subclasses instead of checking errno
Contrary to the previous changesets in this series, this covers cases where
errno was checked for multiple values.
EACCES -> PermissionError
ENOENT -> FileNotFoundError
ENOTDIR -> NotADirectoryError
EISDIR -> IsADirectoryError
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 23:45:33 +0200] rev 49317
py3: catch ProcessLookupError instead of checking errno == ESRCH
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 23:41:15 +0200] rev 49316
py3: catch PermissionError instead of checking errno == EPERM
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 23:38:51 +0200] rev 49315
py3: catch PermissionError instead of checking errno == EACCES
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 22:50:01 +0200] rev 49314
py3: catch FileNotFoundError instead of checking errno == ENOENT
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 21:16:17 +0200] rev 49313
py3: catch FileExistsError instead of checking errno == EEXIST
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 16:54:58 +0200] rev 49312
py3: catch BrokenPipeError instead of checking errno == EPIPE
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 04:18:22 +0200] rev 49311
py3: catch ChildProcessError instead of checking errno == ECHILD
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 04:11:34 +0200] rev 49310
py3: remove retry on EINTR errno
Since the implementation of PEP 475 (Python 3.5), Python retries system calls
failing with EINTR. Therefore we don’t need the logic that retries it in Python
code.
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 03:39:42 +0200] rev 49309
py3: stop catching TypeError that was raised on Python 2
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 03:06:05 +0200] rev 49308
py3: use `x.hex()` instead of `pycompat.sysstr(node.hex(x))`
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 02:47:22 +0200] rev 49307
tests: assume that `raw` attribute is present on original socket file object
It seems like the original socket file object is always an io.BufferedIO
instance. If not, the code will fail and we should try harder to get the socket
object (e.g. if the original socket file object is unbuffered, we can get the
`_sock` attribute directly from it).
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 02:36:05 +0200] rev 49306
tests: constant-fold a `pycompat.ispy3` in testlib/badserverext.py
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 02:19:07 +0200] rev 49305
tests: remove Python 2 special cases in test-stdio.py
Manuel Jacob <me@manueljacob.de> [Sun, 29 May 2022 15:43:21 +0200] rev 49304
py3: remove dead code to make file descriptors non-inheritable
On Python 3, file descriptors are already non-inheritable by default.
Manuel Jacob <me@manueljacob.de> [Sun, 29 May 2022 15:53:01 +0200] rev 49303
py3: remove hack that removed flush argument from print() calls on Python 2
Manuel Jacob <me@manueljacob.de> [Sun, 29 May 2022 16:12:27 +0200] rev 49302
py3: remove long() compatibility code
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 02:04:24 +0200] rev 49301
zeroconf: constant-fold a `pycompat.ispy3`
I’ve checked that both bytes and str gets passed as the `name` parameter, so
the rest of the condition is still required. Because there aren’t really any
tests for the extensions, I didn’t want to refactor it to pass a single type.
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 01:23:19 +0200] rev 49300
py3: remove conditional to import collections.abc.MutableMapping
Manuel Jacob <me@manueljacob.de> [Sun, 29 May 2022 16:24:44 +0200] rev 49299
py3: remove dead code to open file with O_CLOEXEC on Python 2
The O_CLOEXEC flag is passed by default on Python 3.
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 01:16:41 +0200] rev 49298
py3: don’t encode node.bin() argument
It accepts str and bytes.
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 01:06:29 +0200] rev 49297
convert: inline Python 3 variant of url2pathname_like_subversion()
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 00:50:29 +0200] rev 49296
py3: constant-fold some `pycompat.ispy3`
Manuel Jacob <me@manueljacob.de> [Sun, 29 May 2022 15:38:01 +0200] rev 49295
py3: use `zip()` instead of trying to use `itertools.izip()`
Manuel Jacob <me@manueljacob.de> [Sun, 29 May 2022 15:33:39 +0200] rev 49294
py3: replace mention of “xrange” in docstring by “range”
Manuel Jacob <me@manueljacob.de> [Sun, 29 May 2022 15:32:43 +0200] rev 49293
py3: remove xrange() compatibility code
Some code used its own xrange() compatibility code instead of
pycompat.xrange().
Manuel Jacob <me@manueljacob.de> [Sun, 29 May 2022 15:17:27 +0200] rev 49292
py3: replace `pycompat.xrange` by `range`
Manuel Jacob <me@manueljacob.de> [Sun, 29 May 2022 12:38:54 +0200] rev 49291
hgweb: remove dead code handling UnicodeDecodeError
I’m quite confident that the error can’t happen on Python 3, as the main
motivation for separating bytes and str in Python 3 was to avoid this class of
errors.
Manuel Jacob <me@manueljacob.de> [Sun, 29 May 2022 12:28:31 +0200] rev 49290
cleanup: remove import of already imported module
Manuel Jacob <me@manueljacob.de> [Sun, 29 May 2022 12:25:24 +0200] rev 49289
cleanup: rename some functions to avoid redefinitions
Manuel Jacob <me@manueljacob.de> [Sat, 28 May 2022 22:08:13 +0200] rev 49288
thirdparty: remove Python 2-specific selectors2 copy
The selectors module was added in Python 3.4. Because we require Python 3.6, it
will always be available. Therefore the selectors2 module is not imported.
I’ve verified that the selectors2-specific workaround in commandserver.py is not
necessary with the selectors module from the standard library. It returns an
empty list if timeout was exceeded.
The pytype directive was needed to silence the following error:
File "/tmp/mercurial-ci/mercurial/worker.py", line 299, in _posixworker: No attribute 'close' on int [attribute-error]
In Union[_typeshed.HasFileno, int]
File "/tmp/mercurial-ci/mercurial/worker.py", line 299, in _posixworker: No attribute 'close' on _typeshed.HasFileno [attribute-error]
In Union[_typeshed.HasFileno, int]
Raphaël Gomès <rgomes@octobus.net> [Wed, 08 Jun 2022 15:46:04 +0200] rev 49287
branching: merge stable into default
Manuel Jacob <me@manueljacob.de> [Thu, 02 Jun 2022 23:57:56 +0200] rev 49286
chg: replace mercurial.util.recvfds() by simpler pure Python implementation
On Python 3, we have socket.socket.recvmsg(). This makes it possible to receive
FDs in pure Python code. The new code behaves like the previous
implementations, except that it’s more strict about the format of the ancillary
data. This works because we know in which format the FDs are passed.
Because the code is (and always has been) specific to chg (payload is 1 byte,
number of passed FDs is limited) and we now have only one implementation and
the code is very short, I decided to stop exposing a function in
mercurial.util.
Note on terminology: The SCM_RIGHTS mechanism is used to share open file
descriptions to another process over a socket. The sending side passes an array
of file descriptors and the receiving side receives an array of file
descriptors. The file descriptors are different in general on both sides but
refer to the same open file descriptions. The two terms are often conflated,
even in the official documentation. That’s why I used “FD” above, which could
mean both “file descriptor” and “file description”.
Anton Shestakov <av6@dwimlabs.net> [Mon, 06 Jun 2022 13:58:32 +0400] rev 49285
parsers: drop one extra argument to PyErr_Format
GCC gave the following warning during `make local`:
mercurial/cext/parsers.c: In function 'dirstate_item_from_v1_data':
mercurial/cext/parsers.c:413:30: warning: too many arguments for format [-Wformat-extra-args]
413 | "unknown state: `%c` (%d, %d, %d)", state, mode,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To reproduce, you might need to add the -Wformat-extra-args flag, because it
isn't present for me when building for the default python3. But I can see this
warning while simply building 6.1 with `make PYTHON=python2 clean local`.
I don't think this NULL was useful, because other instances of PyErr_Format()
don't have any NULLs as the final argument, but keep in mind that I don't know
python's C API.