Skip to content
Snippets Groups Projects
  1. Jan 04, 2023
  2. Jan 03, 2023
  3. Dec 06, 2022
    • Matt Harbison's avatar
      packaging: add dependencies to the PyOxidizer build on macOS · 3d7bf111f01e
      Matt Harbison authored
      Otherwise, we get a bunch of test failures for missing things like pygments, or
      tests skipped entirely.  The input file is a copy/paste from the equivalent
      Windows file, but with dulwich, pygit2, and pytest-vcr commented out because
      the build process errors out with them, flagging them as incompatible with
      loading from memory.  I have no idea if that's actually true or not, because
      I've noticed that if I don't `make clean` after every build, the next build
      flags the watchman stuff as incompatible with loading from memory.
      
      The remaining failures are:
      
          Failed test-alias.t: output changed
          Failed test-basic.t: output changed
          Failed test-check-help.t: output changed
          Failed test-commit-interactive.t: output changed
          Failed test-extension.t: output changed
          Failed test-help.t: output changed
          Failed test-i18n.t: output changed
          Failed test-log.t: output changed
          Failed test-qrecord.t: output changed
          Failed test-share-safe.t: output changed
      
      Most of the issues seem related to loading help for disabled extensions from
      `hgext.__index__`, namely the full extension help being unavailable, not being
      able to resolve what commands are provided by what extension, and not having the
      command level help available.
      
      test-log.t, test-commit-interactive.t, and test-i18n.t look like i18n (or lack
      thereof) issues.
      
      test-basic.t is just odd:
          @@ -55,7 +55,7 @@
           On Python 3, stdio may be None:
      
             $ hg debuguiprompt --config ui.interactive=true 0<&-
          -   abort: Bad file descriptor (no-rhg !)
          +   abort: response expected
              abort: response expected (rhg !)
             [255]
             $ hg version -q 0<&-
      3d7bf111f01e
    • Matt Harbison's avatar
    • Matt Harbison's avatar
      tests: conditionalize test output for in-filesystem pyoxidizer resources · 6a3549a01c02
      Matt Harbison authored
      The in-memory pyoxidizer builds apparently behave as expected.
      6a3549a01c02
    • Matt Harbison's avatar
      hghave: add predicates for embedded and filesystem pyoxidizer resources · a2356e15200a
      Matt Harbison authored
      There are a handful of tests with different output between the two flavors of
      pyoxidizer builds (like the location of the modules and templates), and a few
      others that avoid `known-bad-output` cases with the embedded resources that
      shouldn't cause the tests to fail.
      a2356e15200a
  4. Dec 05, 2022
  5. Jan 02, 2023
  6. Dec 22, 2022
  7. Dec 21, 2022
  8. May 02, 2022
  9. Dec 21, 2022
  10. May 02, 2022
  11. Dec 19, 2022
    • Franck Bret's avatar
      debug: add debug-revlog-stats command · b1e4c74beb6f
      Franck Bret authored
      Display statistics about revlogs in the store. Useful to get an approximate
      size of a repository, etc. More statistics will be added in the future.
      b1e4c74beb6f
  12. Dec 17, 2022
    • Matt Harbison's avatar
      typing: attempt to remove @overloads in the platform module for stdlib methods · 3fd5824f1177
      Matt Harbison authored
      This is mostly successful, as examining util.pyi, posix.pyi, and windows.pyi
      after a pytype run shows that the type overloads for `oslink`, `readlink`,
      `removedirs`, `rename`, `split`, and `unlink` have been removed.  (Some of these
      still have an @overload, but the differences are the variable names, not the
      types.)  However, @overloads remain for `abspath` and `normpath` for some
      reason.
      
      It's useful to redefine these methods for the type checking phase because in
      addition to excluding str and PathLike variants, some of these functions have
      optional args in stdlib that aren't implemented in the custom implementation on
      Windows, and we want the type checking to flag that instead of assuming it's an
      allowable overload everywhere.
      
      One last quirk I noticed that I can't explain- `pycompat.TYPE_CHECKING` is
      always False, so the conditionals need to check `typing.TYPE_CHECKING` directly.
      I tried dropping the custom code for assigning `pycompat.TYPE_CHECKING` and
      simply did `from typing import TYPE_CHECKING` directly in pycompat.py, and used
      `pycompat.TYPE_CHECKING` for the conditional here... and pytype complained that
      `pycompat` doesn't have the `TYPE_CHECKING` variable.
      3fd5824f1177
    • Matt Harbison's avatar
      typing: add trivial type hints to rest of the windows platform module · 2b1476714849
      Matt Harbison authored
      Skipping the file wrappers for now because there's interplay with C code, and
      making them subclass `typing.BinaryIO_Proxy` confuses PyCharm a bit.
      2b1476714849
  13. Dec 16, 2022
  14. Dec 15, 2022
    • Matt Harbison's avatar
      typing: add type hints to mercurial/win32.py · a9faacdc5943
      Matt Harbison authored
      These are the low level functions that are imported by the mercurial.windows
      module, which is in turn imported by mercurial.utils as the platform module.
      Pretty straightforward, but pytype inferred very little of it, likely because of
      the heavy ctypes usage.  It also seems to trigger a pytype bug in procutil, now
      that it has an idea of the underlying function type, so disable that warning to
      maintain a working test.
      a9faacdc5943
    • Matt Harbison's avatar
      windows: drop some py2 registry module importing · 7a80a614c9e5
      Matt Harbison authored
      The comment was actually backwards- `winreg` is importable on py3, and is
      already imported by mercurial/windows.py.
      7a80a614c9e5
    • Matt Harbison's avatar
      typing: add type hints to the platform specific scm modules · 7a4143428db7
      Matt Harbison authored
      Surprisingly, pytype struggled to figure out the return types in the posix
      functions.
      7a4143428db7
    • Matt Harbison's avatar
      typing: add type hints to most mercurial/pycompat.py functions · c5a06cc37401
      Matt Harbison authored
      The `rapply` methods are left out because it's not `rapply(f, xs: _T0) -> _T0`
      as I first thought- it's used somewhere to walk a collection and convert between
      bytes and str.
      
      Also, the `open()` call is partially untyped because I'm not sure what its
      purpose is at this point- both the name and mode can be either bytes or str as
      it is currently constituted.  It might make sense to assert that the file is
      being opened in binary mode (like `namedtempfile()`) and cast the result to
      `BinaryIO`, but that shouldn't be smuggled in with these other changes.  The
      return is currently typed as `Any` because something suddenly got smarter and a
      few uses in util.py (like readfile()) suddenly think it returns `IO[str]`
      instead of `IO[bytes]` (BinaryIO), and it flags the type mismatch there.
      c5a06cc37401
    • Matt Harbison's avatar
      statprof: don't pass str `sys.argv` to a function expecting bytes · 9eb69fa5a783
      Matt Harbison authored
      Found by typing the global functions in mercurial.pycompat.
      9eb69fa5a783
Loading