Mon, 05 Apr 2021 12:21:12 +0200 revlog: move the details of revlog "v2" index inside revlog.utils.constants
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 05 Apr 2021 12:21:12 +0200] rev 46858
revlog: move the details of revlog "v2" index inside revlog.utils.constants the revlog module is quite large and this kind of format information would handy for other module. So let us start to gather this information about the format in a more appropriate place. We update various reference to this information to use the new "source of truth" in the process. Differential Revision: https://phab.mercurial-scm.org/D10305
Mon, 05 Apr 2021 12:21:01 +0200 revlog: move the details of revlog "v1" index inside revlog.utils.constants
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 05 Apr 2021 12:21:01 +0200] rev 46857
revlog: move the details of revlog "v1" index inside revlog.utils.constants The revlog module is quite large and this kind of format information would handy for other module. So let us start to gather this information about the format in a more appropriate place. We update various reference to this information to use the new "source of truth" in the process. Differential Revision: https://phab.mercurial-scm.org/D10304
Mon, 05 Apr 2021 12:20:52 +0200 revlog: move the details of revlog "v0" index inside revlog.utils.constants
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 05 Apr 2021 12:20:52 +0200] rev 46856
revlog: move the details of revlog "v0" index inside revlog.utils.constants the revlog module is quite large and this kind of format information would handy for other module. So let us start to gather this information about the format in a more appropriate place. Differential Revision: https://phab.mercurial-scm.org/D10303
Mon, 05 Apr 2021 12:20:40 +0200 revlog: add some comment in the header sections
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 05 Apr 2021 12:20:40 +0200] rev 46855
revlog: add some comment in the header sections We are about to add more content so let us organise the existing content first. Differential Revision: https://phab.mercurial-scm.org/D10302
Tue, 06 Apr 2021 10:37:55 +0200 store: drop the `filefilter` argument to `_walk`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 06 Apr 2021 10:37:55 +0200] rev 46854
store: drop the `filefilter` argument to `_walk` No code use it anywhere. Dropping it will help replacing the function with something with a more precise semantic. Differential Revision: https://phab.mercurial-scm.org/D10314
Tue, 06 Apr 2021 10:37:47 +0200 store: document the `walk` method
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 06 Apr 2021 10:37:47 +0200] rev 46853
store: document the `walk` method Differential Revision: https://phab.mercurial-scm.org/D10313
Tue, 06 Apr 2021 13:49:19 -0400 revlog: fix error about unknown compression format in py3
Valentin Gatien-Baron <vgatien-baron@janestreet.com> [Tue, 06 Apr 2021 13:49:19 -0400] rev 46852
revlog: fix error about unknown compression format in py3 In py2, the error is something like: abort: unknown compression type 'x'! In py3, we get the following unhelpful message: abort: unknown compression type <memory at 0x7f4650b5cdc8>! Switch to something like: abort: unknown compression type 78! Differential Revision: https://phab.mercurial-scm.org/D10318
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
(0) -30000 -10000 -3000 -1000 -300 -100 -50 -24 +24 +50 +100 +300 +1000 +3000 tip