Wed, 07 Apr 2021 00:12:07 +0200 test: explicitly use zlib compression in tests/test-share-safe.t
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Apr 2021 00:12:07 +0200] rev 46850
test: explicitly use zlib compression in tests/test-share-safe.t We need the implicit value to be explicit until we can change the default in some case. Differential Revision: https://phab.mercurial-scm.org/D10323
Tue, 06 Apr 2021 18:50:32 +0200 test: explicitly use zlib compression in tests/test-upgrade-repo.t
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 06 Apr 2021 18:50:32 +0200] rev 46849
test: explicitly use zlib compression in tests/test-upgrade-repo.t We need the implicit value to be explicit until we can change the default in some case. Differential Revision: https://phab.mercurial-scm.org/D10322
Tue, 06 Apr 2021 18:49:01 +0200 test: explicitly use zlib compression in tests/test-repo-compengines.t
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 06 Apr 2021 18:49:01 +0200] rev 46848
test: explicitly use zlib compression in tests/test-repo-compengines.t We need the implicit value to be explicit until we can change the default in some case. Differential Revision: https://phab.mercurial-scm.org/D10321
Tue, 06 Apr 2021 14:21:03 -0700 remotefilelog: include file contents in bundles produced during strip
Kyle Lippincott <spectral@google.com> [Tue, 06 Apr 2021 14:21:03 -0700] rev 46847
remotefilelog: include file contents in bundles produced during strip `hg strip` and other things that use repair.strip (such as the narrow extension's `hg tracked --removeinclude`) will "save" some commits that have a higher revision number than the oldest commit we're stripping, but aren't actually descended from any of the commits that we're stripping. It saves them in a bundle, and then reapplies them to the repo. Remotefilelog doesn't generally participate in strip, it doesn't contribute files to either the backup bundle or the "saved" bundle, and doesn't adjust linknodes when commits are stripped. This can break things like push, which rely on the linknodes. This change makes it so that remotefilelog includes files in these bundles during strip operations. During reapplication, the files are reapplied from the bundle, and the linknode is properly updated. Differential Revision: https://phab.mercurial-scm.org/D10320
Tue, 06 Apr 2021 15:38:33 -0700 tests: add test-remotefilelog-strip.t to demonstrate an issue with linknodes
Kyle Lippincott <spectral@google.com> [Tue, 06 Apr 2021 15:38:33 -0700] rev 46846
tests: add test-remotefilelog-strip.t to demonstrate an issue with linknodes ### Background Every time a commit is modified, remotefilelog updates the metadata for the file object to point to the new commit (I believe that this is different from non-remotefilelog hg, which leaves the linkrevs pointing to the obsolete commits; doing otherwise would involve changing data in the middle of revlogs). With `hg strip` (or other things that use repair.strip()), when you strip a commit that's not the tip of the revlog, there may be commits after it in revnum order that aren't descended from it and don't need to be (and shouldn't be) stripped. These are "saved" by strip in a bundle, and that bundle is reapplied after truncating the relevant revlogs. ### The problem Remotefilelog generally avoids being involved at all in strip. Currently, that includes even providing file contents to this backup bundle. This can cause the linknode to point to a changeset that is no longer in the repository. Example: ``` @ 3 df91f74b871e | | x 2 70494d7ec5ef |/ | x 1 1e423846dde0 |/ o 0 b292c1e3311f ``` Commits 1, 2, and 3 are related via obsolescence, and are description-only changes. The linknode for the file in these commits changed each time we updated the description, so it's currently df91f7. If I strip commits 1 and 3, however, the linknode *remains* df91f7, which no longer exists in the repository. Commit 70494d was "saved", stripped, and then reapplied, so it is in the repository (as revision 1 instead of 2 now), and was unobsoleted since the obsmarker was stripped as well. The linknode for the file should point to 70494d, the most recent commit that is in the repository that modified the file. Remotefilelog has some logic to handle broken linknodes, but it can be slow. We have actually disabled it internally because it's too slow for our purposes. Differential Revision: https://phab.mercurial-scm.org/D10319
Wed, 31 Mar 2021 00:19:52 +0200 mergestate: remove unused import
Joerg Sonnenberger <joerg@bec.de> [Wed, 31 Mar 2021 00:19:52 +0200] rev 46845
mergestate: remove unused import Differential Revision: https://phab.mercurial-scm.org/D10291
Tue, 30 Mar 2021 15:54:36 -0700 deb: avoid use of [[ in 'rules' file
Kyle Lippincott <spectral@google.com> [Tue, 30 Mar 2021 15:54:36 -0700] rev 46844
deb: avoid use of [[ in 'rules' file It's not supported by posix shell, and apparently my build system uses that. Differential Revision: https://phab.mercurial-scm.org/D10292
Tue, 30 Mar 2021 02:32:30 +0200 refactor: prefer checks against nullrev over nullid
Joerg Sonnenberger <joerg@bec.de> [Tue, 30 Mar 2021 02:32:30 +0200] rev 46843
refactor: prefer checks against nullrev over nullid A common pattern is using a changeset context and obtaining the node to compare against nullid. Change this to obtain the nullrev instead. In the future, the nullid becomes a property of the repository and is no longer a global constant, so using nullrev is much easier to reason about. Python function call overhead makes the difference moot, but future changes will result in more dictionary lookups otherwise, so prefer the simpler pattern. Differential Revision: https://phab.mercurial-scm.org/D10290
Tue, 30 Mar 2021 02:33:12 +0200 refactor: prefer lookup by revision, even for null
Joerg Sonnenberger <joerg@bec.de> [Tue, 30 Mar 2021 02:33:12 +0200] rev 46842
refactor: prefer lookup by revision, even for null While the nullid lookup is a special case, it is still more complicated. The common pattern is to lookup via nullrev so be consistent here. Differential Revision: https://phab.mercurial-scm.org/D10280
Mon, 29 Mar 2021 01:35:54 +0200 setdiscovery: simplify by using tiprev directly
Joerg Sonnenberger <joerg@bec.de> [Mon, 29 Mar 2021 01:35:54 +0200] rev 46841
setdiscovery: simplify by using tiprev directly tip() uses tiprev() and reads the node from it, so drop a layer of indirection. Differential Revision: https://phab.mercurial-scm.org/D10289
Sun, 28 Mar 2021 19:50:37 +0200 test: enforce master to be the default branch in test
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 28 Mar 2021 19:50:37 +0200] rev 46840
test: enforce master to be the default branch in test Newer git issue a message about this. Differential Revision: https://phab.mercurial-scm.org/D10281
Sun, 28 Mar 2021 21:53:39 +0200 fix: merge imports
Joerg Sonnenberger <joerg@bec.de> [Sun, 28 Mar 2021 21:53:39 +0200] rev 46839
fix: merge imports Differential Revision: https://phab.mercurial-scm.org/D10277
Thu, 11 Feb 2021 21:23:05 -0800 tests: update divergence test for `hg fix` to actually result in divergence
Martin von Zweigbergk <martinvonz@google.com> [Thu, 11 Feb 2021 21:23:05 -0800] rev 46838
tests: update divergence test for `hg fix` to actually result in divergence We have a test that checks that `hg fix` errors out if it might cause divergence. However, the test simply prunes the commit it then tries to fix, so fixing it wouldn't actually cause divergence. That works because the implementation is simple enough that it doesn't notice the difference. I'm about to make the implementation smarter, so let's fix the test first. Differential Revision: https://phab.mercurial-scm.org/D10267
Tue, 23 Mar 2021 22:48:27 -0700 rebase: don't call rewriteutil.precheck() with to-be-skipped commits
Martin von Zweigbergk <martinvonz@google.com> [Tue, 23 Mar 2021 22:48:27 -0700] rev 46837
rebase: don't call rewriteutil.precheck() with to-be-skipped commits It's clearly incorrect to call `rewriteutil.precheck()` for commits that we're not about to rewrite. We haven't noticed yet because the function doesn't check for divergence, but I'm about to teach it to do that. Differential Revision: https://phab.mercurial-scm.org/D10259
Tue, 23 Mar 2021 14:15:40 -0700 reabase: call rewriteutil.precheck() a bit later
Martin von Zweigbergk <martinvonz@google.com> [Tue, 23 Mar 2021 14:15:40 -0700] rev 46836
reabase: call rewriteutil.precheck() a bit later We now filter out descendants of divergence-causing commits in `_handleskippingobsolete()`. The filtered-out commits are removed from the rebase set (`destmap` and `state`). We should therefore call `rewriteutil.precheck()` after `_handleskippingobsolete()`. This patch does that. It hasn't mattered so far because `rewriteutil.precheck()` doesn't yet check for divergence, but it will soon. This affects one test where we now fail because the user is trying to rebase an ancestor instead of failing because they tried to rebase a public commit. We have several similar tests just after, where we still fail because of the phase, so that seems fine. The difference in behavior also seems fine to me. Differential Revision: https://phab.mercurial-scm.org/D10258
Tue, 23 Mar 2021 14:49:31 -0700 rebase: set `prepared = True` at very end of `_preparenewrebase()`
Martin von Zweigbergk <martinvonz@google.com> [Tue, 23 Mar 2021 14:49:31 -0700] rev 46835
rebase: set `prepared = True` at very end of `_preparenewrebase()` Once we've set `rebaseruntime.prepared = True`, `rebaseruntime.repo` starts returning the unfiltered repo. That will make my next patch break, because that patch moves the call to `rewriteutil.precheck()` after the call to `_handleskippingobsolete()`, which current happens after `prepared = True`. We therefore need to prepare by moving `prepared = True` a bit later, after `_handleskippingobsolete()`. I don't think that matters for that call. Differential Revision: https://phab.mercurial-scm.org/D10257
Fri, 19 Mar 2021 22:52:59 -0700 rebase: filter out descendants of divergence-causing commits earlier
Martin von Zweigbergk <martinvonz@google.com> [Fri, 19 Mar 2021 22:52:59 -0700] rev 46834
rebase: filter out descendants of divergence-causing commits earlier `hg rebase` treats obsolete commits differently depending what has happened to the commit: 1) Obsolete commit without non-obsolete successors: Skipped, and a note is printed ("it has no successor"). 2) Obsolete commit with a successor in the destination (ancestor of it): Skipped, and a note is printed ("already in destination"). 3) Obsolete commit with a successor in the rebase set: The commit and its descendants are skipped, and a note is printed ("not rebasing <commit> and its descendants as this would cause divergence"), unless `allowdivergence` config set. 4) Obsolete commit with a successor elsewhere: Error ("this rebase will cause divergences"), unless `allowdivergence` config set. Before this patch, we did all those checks up front, except for (3), which was checked later. The later check consisted of two parts: 1) filtering out of descendants, and 2) conditionally printing message if the `allowdivergence` config was not set. This patch makes it so we do the filtering early. A consequence of filtering out divergence-causing commits earlier is that we rebase commits in slightly different order, which has some impact on tests. Differential Revision: https://phab.mercurial-scm.org/D10249
Fri, 19 Mar 2021 10:34:16 -0700 rebase: clarify names of variables and function related to obsolete revisions
Martin von Zweigbergk <martinvonz@google.com> [Fri, 19 Mar 2021 10:34:16 -0700] rev 46833
rebase: clarify names of variables and function related to obsolete revisions Differential Revision: https://phab.mercurial-scm.org/D10248
Fri, 12 Feb 2021 16:05:02 -0800 rebase: calculate obsolescense-related info earlier
Martin von Zweigbergk <martinvonz@google.com> [Fri, 12 Feb 2021 16:05:02 -0800] rev 46832
rebase: calculate obsolescense-related info earlier My goal is to use `rewriteutil.precheck()` in the rebase code. Since rebase does its own handling of divergent commits (it skips them instead of erroring out), we need to have divergence-causing commits filtered out early. This patch helps prepare for that. Differential Revision: https://phab.mercurial-scm.org/D10247
Fri, 12 Feb 2021 16:19:33 -0800 rebase: let _handleskippingobsolete(self) read directly from self
Martin von Zweigbergk <martinvonz@google.com> [Fri, 12 Feb 2021 16:19:33 -0800] rev 46831
rebase: let _handleskippingobsolete(self) read directly from self The function already has `self` as an argument, so there's no need to pass data from `self` into it. Differential Revision: https://phab.mercurial-scm.org/D10246
Tue, 23 Mar 2021 10:12:58 -0700 tests: test divergence created during interrupted rebase
Martin von Zweigbergk <martinvonz@google.com> [Tue, 23 Mar 2021 10:12:58 -0700] rev 46830
tests: test divergence created during interrupted rebase If a rebase runs into conflicts and the user somehow rewrites an unrebased commit in the rebase set while the rebase is interrupted, continuing it might result in divergence. It turns out that we decide to skip the commit. That seems to make sense, but it wasn't obvious to me that that's what we should do. Either way, this patch adds a test case for the current behavior. Differential Revision: https://phab.mercurial-scm.org/D10256
Tue, 23 Mar 2021 09:13:29 -0700 tests: split up test-rebase-obsolete.t in four pieces
Martin von Zweigbergk <martinvonz@google.com> [Tue, 23 Mar 2021 09:13:29 -0700] rev 46829
tests: split up test-rebase-obsolete.t in four pieces The test case took 42 seconds to run the test before this patch and 12 seconds after (wall time, of course). Differential Revision: https://phab.mercurial-scm.org/D10255
Wed, 24 Mar 2021 00:04:58 +0100 path: error out if the `path://` reference point to an unknown path
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 24 Mar 2021 00:04:58 +0100] rev 46828
path: error out if the `path://` reference point to an unknown path Differential Revision: https://phab.mercurial-scm.org/D10265
Tue, 23 Mar 2021 23:55:33 +0100 path: forbid chaining `path://` definitions
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 23 Mar 2021 23:55:33 +0100] rev 46827
path: forbid chaining `path://` definitions To have `path://xxx` referencing paths that use `path://` too, we need to analyze dependencies to initialize them in the right order (and to detect cycle). I don't want to deal with that right now, so I just disallow it for now. Differential Revision: https://phab.mercurial-scm.org/D10264
Thu, 18 Mar 2021 12:02:01 +0100 path: introduce a `path://` syntax to reference other path name
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 18 Mar 2021 12:02:01 +0100] rev 46826
path: introduce a `path://` syntax to reference other path name This make it easier for a path to reuse the same location of another path with different parameter. This is useful to create path "alias" with common config option. This will become very useful to create path that reference a list of other path. This changeset focus on implemented the basic feature, future changesets will deal with various error management (and associated testing). Differential Revision: https://phab.mercurial-scm.org/D10263
Sun, 21 Mar 2021 16:31:42 +0100 path: extract sub-option logic into its own method
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 21 Mar 2021 16:31:42 +0100] rev 46825
path: extract sub-option logic into its own method We will need to re-use this logic for `path://` so we first extract it into its own method. Differential Revision: https://phab.mercurial-scm.org/D10262
Sun, 21 Mar 2021 17:52:15 +0100 path: extract the path validation logic into its own submethod
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 21 Mar 2021 17:52:15 +0100] rev 46824
path: extract the path validation logic into its own submethod We will need to re-use this logic for `path://` so we first extract it into its own method. Differential Revision: https://phab.mercurial-scm.org/D10261
Thu, 18 Mar 2021 10:12:55 +0100 path: move handling of "default" (*) suboptions value inside __init__
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 18 Mar 2021 10:12:55 +0100] rev 46823
path: move handling of "default" (*) suboptions value inside __init__ With the introduction of `path://` scheme the handling of default value will need to be subtler. We do simple code movement first to clarify the future changes. Differential Revision: https://phab.mercurial-scm.org/D10260
Tue, 16 Mar 2021 15:12:03 +0100 rhg: Initial support for the 'status' command
Georges Racinet <georges.racinet@octobus.net> [Tue, 16 Mar 2021 15:12:03 +0100] rev 46822
rhg: Initial support for the 'status' command Only comparing the working directory with its first parent revision is supported. The core logic of dirstate handling and `stat`’ing files was already in `hg-core` supporting Python-based hg with Rust extensions, so this is mostly plumbing to rhg’s CLI. For now the command is experimental and disabled by default, since it has some bugs that causes a number of tests to fail. These failures can be seen with: tests/run-tests.py --rhg --extra-config-opt rhg.status=true Differential Revision: https://phab.mercurial-scm.org/D10239
Tue, 23 Mar 2021 19:58:49 +0530 rhg: raise wdir specific error for `hg debugdata`
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 23 Mar 2021 19:58:49 +0530] rev 46821
rhg: raise wdir specific error for `hg debugdata` Helps remove the conditional in `test-debugcommands.t` for rhg. Differential Revision: https://phab.mercurial-scm.org/D10254
Sat, 20 Mar 2021 02:03:57 +0530 rhg: add support for detailed exit code for ConfigParseError
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 20 Mar 2021 02:03:57 +0530] rev 46820
rhg: add support for detailed exit code for ConfigParseError This patch adds basic support for detailed exit code to rhg with support for ConfigParseError. For now, if parsing the config results in error, we silently fallbacks to `false`. The python version in this case emits a traceback. Differential Revision: https://phab.mercurial-scm.org/D10253
Thu, 25 Mar 2021 18:02:08 +0100 contributor: change mentions of mpm to olivia
Raphaël Gomès <rgomes@octobus.net> [Thu, 25 Mar 2021 18:02:08 +0100] rev 46819
contributor: change mentions of mpm to olivia Matt Mackall is now Olivia Mackall. I reached out to her about changing the copyright notices to reflect this change and she gave me the green light, so I changed everything relevant. Differential Revision: https://phab.mercurial-scm.org/D10266
Mon, 22 Mar 2021 15:29:05 -0700 fuzz: use Python 3 in makefile
Martin von Zweigbergk <martinvonz@google.com> [Mon, 22 Mar 2021 15:29:05 -0700] rev 46818
fuzz: use Python 3 in makefile As in the previous patch, I copied the snippet defining `PYTHON` from the root Makefile. Differential Revision: https://phab.mercurial-scm.org/D10252
Mon, 22 Mar 2021 13:21:12 -0700 makefile: use Python 3 by default when building docs as well
Martin von Zweigbergk <martinvonz@google.com> [Mon, 22 Mar 2021 13:21:12 -0700] rev 46817
makefile: use Python 3 by default when building docs as well I copied the snippet defining `PYTHON` from the root Makefile. Differential Revision: https://phab.mercurial-scm.org/D10251
Mon, 22 Mar 2021 13:14:11 -0700 tests: replace some `python` by `"$PYTHON"` to not only use Python 2
Martin von Zweigbergk <martinvonz@google.com> [Mon, 22 Mar 2021 13:14:11 -0700] rev 46816
tests: replace some `python` by `"$PYTHON"` to not only use Python 2 I deleted my `python` binary as a test and a few tests started failing. Differential Revision: https://phab.mercurial-scm.org/D10250
Sat, 13 Mar 2021 03:17:00 +0100 copies: distinguish between merged and touched files during upgrade
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 13 Mar 2021 03:17:00 +0100] rev 46815
copies: distinguish between merged and touched files during upgrade This a filenode being different between p1, p2 and result does not necessarily means a merges happens. For example p2 could be a strict newer version of p1, so the p2 version is picked by the manifest merging, but then the file is manually updated before the commit. In this case the file should be detected as touched. Differential Revision: https://phab.mercurial-scm.org/D10220
Mon, 15 Mar 2021 13:37:45 +0100 copies: detect files as `touched/salvaged` if they only existed on one side
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 15 Mar 2021 13:37:45 +0100] rev 46814
copies: detect files as `touched/salvaged` if they only existed on one side The file cannot be merged if there was content to merge on the other side. So the previous record was wrong. In the general case, the file existed only on one side and got touched during the merge. So it should detected as touched. They are a special case where the merge manually prevent the file to be deleted. In this case the file is marked as `salvaged`. The result of this `salvaged` recording, copy-tracing-wise, is the same as recording it as `merged`. This is probably why they were recorded as `merged` in the first place. Differential Revision: https://phab.mercurial-scm.org/D10219
Tue, 02 Mar 2021 02:00:29 +0100 test-copies: add a test updating file content while salvaging it
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 02 Mar 2021 02:00:29 +0100] rev 46813
test-copies: add a test updating file content while salvaging it A deleted file is brought back during a merge. Its content is changed in the same go. This reveal some issue with the upgrade code. Differential Revision: https://phab.mercurial-scm.org/D10088
Sat, 13 Mar 2021 04:54:05 +0100 test-copies: show some wrong ChangedFiles upgrade
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 13 Mar 2021 04:54:05 +0100] rev 46812
test-copies: show some wrong ChangedFiles upgrade For file present only on one side and touched during merge, the upgrade code confused them as "merged". However they should be either "touched", or "salvaged" but they are currently recorded as "merged". See the next changesets for more details on these cases and fix. Differential Revision: https://phab.mercurial-scm.org/D10218
Wed, 10 Mar 2021 13:14:32 +0530 commit: get info from mergestate whether a file was merged or not
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 10 Mar 2021 13:14:32 +0530] rev 46811
commit: get info from mergestate whether a file was merged or not While commiting a merge, the commit code does not know whether a file was merged during `hg merge` or not. This leads the commit code to look for filelog ancestor to choose parents of new filelog created on merge commit. This leads to wrong results in some cases as demonstrated by previous patch. From this patch, we start storing information about merged files in mergestate in stateextras and then use that on commit to detect whether we need to set two parents or not. Differential Revision: https://phab.mercurial-scm.org/D10149
Wed, 17 Mar 2021 20:06:35 +0100 revset: introduce a `nodefromfile` revset
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 17 Mar 2021 20:06:35 +0100] rev 46810
revset: introduce a `nodefromfile` revset I though we had one, but actually we don't seem to. So here is a revset to reuse a list of node previously stored. Differential Revision: https://phab.mercurial-scm.org/D10230
Fri, 19 Mar 2021 00:28:30 -0400 commands: necessary annotations and assertions to pass pytype
Matt Harbison <matt_harbison@yahoo.com> [Fri, 19 Mar 2021 00:28:30 -0400] rev 46809
commands: necessary annotations and assertions to pass pytype This is a slightly less forceful incarnation of D7384, where pytype can be appeased with some assertions rather than disabling warnings. Differential Revision: https://phab.mercurial-scm.org/D10236
Thu, 18 Mar 2021 23:41:00 -0400 typing: mark the argument to mercurial.i18n.gettext() non-Optional
Matt Harbison <matt_harbison@yahoo.com> [Thu, 18 Mar 2021 23:41:00 -0400] rev 46808
typing: mark the argument to mercurial.i18n.gettext() non-Optional Few if any of the callers are handling a `None` return, which is making pytype complain. I tried adding @overload definitions to indicate the bytes -> bytes and None -> None relationship, but pytype doesn't seem to apply that to `_()` through the function assignment. What did work was to change `_()` into its own function that called `gettext()`, but that has an extra function call overhead. Even putting that function into an `if pycompat.TYPE_CHECKING` block and leaving the existing assignments in the `else` block caused pytype to lose track of the @overloads. At that point, I simply gave up. PyCharm doesn't like that it can return None, given the new type hints, but pytype doesn't complain about this nor does it see any callers passing None. The most important thing here is to catch str being passed anyway. Differential Revision: https://phab.mercurial-scm.org/D10235
Thu, 18 Mar 2021 18:57:21 -0400 revlog: convert an Abort message to bytes
Matt Harbison <matt_harbison@yahoo.com> [Thu, 18 Mar 2021 18:57:21 -0400] rev 46807
revlog: convert an Abort message to bytes Flagged by pytype. Differential Revision: https://phab.mercurial-scm.org/D10234
Wed, 17 Mar 2021 19:06:00 +0100 setdiscovery: add a discovery.grow-sample.dynamic option
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 17 Mar 2021 19:06:00 +0100] rev 46806
setdiscovery: add a discovery.grow-sample.dynamic option The current discovery dynamically adapt to complex situations. This makes it quick and effective, but also harder so study the effects of other improvements in such complex situation. So we add a new option to control this too. Differential Revision: https://phab.mercurial-scm.org/D10233
Wed, 17 Mar 2021 19:10:28 +0100 setdiscovery: rearrange code deciding if we will grow the sample
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 17 Mar 2021 19:10:28 +0100] rev 46805
setdiscovery: rearrange code deciding if we will grow the sample The new code is clearer and will make the next update simpler. Differential Revision: https://phab.mercurial-scm.org/D10232
Wed, 17 Mar 2021 18:40:50 +0100 debugdiscovery: document relevant config option
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 17 Mar 2021 18:40:50 +0100] rev 46804
debugdiscovery: document relevant config option These config option are here for people to experiment with it. So lets document them in the command that is used for experimentation. Differential Revision: https://phab.mercurial-scm.org/D10231
Fri, 19 Mar 2021 12:08:46 -0700 rebase: skip obsolete commits even if they have pruned successors
Martin von Zweigbergk <martinvonz@google.com> [Fri, 19 Mar 2021 12:08:46 -0700] rev 46803
rebase: skip obsolete commits even if they have pruned successors Issue 5782 reported that `hg rebase -r <obsolete commit with pruned successor>` failed with an error saying that it would cause divergence. Commit b7e2cf114e85 (rebase: do not consider extincts for divergence detection (issue5782), 2018-02-09) fixed it by letting you rebase the commit. However, that fix seems inconsistent with how we handle `hg rebase -r <pruned commit>`. To me, it should make no difference whether a commit is pruned itself or if it has (only) pruned successors. This patch changes it so we treat these two kinds of commits the same way. I let the message we print remain "note: not rebasing <commit>, it has no successor" even though that last part is not technically correct for commits with pruned successors. I doubt it will confuse users. Differential Revision: https://phab.mercurial-scm.org/D10240
Sat, 20 Mar 2021 00:37:57 +0100 tests: ask any chg instance to terminate before looking at sqlite dbs
Joerg Sonnenberger <joerg@bec.de> [Sat, 20 Mar 2021 00:37:57 +0100] rev 46802
tests: ask any chg instance to terminate before looking at sqlite dbs There are spurious errors in CI where the database is still locked, so force the daemon to quit to get deterministic behavior. Since the kill command itself is racy, also sleep 2s to give the server time to wake up and exit. Differential Revision: https://phab.mercurial-scm.org/D10244
Sat, 20 Mar 2021 00:36:43 +0100 chg: kill trailing comma in SEE ALSO
Joerg Sonnenberger <joerg@bec.de> [Sat, 20 Mar 2021 00:36:43 +0100] rev 46801
chg: kill trailing comma in SEE ALSO Differential Revision: https://phab.mercurial-scm.org/D10243
Fri, 19 Mar 2021 23:16:09 -0700 bisect: use standard one-line commit summary
Martin von Zweigbergk <martinvonz@google.com> [Fri, 19 Mar 2021 23:16:09 -0700] rev 46800
bisect: use standard one-line commit summary This makes bisect use the standardized support for one-line commit summary I added a while back. That means that it will respect the `command-templates.oneline-summary` config. If also means that the default output now includes the first line of the commit message (see test impact). Differential Revision: https://phab.mercurial-scm.org/D10245
Fri, 19 Mar 2021 13:18:53 +0100 rhg: Add more conversions between error types
Simon Sapin <simon.sapin@octobus.net> [Fri, 19 Mar 2021 13:18:53 +0100] rev 46799
rhg: Add more conversions between error types This allows using the `?` operator in more places, as the next commit does. Differential Revision: https://phab.mercurial-scm.org/D10238
Fri, 19 Mar 2021 23:51:46 +0100 tests: resort to fix test with newer git versions
Joerg Sonnenberger <joerg@bec.de> [Fri, 19 Mar 2021 23:51:46 +0100] rev 46798
tests: resort to fix test with newer git versions Differential Revision: https://phab.mercurial-scm.org/D10242
Fri, 19 Mar 2021 23:34:29 +0100 git: fix missing case from 6266d19556ad (introduction of nodeconstants)
Joerg Sonnenberger <joerg@bec.de> [Fri, 19 Mar 2021 23:34:29 +0100] rev 46797
git: fix missing case from 6266d19556ad (introduction of nodeconstants) Differential Revision: https://phab.mercurial-scm.org/D10241
Thu, 18 Mar 2021 18:24:59 -0400 merge with stable
Matt Harbison <matt_harbison@yahoo.com> [Thu, 18 Mar 2021 18:24:59 -0400] rev 46796
merge with stable
Tue, 02 Mar 2021 00:05:22 +0100 test-copies: add a test updating file content while merging a pure overwrite
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 02 Mar 2021 00:05:22 +0100] rev 46795
test-copies: add a test updating file content while merging a pure overwrite As the current test misbehavior show, this confuse various part of the code: - the committed file is different depending of the commit source, - the upgrade code compute the wrong information on this changeset. This will be fixed in upcoming patches. Differential Revision: https://phab.mercurial-scm.org/D10087
Wed, 10 Mar 2021 13:08:41 +0530 mergestate: don't pop stateextras when there are no conflicts on filemerge
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 10 Mar 2021 13:08:41 +0530] rev 46794
mergestate: don't pop stateextras when there are no conflicts on filemerge Even if `filemerge.filemerge()` didn't result in conflicts, we should not remove stateextras for a file since we now use that for more things than just merge time information. We use stateextras to store information which is required to be used by commit. I tracked this down while finding why a patch of mine which adds more commit related information does not work as expected and looses the extras in mergestate. Differential Revision: https://phab.mercurial-scm.org/D10148
Wed, 13 Jan 2021 16:14:58 +0100 node: introduce nodeconstants class
Joerg Sonnenberger <joerg@bec.de> [Wed, 13 Jan 2021 16:14:58 +0100] rev 46793
node: introduce nodeconstants class In preparing for moving from SHA1 hashes to a modern hash function, place nullid and other constant magic vules in a class. Provide the active set of constants in the repository and push it down. Provide nullid directly in strategic places like the repository as it is accessed very often. This changeset introduces the API change, but not the mechanical replacement of the node.py attributes itself. Differential Revision: https://phab.mercurial-scm.org/D9750
Wed, 10 Mar 2021 18:09:21 +0100 revlog: guarantee that p1 != null if a non-null parent exists
Joerg Sonnenberger <joerg@bec.de> [Wed, 10 Mar 2021 18:09:21 +0100] rev 46792
revlog: guarantee that p1 != null if a non-null parent exists This change does not affect the hashing (which already did this transformation), but can change the log output in the rare case where this behavior was observed in repositories. The change can simplify iteration code where regular changesets and merges are distinct branches. Differential Revision: https://phab.mercurial-scm.org/D10150
Wed, 10 Mar 2021 05:50:20 +0100 push: allow to specify multiple destinations
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 10 Mar 2021 05:50:20 +0100] rev 46791
push: allow to specify multiple destinations I end up needing that on a regular basis and it turn out to be very simple to implement. See documentation and test for details. Differential Revision: https://phab.mercurial-scm.org/D10161
Wed, 17 Mar 2021 15:20:45 +0100 push: indent the some part of the command
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 17 Mar 2021 15:20:45 +0100] rev 46790
push: indent the some part of the command That code will be put in a loop in the next changeset, pre-indenting make the next change clearer. Differential Revision: https://phab.mercurial-scm.org/D10160
Sun, 08 Nov 2020 20:17:09 +0100 bundle: optional multithreaded compression, ATM zstd-only
Joerg Sonnenberger <joerg@bec.de> [Sun, 08 Nov 2020 20:17:09 +0100] rev 46789
bundle: optional multithreaded compression, ATM zstd-only Compression type can be a huge chunk of "hg bundle", especially when using the higher compression levels. With level=22 and threads=7, the NetBSD test repository took 28:39 wall time and 157:47 user time. Before, level=22 would take 129:20 wall time and 129:07 user time. Differential Revision: https://phab.mercurial-scm.org/D9283
Sat, 13 Mar 2021 08:59:03 +0100 rust: Preallocate the returned `Vec` in `utils::files::relativize_path`
Simon Sapin <simon.sapin@octobus.net> [Sat, 13 Mar 2021 08:59:03 +0100] rev 46788
rust: Preallocate the returned `Vec` in `utils::files::relativize_path` Profiling `rhg files > /dev/null` on an old snapshot of mozilla-central (with `perf` and the Firefox Profiler: https://github.com/firefox-devtools/profiler/blob/main/docs-user/guide-perf-profiling.md) showed non-trivial time spend in this function and in `realloc`. This change makes the wall-clock time for that process on my machine go from ~190 ms to ~150 ms. Differential Revision: https://phab.mercurial-scm.org/D10199
Tue, 01 Dec 2020 12:59:33 -0500 black: merge config into main pyproject.toml now that we have it
Augie Fackler <augie@google.com> [Tue, 01 Dec 2020 12:59:33 -0500] rev 46787
black: merge config into main pyproject.toml now that we have it This means that naive contributors who just run `black` on a source file will get reasonable behavior as long as they have a recent black. Yay! This was previously D9834 but was rolled back due to test failures. nbjoerg thinks it's time to try again, so let's give it a shot. Differential Revision: https://phab.mercurial-scm.org/D10185
Tue, 01 Dec 2020 12:52:04 -0500 pyproject: add config file
Augie Fackler <augie@google.com> [Tue, 01 Dec 2020 12:52:04 -0500] rev 46786
pyproject: add config file This will tell pip et al to call our setup.py for the majority of packaging concerns, but also gives us a place to put standard config stuff like black. This was previously D9833, but was rolled back due to test breakage. nbjoerg thinks that breakage is now resolved, so we're trying again. Differential Revision: https://phab.mercurial-scm.org/D10184
Tue, 16 Mar 2021 12:52:23 +0100 perf-util: add an helper revset to use the same spec as the case search script
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 16 Mar 2021 12:52:23 +0100] rev 46785
perf-util: add an helper revset to use the same spec as the case search script This make result of the searcher script easier to use. Differential Revision: https://phab.mercurial-scm.org/D10228
Mon, 15 Mar 2021 18:01:42 +0100 perf-helpers: add a search-discovery-case script
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 15 Mar 2021 18:01:42 +0100] rev 46784
perf-helpers: add a search-discovery-case script This a small script I built to look for interesting discovery case. It is fairly basic but could be useful in various situation so lets put it in the main repositories. Differential Revision: https://phab.mercurial-scm.org/D10225
Tue, 16 Mar 2021 09:41:01 +0100 debugdiscovery: add missing byte string marker to some help text
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 16 Mar 2021 09:41:01 +0100] rev 46783
debugdiscovery: add missing byte string marker to some help text This is causing crash when using --help. Differential Revision: https://phab.mercurial-scm.org/D10227
Mon, 15 Mar 2021 17:09:42 +0100 debugdiscovery: also integrate the discovery output in the json one
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 15 Mar 2021 17:09:42 +0100] rev 46782
debugdiscovery: also integrate the discovery output in the json one We add a way for formatter to informs code that free output is unwanted, and we incorporate it in the json output. Differential Revision: https://phab.mercurial-scm.org/D10224
Mon, 15 Mar 2021 16:55:03 +0100 debugdiscovery: add support for Json output
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 15 Mar 2021 16:55:03 +0100] rev 46781
debugdiscovery: add support for Json output They are some pre-output that will be impractical, I'll take care of it in the next changeset. Differential Revision: https://phab.mercurial-scm.org/D10223
Mon, 15 Mar 2021 16:37:11 +0100 perf-helper: add a new sampling revset based on anti-chain
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 15 Mar 2021 16:37:11 +0100] rev 46780
perf-helper: add a new sampling revset based on anti-chain See inline documentation for details. Differential Revision: https://phab.mercurial-scm.org/D10222
Mon, 15 Mar 2021 16:35:54 +0100 perf-helper: add a small extension with revsets to select repository subset
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 15 Mar 2021 16:35:54 +0100] rev 46779
perf-helper: add a small extension with revsets to select repository subset Playing with discovery requires building interesting case. To do this we need revsets to try to generate them. We start with a quite simple one. See documentation for details. Differential Revision: https://phab.mercurial-scm.org/D10221
Tue, 26 Feb 2019 15:54:20 -0800 amend: mark commit obsolete after moving working copy
Martin von Zweigbergk <martinvonz@google.com> [Tue, 26 Feb 2019 15:54:20 -0800] rev 46778
amend: mark commit obsolete after moving working copy We were doing it this way: 1. move working copy (repo.setparents) 2. add obsmarkers (scmutil.cleanupnodes) 3. fix dirstate (dirstate.normal/drop) Step 1 and 3 are closely related, so let's move them together. It seems safest to create the obsmarkers last. This patch thus makes the order 1, 3, 2. Differential Revision: https://phab.mercurial-scm.org/D10197
Wed, 10 Mar 2021 06:03:01 +0100 pull: allow to specify multiple sources
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 10 Mar 2021 06:03:01 +0100] rev 46777
pull: allow to specify multiple sources I end up needing that on a regular basis and it turn out to be very simple to implement. See documentation and test for details. Differential Revision: https://phab.mercurial-scm.org/D10159
Wed, 10 Mar 2021 06:03:55 +0100 pull: pre-indent a part of the function
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 10 Mar 2021 06:03:55 +0100] rev 46776
pull: pre-indent a part of the function We are about to run it in a loop, so lets pre-indent it to clarify the actual change in the next changesets. Differential Revision: https://phab.mercurial-scm.org/D10158
Wed, 10 Mar 2021 05:54:27 +0100 command: clarify `postincoming` return and that return handling
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 10 Mar 2021 05:54:27 +0100] rev 46775
command: clarify `postincoming` return and that return handling The command should return None or a return code. The previous code was returning boolean directly relying on the fact that `True → 1` and `False → 0`. This is a good road to troubles, so lets be explicit about that return. Differential Revision: https://phab.mercurial-scm.org/D10157
Wed, 10 Mar 2021 05:54:02 +0100 hg: make `clean` return consistent with the `update` function
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 10 Mar 2021 05:54:02 +0100] rev 46774
hg: make `clean` return consistent with the `update` function The function return a boolean and is used as such. Lets be explicit about it. Differential Revision: https://phab.mercurial-scm.org/D10156
Wed, 10 Mar 2021 16:28:46 +0100 tests: rename `test-pull` to `test-pull-network.t`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 10 Mar 2021 16:28:46 +0100] rev 46773
tests: rename `test-pull` to `test-pull-network.t` If is mostly about ssh and http interaction so lets avoid confusion with a generic `hg pull` test Differential Revision: https://phab.mercurial-scm.org/D10155
Wed, 10 Mar 2021 16:35:17 +0100 tests: move a test about update in test-pull-update.t
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 10 Mar 2021 16:35:17 +0100] rev 46772
tests: move a test about update in test-pull-update.t Differential Revision: https://phab.mercurial-scm.org/D10154
Fri, 12 Mar 2021 09:15:40 -0800 split: close transaction in the unlikely event of a conflict while rebasing
Martin von Zweigbergk <martinvonz@google.com> [Fri, 12 Mar 2021 09:15:40 -0800] rev 46771
split: close transaction in the unlikely event of a conflict while rebasing `hg split` *should* never result in conflicts, but in case there are bugs, we should at least commit the transaction so they can continue the rebase. One of our users ran into the regression fixed by D10120. They fixed the conflict and the tried to continue the rebase, but it failed with "abort: cannot continue inconsistent rebase" because the rebase state referred to commits written in a transaction that was never committed. Side note: `hg split` should probably turn off copy tracing to reduce the impact of such bugs, and to speed it up as well. Copies made in the rebased commits should still be respected because `hg rebase` calls `copies.graftcopies()`. Differential Revision: https://phab.mercurial-scm.org/D10164
Mon, 15 Mar 2021 13:05:00 +0100 rust-status: fix issue6456 for the Rust implementation also
Raphaël Gomès <rgomes@octobus.net> [Mon, 15 Mar 2021 13:05:00 +0100] rev 46770
rust-status: fix issue6456 for the Rust implementation also This implementation is being used by a few people now, so we need it fixed, even though a big rewrite will be coming quite soon. Differential Revision: https://phab.mercurial-scm.org/D10217
Tue, 16 Mar 2021 00:07:12 +0100 README: document requirement for builtin zstd
Joerg Sonnenberger <joerg@bec.de> [Tue, 16 Mar 2021 00:07:12 +0100] rev 46769
README: document requirement for builtin zstd Differential Revision: https://phab.mercurial-scm.org/D10226
Mon, 08 Mar 2021 21:04:51 +0100 ci: Add a job testing with rhg installed as `hg`
Simon Sapin <simon.sapin@octobus.net> [Mon, 08 Mar 2021 21:04:51 +0100] rev 46768
ci: Add a job testing with rhg installed as `hg` This significantly increases test coverage of rhg, without duplicating many tests that already exist. The `cargo build` command being remove only compiled a `rhg` executable (as shown by the preceding `cd` command) but since a previous patch `run-tests.py --rhg` now takes care of that. Differential Revision: https://phab.mercurial-scm.org/D10196
Wed, 10 Mar 2021 13:54:46 +0100 run-test: install rhg if --rhg is passed
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 10 Mar 2021 13:54:46 +0100] rev 46767
run-test: install rhg if --rhg is passed Before this, --rhg was only working with --local. Differential Revision: https://phab.mercurial-scm.org/D10195
Wed, 10 Mar 2021 13:54:13 +0100 makefile: add a install option
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 10 Mar 2021 13:54:13 +0100] rev 46766
makefile: add a install option This gives and easy way to install rhg that we can use in `run-test.py` in the next changesets. Differential Revision: https://phab.mercurial-scm.org/D10194
Wed, 10 Mar 2021 13:54:00 +0100 makefile: add a build-rhg option
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 10 Mar 2021 13:54:00 +0100] rev 46765
makefile: add a build-rhg option This gives an easy action to build the rhg-binary. This will be useful for the `install-rhg` action in the next changeset. Differential Revision: https://phab.mercurial-scm.org/D10193
Wed, 10 Mar 2021 13:53:47 +0100 makefile: add a install-chg option
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 10 Mar 2021 13:53:47 +0100] rev 46764
makefile: add a install-chg option This is done as a gratuitous improvement on the way to add makefile entry to build and install rhg. It seems saner to have equivalent entry for chg too. Differential Revision: https://phab.mercurial-scm.org/D10192
Wed, 10 Mar 2021 13:53:31 +0100 makefile: add a build-chg option
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 10 Mar 2021 13:53:31 +0100] rev 46763
makefile: add a build-chg option This is done as a gratuitous improvement on the way to add makefile entry to build and install rhg. It seems saner to have equivalent entry for chg too. Differential Revision: https://phab.mercurial-scm.org/D10191
Fri, 12 Mar 2021 23:04:56 +0100 tests: Disable for rhg remaining tests that fail in that mode
Simon Sapin <simon.sapin@octobus.net> [Fri, 12 Mar 2021 23:04:56 +0100] rev 46762
tests: Disable for rhg remaining tests that fail in that mode These cases are in features not yet implemented by rhg for which triggering a fallback is not practical. Disabling some tests allows us to reach passing CI and catch any future regression in the rest of the tests. Differential Revision: https://phab.mercurial-scm.org/D10190
Fri, 12 Mar 2021 21:44:07 +0100 rhg: Remove `rhg.fallback-executable=hg` default configuration
Simon Sapin <simon.sapin@octobus.net> [Fri, 12 Mar 2021 21:44:07 +0100] rev 46761
rhg: Remove `rhg.fallback-executable=hg` default configuration When `rhg.on-unsupported` is configured to `fallback` and an unsupported feature is encountered, the previous default was to look for an `hg` executable in `$PATH`. This default was fragile since it was easy to end up accidentally using an older version of Mercurial installed system-wide, when a local (perhaps patched) installation was intended. Instead, it is now an error to have `rhg.on-unsupported=fallback` without also configuring an explicit path or the fallback executable. Differential Revision: https://phab.mercurial-scm.org/D10189
Tue, 09 Mar 2021 09:17:24 +0100 rhg: Return an error code for `rhg config Section.idontexist`
Simon Sapin <simon.sapin@octobus.net> [Tue, 09 Mar 2021 09:17:24 +0100] rev 46760
rhg: Return an error code for `rhg config Section.idontexist` This is what Python-based hg does. Differential Revision: https://phab.mercurial-scm.org/D10145
Mon, 08 Mar 2021 20:04:20 +0100 rhg: Fall back to Python for --version
Simon Sapin <simon.sapin@octobus.net> [Mon, 08 Mar 2021 20:04:20 +0100] rev 46759
rhg: Fall back to Python for --version Clap has some built-in support for printing something on --version, but it looks different than what Pytho-based hg does. Also, at the moment we’re not giving version numbers to rhg separate from the Mercurial version. Differential Revision: https://phab.mercurial-scm.org/D10144
Mon, 08 Mar 2021 19:25:33 +0100 rhg: Exit with an error code if `files` finds nothing
Simon Sapin <simon.sapin@octobus.net> [Mon, 08 Mar 2021 19:25:33 +0100] rev 46758
rhg: Exit with an error code if `files` finds nothing This matches the behavior of Python-based hg. Differential Revision: https://phab.mercurial-scm.org/D10143
Wed, 03 Mar 2021 16:40:03 +0100 rhg: `cat` command: print error messages for missing files
Simon Sapin <simon.sapin@octobus.net> [Wed, 03 Mar 2021 16:40:03 +0100] rev 46757
rhg: `cat` command: print error messages for missing files And exit with an error code if no file was matched. This matches the behavior of Python-based hg. Differential Revision: https://phab.mercurial-scm.org/D10142
Mon, 08 Mar 2021 19:07:29 +0100 rhg: Silently ignore missing files in config %include
Simon Sapin <simon.sapin@octobus.net> [Mon, 08 Mar 2021 19:07:29 +0100] rev 46756
rhg: Silently ignore missing files in config %include … instead of aborting with an error message. This is what Python-based hg does. Differential Revision: https://phab.mercurial-scm.org/D10141
Mon, 08 Mar 2021 15:35:32 +0100 rhg: Add support for environment variables in config include paths
Simon Sapin <simon.sapin@octobus.net> [Mon, 08 Mar 2021 15:35:32 +0100] rev 46755
rhg: Add support for environment variables in config include paths Some tests rely on this. Differential Revision: https://phab.mercurial-scm.org/D10140
(0) -30000 -10000 -3000 -1000 -300 -100 -96 +96 +100 +300 +1000 +3000 tip