- Jun 08, 2022
-
-
Raphaël Gomès authored
-
Mathias De Mare authored
-
- Jun 04, 2022
-
-
Manuel Jacob authored
The deleted code didn’t work on Python 3. On Python 2 (or Python 3 after adapting it), the function returned in the error case. The subsequent creation of SSL socket fails during handshake with a nonsense error. Instead, the user should get an error of what went wrong. I don’t see how the deleted code would be useful in the error case. The new code is also closer of what the standard library is doing nowadays that it has proxy support (which we don’t use in the moment). In the test, I use port 0 because all the HGPORTs were already taken. In practice, there should not be any server listening on port 0.
-
- Jun 03, 2022
-
-
Pierre-Yves David authored
This should maybe be called "nodesfromfile", but at least the documentation is correct (it was previously a copy past from follow).
-
- Jun 02, 2022
-
-
Manuel Jacob authored
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”.
-
Manuel Jacob authored
On Python 2, socket.error was subscriptable. On Python 3, socket.error is an alias to OSError and is not subscriptable. The except block passes the exception to self.send_error(). This fails on both Python 2 (if it was executed) and Python 3, as it expects a string. Getting the attribute .strerror works on Python 2 and Python 3, and has the same effect as the previous code on Python 2.
-
- Jun 06, 2022
-
-
Anton Shestakov authored
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.
-
- Jun 02, 2022
-
-
Manuel Jacob authored
-
- Jun 03, 2022
-
-
Pierre-Yves David authored
We return data, it is simpler when we know what these data means.
-
- May 22, 2022
-
-
Manuel Jacob authored
Previously, the code wrote the pickled data using os.write(). However, os.write() can write less bytes than passed to it. To trigger the problem, the pickled data had to be larger than 2147479552 bytes on my system. Instead, open a file object and pass it to pickle.dump(). This also has the advantage that it doesn’t buffer the whole pickled data in memory. Note that the opened file must be buffered because pickle doesn’t support unbuffered streams because unbuffered streams’ write() method might write less bytes than passed to it (like os.write()) but pickle.dump() relies on that all bytes are written (see https://github.com/python/cpython/issues/93050). The side effect of using a file object and a with statement is that wfd is explicitly closed now while it seems like before it was implicitly closed by process exit.
-
- Jun 01, 2022
-
-
Pierre-Yves David authored
Now that phabricator is no longer in us, we should avoid this useless step to save time and simplify things.
-
Pierre-Yves David authored
I though I would affect the template in the menu itself, however it just a normal piece of text that should not be here.
-
- May 31, 2022
-
-
Pierre-Yves David authored
-
Pierre-Yves David authored
-
Pierre-Yves David authored
-
Pierre-Yves David authored
-
Pierre-Yves David authored
-
Pierre-Yves David authored
-
Pierre-Yves David authored
-
Pierre-Yves David authored
-
Pierre-Yves David authored
-
Pierre-Yves David authored
-
Pierre-Yves David authored
This will be useful in case of corrupted index.
-
Pierre-Yves David authored
This will be useful in case of corrupted index.
-
Pierre-Yves David authored
We are about to add a bunch of new column and most of them are probably only relevant to --verbose. We add some more testing of the `--verbose` mode in a sidedata context.
-
Pierre-Yves David authored
Each column is now declared as a decorated function. This will make it much simpler to add more new column in the future.
-
Pierre-Yves David authored
We will add new columns with the "revnum" version of the parent. It will be useful in case we need to inspect a corrupted revlog index.
-
Pierre-Yves David authored
It will be simpler to align everything on the same side, and the right seems a better side as it match the value alignment.
-
- May 30, 2022
-
-
Pierre-Yves David authored
Adding more information will significantly increase the amount of code. So we move the code into its own module before making it more complex.
-
Pierre-Yves David authored
The command dump some content of the revlog index and omit a lot of information. I am going to make it display the missing information. For clarity, we rename the command to explicitly mention revlog.
-
Manuel Jacob authored
Changeset f574cc00831a introduced the wrapper, to make bin() behave like on Python 2, where it raised TypeError in many cases. Another previous approach, changing callers to catch binascii.Error in addition to TypeError, was backed out after negative review feedback [1]. However, I think it’s worth reconsidering the approach. Now that we’re on Python 3 only, callers have to catch only binascii.Error instead of both. Catching binascii.Error instead of TypeError has the advantage that it’s less likely to cover a programming error (e.g. passing an int to bin() raises TypeError). Also, raising TypeError never made sense semantically when bin() got an argument of valid type. As a side-effect, this fixed an exception in test-http-bad-server.t. The TODO was outdated: it was not an uncaught ValueError in batch.results() but uncaught TypeError from the now removed wrapper. Now that bin() raises binascii.Error instead of TypeError, it gets converted to a proper error in wirepeer.heads.<locals>.decode() that catches ValueError (superclass of binascii.Error). This is a good example of why this changeset is a good idea. Catching TypeError instead of ValueError there would not make much sense. [1] https://phab.mercurial-scm.org/D2244
-
- May 29, 2022
-
-
Manuel Jacob authored
Making try blocks as small as possible is generally a good idea, especially when catching very general errors like TypeError.
-
Manuel Jacob authored
-
- May 21, 2022
-
-
Manuel Jacob authored
Black commit 117891878e5be4d6b771ae5de299e51b679cea27 (included in black >= 21.11b0) dropped the string "version " from the output of "black --version". To make the regex work with newer black versions, make matching of "version " optional.
-
- May 24, 2022
-
-
kiilerix authored
This "15.0.*" requirement came from 0d99778af68a and is now replaced with plain "15.0". AFAICS, it really should allow (but not necessarily require) im-rc 15.1 . Narrow requirement requirements with wildcard in the version is not used in other places.
-
- Jun 02, 2022
-
-
Raphaël Gomès authored
-
Raphaël Gomès authored
-
Raphaël Gomès authored
-
- May 04, 2022
-
-
idlsoft authored
Reviewer note: this was sent by the author as a simple bugfix, but can be considered a security patch, since it allows users to access things outside of the ACL, hence the (SEC) prefix. However, this affects the `narrow` extention which is still marked as experimental and has relatively few users aside from large companies with their own security layers on top from what we can gather. We feel (Alphare: or at least, I feel) like pinging the packaging list is enough in this case.
-
- May 30, 2022
-
-
Raphaël Gomès authored
This should fix this error we see in the CI from time to time: ``` --- /tmp/mercurial-ci/tests/test-chg.t +++ /tmp/mercurial-ci/tests/test-chg.t.err @@ -187,6 +187,26 @@ $ chg bulkwrite --pager=on --color no --config ui.formatted=True paged! 'going to write massive data\n' killed! (?) + Traceback (most recent call last): + File "/tmp/hgtests._uvojvqb/install/lib/python/mercurial/commandserver.py", line 509, in _serverequest + sv.cleanup() + File "/tmp/hgtests._uvojvqb/install/lib/python/mercurial/chgserver.py", line 382, in cleanup + self._restoreio() + File "/tmp/hgtests._uvojvqb/install/lib/python/mercurial/chgserver.py", line 461, in _restoreio + os.close(fd) + OSError: [Errno 9] Bad file descriptor + Traceback (most recent call last): + File "/tmp/hgtests._uvojvqb/install/lib/python/mercurial/commandserver.py", line 693, in _acceptnewconnection + self._runworker(conn) + File "/tmp/hgtests._uvojvqb/install/lib/python/mercurial/commandserver.py", line 744, in _runworker + prereposetups=[self._reposetup], + File "/tmp/hgtests._uvojvqb/install/lib/python/mercurial/commandserver.py", line 509, in _serverequest + sv.cleanup() + File "/tmp/hgtests._uvojvqb/install/lib/python/mercurial/chgserver.py", line 382, in cleanup + self._restoreio() + File "/tmp/hgtests._uvojvqb/install/lib/python/mercurial/chgserver.py", line 461, in _restoreio + os.close(fd) + OSError: [Errno 9] Bad file descriptor [255] ```
-