Skip to content
Snippets Groups Projects
  1. Mar 18, 2025
  2. Mar 05, 2025
  3. Feb 26, 2025
    • Matt Harbison's avatar
      packaging: fetch gettext dependencies from m-s.o instead of sourceforge · 0570351d
      Matt Harbison authored
      The SourceForge packages were working as recently as late last week, and then
      yesterday I suddenly got a failure that the size of the download changed from
      what was expected.  Let's not trust SourceForge for critical things (though
      the MinGW package manager likely uses that too; I'm not sure how to fix that).
      
      We probably don't need this at all, now that `install-windows-dependencies.ps1`
      installs `gettext` 0.22.5 since da74e81ef9af.  But I don't feel like tinkering
      with the packaging code at this point, and running that PowerShell script in CI
      is probably pretty heavy handed.
      0570351d
  4. Feb 19, 2025
  5. Feb 06, 2025
  6. Feb 05, 2025
    • Arseniy Alekseyev's avatar
      sshpeer: fix deadlock on short writes · 7aec18bd
      Arseniy Alekseyev authored
      This commit makes the `sshpeer.doublepipe` object retry on short write,
      which fixes a deadlock in hg client-server communication, in
      particular when client needs to send a large message.
      
      Apparently Mercurial relies on `write` method on file objects
      to never return short writes, without checking, which leads to deadlocks.
      
      This work fine when the underlying file object is buffered,
      since buffered writers never return short writes.
      (why buffering has anything to do with this I don't know, but ok)
      
      It breaks horribly with raw IO, which happens to be used in sshpeer.
      7aec18bd
  7. Feb 18, 2025
    • Pierre-Yves David's avatar
      dirstatemap: stop setting identity after reading the data · e16065bb
      Pierre-Yves David authored
      The code was calling `_set_identity` in too many places, resulting in fetching
      cache information after reading the on disk data. This could result in old data
      labelled with the identity of new, never loaded data.
      
      Fixing it solve the issue spotted in the previous changesets.
      
      Further cleanup are warranted but it seems more reasonable to do them on stable.
      e16065bb
    • Pierre-Yves David's avatar
      dirstate-race: fix a missing synchronisation in the python code · 51a9148f
      Pierre-Yves David authored
      This was giving the wrong output in the `dirstate-v2-rewrite` case. As the
      dirstate is rewritten, the data file is missing and we reload the full dirstate.
      The make the dirstate reloaded after the commit and it no longer see the file as
      dirty.
      
      Note that if we were deleting the data file less aggressively, we would see the other
      output. (for example if we were keeping old data file around for some time
      before deletion).
      
      One last thing… fixing this reveal a quite serious bug where a `hg status`
      end up overwriting a `hg update` done concurrently. Hooray for proper testing.
      51a9148f
    • Pierre-Yves David's avatar
      dirstate-race: simplify some output match to highligh an error · 56519184
      Pierre-Yves David authored
      `#if dirstate-v2` is always false, because `dirstate-v2` is not one of the test
      cases. So we fix the conditionnal and adjust the expected matching.
      
      This highlight that the rhg/no-rhg output differ because an issue in the code.
      We will fix that in the next changeset.
      56519184
    • Pierre-Yves David's avatar
      dirstate-race: add more output to highlight a "to-be-revealed" bug · 5b36cb26
      Pierre-Yves David authored
      We are going to fix a bug in the test framework, that will reveal a fairly
      serious bug with the Rust code. So we update the test before hand for clarity.
      5b36cb26
    • Julien Cristau's avatar
      bundles: filter out unsupported requirements for non-packed1 format · 961900fb
      Julien Cristau authored
      stream bundle specs specify requirements, but we were ignoring this when
      selecting which bundle to apply, causing spurious clone failures.
      961900fb
  8. Feb 12, 2025
  9. Feb 08, 2025
    • Matt Harbison's avatar
      extensions: allow wrapping a function with a bytes name again · 8317993a
      Matt Harbison authored
      This backs out 7b837fabc990 and eda075d7b2ac.
      
      The cleanup to transition away from bytes broke JavaHg, which is used by hosting
      software SCM Manager.  I'm not sure who maintains JavaHg these days, so I'm not
      sure how to get a build out and get everyone to upgrade.  Let's revert the
      change for a quicker fix (and fix an unknown number of other unmaintained
      extensions), and rely on pytype to flag any potential issues.  It's also
      trivial, so let's not wait until the next feature release (with the added burden
      for packagers this cycle in dealing with the `setup.py` changes).
      8317993a
  10. Jan 29, 2025
  11. Jan 28, 2025
  12. Jan 10, 2025
  13. Jan 16, 2025
  14. Jan 14, 2025
    • Mitchell Kember's avatar
      hg-core: fix usage.resources default logic · 72deeea2
      Mitchell Kember authored
      This makes hg-core use ResourceProfileValue::Medium as the default. Before, it
      used ResourceProfileValue::Default (now removed), which was not supposed to be a
      real value, but rather an indirection meaning to use the default (medium).
      
      The motivation for this is that my implementation of rhg annotate was slower on
      some files than Python. This was because Python used the "Medium" profile by
      default (enabling the revlog chunk cache), while Rust used the "Default" profile
      (disabling the revlog chunk cache).
      72deeea2
    • Mitchell Kember's avatar
      hg-core: fix usage.resources typo · 6499af83
      Mitchell Kember authored
      This makes hg-core read resource profile configs from usage.resources. Before,
      it correctly used that for sub-values such as usage.resources.memory, but for
      the generic value it incorrectly used usage.resource (singular).
      6499af83
    • Mitchell Kember's avatar
      usage: refactor usage.resources config parsing · 1fef0d25
      Mitchell Kember authored
      This makes get_resource_profile less confusing. Before, RESOURCE_DEFAULT was a
      special indirect value which meant to use DEFAULT_RESOURCE. I removed it while
      preserving the same behavior.
      
      The motivation for this is that the Rust implementation gets the default logic
      wrong due to confusion about defaults. I will fix it in a follow-up commit.
      1fef0d25
  15. Jan 15, 2025
  16. Jan 02, 2025
    • Matt Harbison's avatar
      copyright: update to 2025 · 6ca5cf29
      Matt Harbison authored
      COPYING.rtf has a few additional changes (like the website URL), because it's
      been unmaintained for awhile now.
      6ca5cf29
  17. Dec 18, 2024
    • Pierre Augier's avatar
      help: fix command build with rust · 101c1862
      Pierre Augier authored
      The use of `--no-use-pep517` leads to
      
      ERROR: Disabling PEP 517 processing is invalid: project specifies
      a build backend of setuptools.build_meta in pyproject.toml
      101c1862
  18. Dec 13, 2024
  19. Dec 05, 2024
  20. Dec 06, 2024
  21. Nov 25, 2024
    • Matt Harbison's avatar
      manifest: delay import of `typing.ByteString` for py 3.14 support (issue6940) · 0851d94b
      Matt Harbison authored
      Since Python 2.7 and 3.5, `typing.ByteString` was defined as an alias for
      `bytes | bytearray | memoryview`, and `bytes` was also accepted as a shorthand
      for this, so we have `bytes` sprinkled all over the codebase.  But then PEP-688
      reversed all of that by deprecating `typing.ByteString` and its successor
      `collections.abc.ByteString` in Python 3.12 (as well as the `bytes` shorthand)[1],
      and removing it completely in Python 3.14.  That leaves us with a couple of
      problems, namely defining something useful that spans py3.8-py3.13 and keeps
      pytype happy, and finding all of the instances where `bytes` doesn't really mean
      `bytes`.  The current successor to all of this is `collections.abc.Buffer` in
      Python 3.12 (or `typing_extensions.Buffer` in previous versions).  However, the
      current CI does type checking using Python 3.11 (so the former is not avaiable),
      and pytype has issues with importing `typing_extensions.Buffer`[2].
      
      The good news is we don't need to deal with this mess immediately, since the
      type annotation evaluation is delayed to the type checking phase, and we're
      making no effort at supporting it in all supported versions of Python.  So by
      delaying the import of this particular symbol, we can still use it for type
      checking purposes, but can start assessing Python 3.14 problems without doing a
      lot of extra work.  Putting this on stable will allow people interested in 3.14
      to work on it 4-5 extra months earlier (and apparently there's some interest).
      
      [1] https://peps.python.org/pep-0688/#no-special-meaning-for-bytes
      [2] https://github.com/google/pytype/issues/1772
      0851d94b
  22. Nov 27, 2024
    • Matt Harbison's avatar
      run-tests: disable caching of the wheels when installing test Mercurial · a782fb58
      Matt Harbison authored
      It seems like this command doesn't currently cause the wheels to be cached, but
      since I already had to prevent `pip` from caching when building wheels in
      1a09563a615c, and also disable it in a test in 30b5dc517ec2, let's just be
      explicit that we don't want caching, in case the default behavior changes.
      a782fb58
    • Matt Harbison's avatar
      tests: use `--no-cache-dir` with `pip` · 519a997b
      Matt Harbison authored
      After 1a09563a615c, there's one more wheel that gets cached in the user's pip
      cache in the macOS CI runner.  The wheel corresponds to the version being used
      for the tests, but it doesn't get cached until the 3rd or 4th test shard is run,
      so it's not an issue with installing to run the tests.  This seems to eliminate
      that.
      
      This doesn't seem to be an issue on Windows or Linux in my setup.  Windows not
      being affected is likely because we set `$USERPROFILE` to redirect the home
      directory to `$TESTTMP` when running tests, since 08fd76a553c9.  (When checking
      with `"$PYTHON" -m pip cache dir`, it points to `$TESTTMP/pip/cache`.)  We do
      also set `$HOME` to this same location when running posix tests, but I can't
      tell what's going on locally in Linux, because running `pip` directly in the *.t
      explodes, and `"$PYTHON" -m pip --version` prints `pip 9.0.1 from /usr/lib/python3/dist-packages`,
      so that's likely before caching was enabled[1].  Running `python3.8 -m pip --version`
      locally outside of the *.t (the same version used to invoke the test runner), prints
      `pip 24.2 from /home/mharbison/.local/lib/python3.8/site-packages/pip (python 3.8)`.
      
      In CI, both macOS and Linux print a modern version of `pip`, and list the cache
      as being under `$TESTTMP`, but then it doesn't end up there on macOS.  No idea
      if it is a pip bug, or what.  But let's be explict and disable caching.
      
      [1] https://github.com/pypa/pip/blob/fe0925b3c00bf8956a0d33408df692ac364217d4/docs/html/topics/caching.md?plain=1#L37
      519a997b
    • Matt Harbison's avatar
      ci: disable caching of the wheels that get built to save space · 1a09563a
      Matt Harbison authored
      I had a pile of these one-shot wheels cached on the mac, taking about 1.2G of
      space from the few weeks we've been building wheels to test, and with the few
      times the macOS tests were actually run.  There's not much point in caching
      these, since the tests run from a wheel file the tests are force fed.  There is
      still an issue with one wheel from the tests being cached (probably on install),
      but that's 1/6 of the original problem.
      
      I'm putting this in the `pyproject.toml` because I think that's where we should
      have all of the `cibuildwheel` config collected.  There's a concurrent effort to
      modernize `setup.py` and use this file more, so I'll hold off on pushing most of
      the config in here for now.  But this applies the setting to all OSes, as well
      as when run through either CI or the individual buid scripts, so I think this is
      clearly the right way to go.
      
      Note that the docs for `cibuildwheel` talks about the intention to move from
      `pip` to `build` some day.  This config only covers the former, so the other
      config example[1] with the latter may be needed at some point.  But I don't see
      an obvious option for that tool, so we'll cross that bridge when we come to it.
      
      [1] https://cibuildwheel.pypa.io/en/v2.22.0/options/#examples_6
      1a09563a
Loading