Wed, 07 Apr 2021 12:15:28 +0200 revlog-compression: fix computation of engine availability
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Apr 2021 12:15:28 +0200] rev 46851
revlog-compression: fix computation of engine availability We don't just need the engine to be define, we need it to be available and able to do be used for revlog compression. Without this change, `zstd` could be selected as a viable option for repository creation on platform where it is not available. Differential Revision: https://phab.mercurial-scm.org/D10325
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
(0) -30000 -10000 -3000 -1000 -300 -100 -50 -30 +30 +50 +100 +300 +1000 +3000 tip