Skip to content
Snippets Groups Projects
  1. Jun 19, 2024
  2. Sep 12, 2024
  3. Jun 19, 2024
  4. Mar 26, 2024
    • Raphaël Gomès's avatar
      util: make buffer readonly · f5c46c35
      Raphaël Gomès authored
      There is no use of writable buffers anywhere in the code, and this helps us
      make sure we don't get into unsound territory when sharing memory with Rust.
      
      This `toreadonly` method was not available in Python 3.6, but we dropped the
      support for it earlier that week, so no need for any compatibility code.
      f5c46c35
  5. Sep 05, 2024
    • Matt Harbison's avatar
      setup: avoid the deprecated `distutils.spawn.find_executable` · 4dc1fc2b
      Matt Harbison authored
      I noticed this was flagged with `DeprecationWarning` in py3.12 with `setuptools`
      74.1.2, and it suggested `shutil.which()` instead.  The signatures aren't the
      same, but the additional `mode` argument in the middle of the latter defaults to
      `os.F_OK | os.X_OK`, which maintains the same semantics.
      4dc1fc2b
    • Matt Harbison's avatar
      setup: drop the hack to disable linker warning 4197 on Windows · 3f0db3b6
      Matt Harbison authored
      I don't see this when building on Windows with py3.8 or py3.12, so either the
      code was fixed, or (more likely) the compiler stopped warning about it some time
      after VS 2008.  If we do have to put this back, it would probably be better to
      put a `#pragma` in a header file somewhere, and avoid `setuptools` technical
      debt.
      3f0db3b6
  6. Sep 10, 2024
  7. Aug 28, 2024
    • Pierre-Yves David's avatar
      ci: add the option to test more Python versions · 243e805e
      Pierre-Yves David authored
      It seems like a good idea to be able to test the lowest version we support. And
      there have been enougth issue with 3.12 that we need to be able to make sur we
      do not break it. We should probably get a matrix setup for more version and
      flavor, but that is a simple and efficient start.
      243e805e
  8. Sep 05, 2024
  9. Sep 11, 2024
  10. Sep 12, 2024
  11. Sep 11, 2024
  12. Nov 15, 2023
    • Jörg Sonnenberger's avatar
      archive: defer opening the output until a file is matched · 3b8d92f7
      Jörg Sonnenberger authored
      Before, if no file is matched, an error is thrown, but the archive is
      created anyway. When using hgweb, an error 500 is returned as the
      response body already exists when the error is seen.
      
      Afterwards, the archive is created before the first match is emitted.
      If no match is found, no archive is created. This is more consistent
      behavior as an empty archive is not a representable in all output
      formats, e.g. tar archives.
      3b8d92f7
  13. Sep 05, 2024
  14. Sep 10, 2024
  15. Sep 06, 2024
  16. Sep 05, 2024
  17. Aug 28, 2024
  18. Jun 30, 2024
  19. Jun 28, 2024
  20. Aug 07, 2024
    • Manuel Jacob's avatar
      merge: sort filemap only if requested by the caller · 23116aef
      Manuel Jacob authored
      The name `sorted` refers to a built-in function, which is always true, so the else branch of this if statement was dead code.
      
      Because, with this fix, the function can iterate over the dict items while yielding values, the dict should not change size while the generator is running. Because of that, it is required to re-introduce code that makes a caller copy the filemap before modification, which was removed in 3c783ff08d40 (that changeset also introduced the filemap() method including the bug that’s being fixed by this changeset).
      23116aef
  21. Aug 22, 2024
    • Matt Harbison's avatar
      typing: lock in new pytype gains from making revlog related classes typeable · 0338fb20
      Matt Harbison authored
      These were pretty clean changes in the pyi files from earlier in this series, so
      add them to the code to make it more understandable.
      
      There's one more trivial hint that can be added to the return of
      `mercurial.revlogutils.rewrite._filelog_from_filename()`, however it needs to be
      imported from '..' under the conditional of `typing.TYPE_CHECKING`, and that
      seems to confuse the import checker- possibly because there's already an import
      block from that level.  (I would have expected a message about multiple import
      statements in this case, but got one about higher level imports should come
      first, no matter where I put the import statement.)
      0338fb20
  22. Aug 20, 2024
  23. Aug 21, 2024
    • Matt Harbison's avatar
      remotefilelog: adapt the `debugindex` command to past API changes · c371134f
      Matt Harbison authored
      Pytype was missing these problems because it's currently inferring the classes
      for `filelog` and `revlog` to be `Any`.  When that's fixed, these were flagged,
      so fix these first.
      
      The `filelog` class used to subclass `revlog`, but that was changed back in
      1541e1a8e87d (with most or all of the "lost" attributes being forwarded to the
      embedded `revlog` attribute at that time).  These forwarded references were
      dropped over time, and this command has been broken at least as far back as
      68282a7b29a7 when the `version` field was dropped.  Most of the fixes were as
      simple as calling the accessor for the embedded `revlog` member, but the general
      delta feature detection was a bit more involved- I copied the detection for it
      from `mercurial.revlogutils.debug.debug_revlog()`.
      c371134f
    • Matt Harbison's avatar
      typing: add type hints to the `opener` attributes and arguments of revlog · 71fb6e0a
      Matt Harbison authored
      When making revlog and filelog classes visible to pytype, it got confused quite
      a bit in `mercurial/revlogutils/rewrite.py`, thinking it had a plain `Callable`,
      and flagging additional methods on it like `join()` and `rename()`.  I couldn't
      figure out how it reduced to that (and PyCharm flagged `opener` references as
      `Any`), but this makes it happy.  So make this change before making the classes
      visible.
      
      The vfs class hierarchy is a bit wonky (e.g. `filteredvfs` is not a `vfs`), so
      this may need to be revisited with a Protocol class that covers all of the `vfs`
      classes.  But for now, everything works.
      71fb6e0a
    • Matt Harbison's avatar
      remotefilelog: honor the `--format` arg of the `debugindex` command · 438f4fca
      Matt Harbison authored
      Flagged by PyCharm while investigating pytype spew.  The other `**opts` above
      are already accessed as str.  I've never used remotefilelog, and don't have a
      repo to test this on, so I'm trusting the nearby code.
      438f4fca
Loading