- Feb 15, 2021
-
-
sliquister authored
I recommend looking at this with a diff that ignores indentation. The test changes are because localrepo.close() updates some cache, which appears happens earlier now on rollbacks or strips or something. The http changes are because httppeer.close() prints stats with --verbose. Differential Revision: https://phab.mercurial-scm.org/D9999
-
sliquister authored
The warning is disabled until the next commit, because fixing it results in a noisy diff due to indentation changes. Differential Revision: https://phab.mercurial-scm.org/D9998
-
sliquister authored
The wrapping of `sshpeer.cleanup` silently broke when `cleanup` was renamed to `_cleanup`, a couple of years ago. I don't know what `orig.im_self` is, but regardless, the intention of the wrapping seems pretty clear: close stderr before sshpeer._cleanuppipes blocks on it. So do that. Differential Revision: https://phab.mercurial-scm.org/D9997
-
sliquister authored
So we can tell in a next commit if we're trying to close an already closed connection or not (in which case, we may warn). Differential Revision: https://phab.mercurial-scm.org/D9996
-
sliquister authored
So the connection can be closed eagerly in future commits, instead of relying on __del__. Differential Revision: https://phab.mercurial-scm.org/D9995
-
- Jan 11, 2021
-
-
Simon Sapin authored
`compare_values`, `merge_copies_dict`, and `CombineChangesetCopies` are APIs whose signatures involve non-trivial types. Calling them directly in unit tests would involve a lot of verbose setup code that obscures the meaningful parts of a given test case. This adds a macro-based test-harness with pseudo-syntax to tersely create arguments and expected return values in the correct types. For now there is only one (not particularly meaningful) test case per tested function, just to exercize the macros. Differential Revision: https://phab.mercurial-scm.org/D10071
-
- Jan 06, 2021
-
-
Simon Sapin authored
by using the new from-bytes-safe crate and a custom struct that encodes the expected data structure. Differential Revision: https://phab.mercurial-scm.org/D10068
-
- Mar 01, 2021
-
-
Pulkit Goyal authored
`hgtagsfnodescache` can contain unknown nodes due to cache corruption and this lead to a traceback on operations like `hg tags` as we don't validate nodes. This patch validates that all filenodes returned after `hgtagsfnodescache` are known to the repository. If there exists any unknown filenode, we force recompute it and update the cache. The test change demonstrates the fix. Differential Revision: https://phab.mercurial-scm.org/D10083
-
- Feb 15, 2021
-
-
Pulkit Goyal authored
Previous patch from Matt demonstrates that `debugtagscache` does not warn about filenode being unknown which can be caused by a corrupted cache. We start by showing that it's an unknown node. Differential Revision: https://phab.mercurial-scm.org/D10015
-
- Dec 24, 2020
-
-
Matt Harbison authored
I happened to hit this trying to cover other cases around valid vs missing entries. I have no idea if this is something that could occur more naturally (similar to how a missing file node in `hgtagsfnodes1` can occur after a strip). There is a test just above this added in f5a7cf0adb12 mentioning it "overwrites the junk", though that tests truncation instead of actual garbage. But since this is just a cache, it probably shouldn't abort with a cryptic message like this. The two options I see both have downsides- either rebuild the cache (and potentially take a long time), or hint to the user to run a debug command. Differential Revision: https://phab.mercurial-scm.org/D9812
-
- Feb 16, 2021
-
-
Pulkit Goyal authored
I was touching this code in a future patch and marmoute warned about usage of `is False` here. Quoting marmoute: ``` "is False" is going to check if the object you have the very same object in memory than the one Python allocated for False (in practice 0) This will "mostly work" on cpython because of implementation details, but is semantically wrong and can start breaking unexpectedly ``` Differential Revision: https://phab.mercurial-scm.org/D10014
-
Pulkit Goyal authored
I plan to use this code at one more place while fixing a bug caused by an invalid fnode present in cache. Differential Revision: https://phab.mercurial-scm.org/D10013
-
- Feb 10, 2021
-
-
Pulkit Goyal authored
This strips the complete 20 bytes node which was not found. Having the the full node in error message is important as it makes debugging easier. If a short node is to be displayed, that should be done by callers. Differential Revision: https://phab.mercurial-scm.org/D9994
-
- Mar 04, 2021
-
-
Martin von Zweigbergk authored
Consider this simple history: ``` @ 3 modify y | o 2 copy x to y, modify x | | o 1 copy x to y, modify x |/ o 0 add x ``` If we now rebase commit 3 onto 1, Mercurial will look for copies between commit 2 and commit 1. It does that by going backwards from 2 to 0 and then forwards from 0 to 1. It will find that x was copied to y, since that was what happened on the path between them (namely in commit 1). That leads Mercurial to do a 3-way merge between y@3 and y@1 with x@2 as base. We want to use y@2 as base instead. That's also what happened until commit 1d6d1a15a963. This patch fixes the regression by adding another filtering step when chaining copies via a diffbase. The new filtering step removes copies that were the same between the two branches (same source and destination, but not necessarily the same contents). Differential Revision: https://phab.mercurial-scm.org/D10120
-
- Mar 05, 2021
-
-
Martin von Zweigbergk authored
I'll add another filtering step in `patchcopies()` next. I need access to the forward copies for that. Differential Revision: https://phab.mercurial-scm.org/D10119
-
Martin von Zweigbergk authored
I'll add another callers in the next patch. Differential Revision: https://phab.mercurial-scm.org/D10118
-
Martin von Zweigbergk authored
This test demonstrates a regression from 1d6d1a15a963. Differential Revision: https://phab.mercurial-scm.org/D10117
-
- Mar 07, 2021
-
-
Matt Harbison authored
Differential Revision: https://phab.mercurial-scm.org/D10128
-
Matt Harbison authored
Differential Revision: https://phab.mercurial-scm.org/D10127
-
- Mar 06, 2021
-
-
Matt Harbison authored
Some of these were helpful in typing other modules, and then I typed the easy-ish ones. Black forces the long `Phasedefaults` definition to be wrapped, which pytype seems OK with (as shown with `reveal_type()`), but it does seem to confuse PyCharm a bit. Differential Revision: https://phab.mercurial-scm.org/D10126
-
Matt Harbison authored
Differential Revision: https://phab.mercurial-scm.org/D10125
-
Matt Harbison authored
I'm a little unsure of this because `gettext()` clearly allows for passing unicode. But the comments seem to indicate that this is related to tests, and this was useful for catching unicode being passed to `_()` in the keyring extension. I'm also not sure why `_(None)` would make any sense, so maybe the argument shouldn't be optional? I didn't add it to the lambda in plain mode because that spilled beyond 80 characters and so black mangled it. Black and pytype disagree on where the comment to disable a check needs to go, so this has to disable and then enable the checking. Differential Revision: https://phab.mercurial-scm.org/D10124
-
Matt Harbison authored
For now, I'm just typing around the edges to help find issues with TortoiseHg. If the custom `hgdate` type is useful elsewhere as I go, I'll move it to a file dedicated to custom types. I'm not loving the ban on camelcase type names here that test-check-code.t flagged, but I'm not sure how to disable that even if everyone agreed that it's a bad idea to go against the normal convention for types. While here, fix an issue that pytype found in `parsedate` when an invalid date tuple is passed by raising a ProgrammingError instead of crashing. (Tuple doesn't have a `strip` attribute.) Differential Revision: https://phab.mercurial-scm.org/D10123
-
Matt Harbison authored
I've seen this done several ways and don't know what's correct. But pytype was unhappy about the previous way: FAILED: /mnt/c/Users/Matt/hg/tests/.pytype/pyi/mercurial/shelve.pyi /usr/bin/python3.6 -m pytype.single --imports_info /mnt/c/Users/Matt/hg/tests/.pytype/imports/mercurial.shelve.imports --module-name mercurial.shelve -V 3.6 -o /mnt/c/Users/Matt/hg/tests/.pytype/pyi/mercurial/shelve.pyi --analyze-annotated --nofail --quick /mnt/c/Users/Matt/hg/mercurial/shelve.py File "/mnt/c/Users/Matt/hg/mercurial/shelve.py", line 244, in _verifyandtransform: Function bytestr.__init__ was called with the wrong arguments [wrong-arg-types] Expected: (self, ints: Iterable[int]) Actually passed: (self, ints: Union[KeyError, TypeError, ValueError]) File "/mnt/c/Users/Matt/hg/mercurial/shelve.py", line 253, in _getversion: Function bytestr.__init__ was called with the wrong arguments [wrong-arg-types] Expected: (self, ints: Iterable[int]) Actually passed: (self, ints: ValueError) The following methods aren't implemented on ValueError: __iter__ Differential Revision: https://phab.mercurial-scm.org/D10122
-
Pierre-Yves David authored
Preventing direct access to the underlying dict fix a breakage introduced by the refactoring in d3df397e7a59. This changeset is similar to 271dfcb98544, 5272542196cc and f7621fa14b84. The breackage of `releasenotes.py` stayed under my radar as the CI did not have fuzzywuzzy installed. (Something that is about to be fixed). Differential Revision: https://phab.mercurial-scm.org/D10121
-
- Mar 03, 2021
-
-
Raphaël Gomès authored
Continue the cleanup to the remaining requirements Differential Revision: https://phab.mercurial-scm.org/D10109
-
Raphaël Gomès authored
Continue the cleanup to the remaining requirements Differential Revision: https://phab.mercurial-scm.org/D10108
-
Raphaël Gomès authored
Continue the cleanup to the remaining requirements Differential Revision: https://phab.mercurial-scm.org/D10107
-
- Mar 02, 2021
-
-
Raphaël Gomès authored
This also adds the big endian prefix `>` to make the constants truly platform-independent, even if no issue with this has been reported in the wild. Differential Revision: https://phab.mercurial-scm.org/D10104
-
- Mar 05, 2021
-
-
Martin von Zweigbergk authored
If one side of a merge renames `dir1/` to `dir2/` and the subdirectory `dir1/subdir1/` to `dir2/subdir2/`, and the other side of the merge adds a file in `dir1/subdir1/`, we should clearly move that into `dir2/subdir2/`. We already detect the directories correctly before this patch, but we iterate over them in arbitrary order. That results in the new file sometimes ending up in `dir2/subdir1/` instead. This patch fixes it by iterating over the source directories by visiting subdirectories first. That's achieved by simply iterating over them in reverse lexicographical order. Without the fix, the test case still passes on Python 2 but fails on Python 3. It depends on the iteration order of the dict. I did not look into how it's built up and why it behaved differently before the fix. I could probably have gotten it to fail on Python 2 as well by choosing different directory names. Differential Revision: https://phab.mercurial-scm.org/D10115
-
- Mar 04, 2021
-
-
Jörg Sonnenberger authored
Since Mercurial 5.7, the corresponding bundle part is ignored as redundant. Stop advertising it so that peers don't have to spend time creating or transfering it. Differential Revision: https://phab.mercurial-scm.org/D10114
-
- Jan 30, 2021
-
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D9914
-
- Mar 01, 2021
-
-
Jörg Sonnenberger authored
`read` and `readfiles` can be used with a revision just as well, so follow the naming convention in revlog to reflect this. Differential Revision: https://phab.mercurial-scm.org/D10081
-
- Feb 25, 2021
-
-
Simon Sapin authored
Differential Revision: https://phab.mercurial-scm.org/D10077
-
- Feb 05, 2021
-
-
Kyle Lippincott authored
This mechanism builds chg such that it looks for `hg` to be available at /usr/lib/mercurial/hg instead of in the $PATH as `hg`, and makes the `hg` in /usr/bin be a symlink to `chg`. It's important to note that the hg binary must continue to be named `hg`. If we wanted to instead place it at /usr/bin/pyhg or something similar, we would need to modify Mercurial to allow that basename. Failure to do so would break Mercurial's shell aliases that use `hg`, `chg`, or `$HG`. I don't know if we should ever have a setup like this be the default setup, but I'm willing to get more information on our experience with it for making such a determination. Actually making it the default might be rather involved, as we don't maintain the official debian packaging rules. Differential Revision: https://phab.mercurial-scm.org/D10020
-
- Mar 03, 2021
-
-
Jörg Sonnenberger authored
Differential Revision: https://phab.mercurial-scm.org/D10103
-
Raphaël Gomès authored
Continue the cleanup to the remaining requirements Differential Revision: https://phab.mercurial-scm.org/D10106
-
Raphaël Gomès authored
Since this series is adding a new requirement, we might as well clean up while we're here. Differential Revision: https://phab.mercurial-scm.org/D10105
-
- Feb 18, 2021
-
-
Raphaël Gomès authored
This prevents an exception within an exception because `hint` does not exist. Differential Revision: https://phab.mercurial-scm.org/D10024
-
- Feb 19, 2021
-
-
Raphaël Gomès authored
Gratuitous cleanup while I was here. Differential Revision: https://phab.mercurial-scm.org/D10023
-