Skip to content
Snippets Groups Projects
  1. Feb 22, 2025
  2. Oct 08, 2024
  3. Sep 24, 2024
  4. Mar 27, 2024
  5. Mar 10, 2024
    • Pierre-Yves David's avatar
      branchcache: stop writing more branchcache file on disk than needed · 2e8a88e5809f
      Pierre-Yves David authored
      Before this change, we were unconditionally writing a branchmap file for the
      filter level passed to `update_disk`. This is actually counter productive if no
      update were needed for this filter level. In many case, the branch cache for a
      filter level is identical to its parent "subset" and it is better to simply
      keep the subset update and reuse it every time instead of having to do identical
      work for similar subset.
      
      So we change the `update_disk` method to only write a file when that filter
      level differ from its parent. This removes many cases where identical files were
      written, requiring multiple boring update in the test suite.
      
      The only notable changes is the change to `test-strip-branch-cache.t`, this
      case was checking a scenario that no longer reproduce the bug as writing less
      branchmap file result in less stalled cache on disk.
      
      Strictly speaking, we could create a more convoluted scenario that create a
      similar issue. However the next changeset would also cover that scenario so we
      directly updated that test case to a "no longer buggy" state.
      2e8a88e5809f
  6. Feb 20, 2024
    • Pierre-Yves David's avatar
      phases: keep internal state as rev-num instead of node-id · f8bf1a8e9181
      Pierre-Yves David authored
      Node-id are expensive to work with, dealing with revision is much simple and
      faster.
      
      The fact we still used node-id here shows how few effort have been put into
      making the phase logic fast. We tend to no longer use node-id internally for
      about ten years.
      
      This has a large impact of repository with many draft roots. For example this
      Mozilla-try copy have ½ Million draft roots and `perf::unbundle` see a
      significant improvement.
      
      ### data-env-vars.name            = mozilla-try-2023-03-22-zstd-sparse-revlog
        # benchmark.name                = hg.perf.perf-unbundle
        # bin-env-vars.hg.flavor        = no-rust
        # bin-env-vars.hg.py-re2-module = default
        # benchmark.variants.issue6528  = disabled
      
        # benchmark.variants.revs = last-1
      before:: 1.746791 seconds
      after::  1.278379 seconds  (-26.82%)
      
        # benchmark.variants.revs = last-10
      before:: 3.145774 seconds
      after::  2.103735 seconds  (-33.13%)
      
        # benchmark.variants.revs = last-100
      before:: 3.487635 seconds
      after::  2.446749 seconds  (-29.85%)
      
        # benchmark.variants.revs = last-1000
      before:: 5.007568 seconds
      after::  3.989923 seconds  (-20.32%)
      f8bf1a8e9181
  7. Feb 23, 2024
    • Pierre-Yves David's avatar
      debug: add a debug::unbundle command that simulate the unbundle from a push · e2dfa403452d
      Pierre-Yves David authored
      The code have different behavior when the unbundle comes from a push, so we
      introduce a command that can simulate such unbundle.
      
      For our copy of mozilla-try-2023-03-22, this make the unbundle jump from 2.5
      seconds (with `hg unbundle`) to 15 seconds (with `hg debug::unbundle`).
      
      That 15 seconds timings is consistent with the issue seen in production.
      e2dfa403452d
  8. Oct 31, 2023
  9. Dec 11, 2023
    • Pierre-Yves David's avatar
      changelog: never inline changelog · dcaa2df1f688
      Pierre-Yves David authored
      The test suite mostly use small repositories, that implies that most changelog in the
      tests are inlined. As a result, non-inlined changelog are quite poorly tested.
      Since non-inline changelog are most common case for serious repositories, this
      lack of testing is a significant problem that results in high profile issue like
      the one recently fixed by 66417f55ea33 and 849745d7da89.
      
      Inlining the changelog does not bring much to the table, the number of total
      file saved is negligible, and the changelog will be read by most operation
      anyway.
      
      So this changeset is make it so we never inline the changelog, and de-inline the
      one that are still inlined whenever we touch them.
      
      By doing that, we remove the "dual code path" situation for writing new entry to
      the changelog and move to a "single code path" situation. Having a single
      code path simplify the code and make sure it is covered by test (if test cover
      that situation obviously)
      
      
      This impact all tests that care about the number of file and the exchange size,
      but there is nothing too complicated in them just a lot of churn.
      
      The churn is made "worse" by the fact rust will use the persistent nodemap on
      any changelog now. Which is overall a win as it means testing the persistent
      nodemap more and having less special cases.
      
      In short, having inline changelog is mostly useless and an endless source of
      pain. We get rid of it.
      dcaa2df1f688
  10. Sep 19, 2023
  11. Jun 26, 2023
  12. Feb 28, 2023
    • Matt Harbison's avatar
      configitems: enable changegroup3 by default (unless using infinitepush) · 2cf264e9aa75
      Matt Harbison authored
      The LFS extension requires this, and if it isn't enabled on the client (or the
      LFS extension isn't loaded), a web client gets a 500 instead of a sensible error
      message.  Now it gets a different (client) error, but maybe it can be handled
      more gracefully.  c0f11347b107 indicates that treemanifest repos have this issue
      too.  29cfc474c5fd mentions gating this behind `experimental` so that the format
      could change, but that was 7 years ago and we now have an experimental
      `changegroup4` as well.
      
      We can keep this as a config for the next cycle in case someone runs into an
      unexpected problem, and then jettison it if the infinitepush bundle name changes
      are either acceptable as-is or can be created differently.
      2cf264e9aa75
  13. Jan 19, 2023
    • Arun Kulshreshtha's avatar
      debugshell: allow commands to be specified as a CLI argument · 8f76a41ee465
      Arun Kulshreshtha authored
      Add a `--command` option to `hg debugshell` that allows the user to pass in
      Python code to evaluate directly from the command line. This was inspired by
      the `--command` option present in Facebook's Sapling fork of Mercurial,
      which in turn was inspired by the `-c` option of the Python interpreter
      itself. It is particularly useful for writing tests, especially for getting
      visibility into things that otherwise aren't exposed via debug commands.
      8f76a41ee465
  14. Jan 04, 2023
    • Matt Harbison's avatar
      tests: drop `(py3 !)` output matching predicates · 950c39918bd2
      Matt Harbison authored
      Presumably these were paired with `(no-py3 !)` at one point, but now they were
      unconditionally true.
      
      test-check-code.t required a couple of `(glob)` markers on the changed lines in
      test-lfs-serve-access.t, because of the `$LOCALIP` usage on those lines.  Not
      sure how those lines slipped through the checks previously.
      950c39918bd2
  15. Nov 21, 2022
  16. May 31, 2022
  17. May 18, 2022
  18. Feb 20, 2022
  19. Jan 27, 2022
    • Pierre-Yves David's avatar
      stream-clone: allow to change persistent-nodemap format during stream clone · de3ac3d2c60b
      Pierre-Yves David authored
      Persistent nodemap affect the store format. However it is fairly isolated and
      fast to generate locally. So not making it a fixed part of the stream clone is
      useful.
      
      This allow clients without persistent-nodemap support (default for client
      without Rust enabled, or simply older client). So it make it possible to enable
      persistent nodemap on client, where it can provide a massive boost. without too
      much consequence.
      
      To do so, we stop using it in the advertisement requirements for streaming and
      let the client add/remove the necessary file depending of its configuration.
      
      We still send the files as it seems like a small save to not regenerate them.
      In addition, the way we match them will overlap with the changelog-v2/revlog-v2
      so we can't simply skip the associated patterns.
      
      Differential Revision: https://phab.mercurial-scm.org/D12096
      de3ac3d2c60b
  20. Jan 24, 2022
    • Pierre-Yves David's avatar
      requirements: add an official `REVLOG_COMPRESSION_ZSTD` const · 6fd9a17c32ab
      Pierre-Yves David authored
      Such constant was missing and its value was missing from the set of requirements
      that needs to be preserved through stream clone. This did not had any
      consequence yet as the "bundle 2 does not filter its requirements" is shadowing
      the issue.
      
      However we are now in a situation where we can fix this issue. So lets do it
      next.
      
      With the preparation work on test, changing the streamreqs value only impact two
      tests, where checking the full value seems to remains relevant.
      
      Important note: Since older version of Mercurial used the old `supportedformat`
      class attribute to check for stream requirement they supported, older version
      will consider this requirements to prevent them from using streaming clone. Even
      as they support this requirements for years. Pack for stable will be send to fix
      it, but they will have to be backported to older version if needed.
      
      Differential Revision: https://phab.mercurial-scm.org/D12083
      6fd9a17c32ab
    • Pierre-Yves David's avatar
      test-bundle: split some variant in there own section · ff0233f36f6a
      Pierre-Yves David authored
      Same rational as the previous commit about test-bundle.t. These line are quite
      volatile and having dedicated block will make their update clearer and simpler.
      
      Differential Revision: https://phab.mercurial-scm.org/D12076
      ff0233f36f6a
  21. Aug 27, 2021
  22. Aug 03, 2021
    • sliquister's avatar
      tests: rely on dummyssh being the default · 9c4204b7f3e4
      sliquister authored
      This commit is exactly the result of running this command:
      
      sed -i -e 's! *\(-e \|--ssh \|--config ui.ssh=\)[ \"]*$PYTHON[ \"]*$\(RUN\|\)TESTDIR/dummyssh[\"]* *! !g' -e '/^[ >]*ssh *=[ "]*$PYTHON[ "]*$\(RUN\|\)TESTDIR\/dummyssh[ "]*$/d' -e 's/^\(  [$] .*[^ ]\) *$/\1/' *.t *.sh
      
      Sometimes the tests can be simplified further, but I think it's
      preferable to do the simplification separately.
      
      Differential Revision: https://phab.mercurial-scm.org/D11245
      9c4204b7f3e4
  23. Jan 14, 2021
  24. Apr 06, 2021
Loading