Skip to content
Snippets Groups Projects
  1. Feb 28, 2025
  2. Feb 22, 2025
  3. Jan 14, 2025
  4. Jan 13, 2025
    • Matt Harbison's avatar
      hghave: drop redundant parentheses · 1f76fd3e
      Matt Harbison authored
      Even fewer complaints from PyCharm now.
      1f76fd3e
    • Matt Harbison's avatar
      hghave: make the `ignorestatus` argument to `matchoutput()` a bool · e1c5d823
      Matt Harbison authored
      That's how PyCharm was seeing it because of the default param, so it was
      flagging the callers that passed an int.  Fewer yellow ticks are better (26
      remain).
      e1c5d823
    • Matt Harbison's avatar
      hghave: byteify the `regexp` arg to `matchoutput()` · 6ed726d1
      Matt Harbison authored
      This started failing in CI because a str was passed.  All other callers already
      pass bytes, and it's not clear why this started failing with a MR to use
      `setuptools-scm` to derive the version when building.  Clearly the
      `if checks["hg09"][0]()` prior to these usages were working before, and that's
      how it was overlooked.  But that check apparently continued to work for me
      locally in both Linux and Windows, as I can only hit this issue in CI.
      6ed726d1
  5. Jan 06, 2025
    • Matt Harbison's avatar
      pyupgrade: drop usage of py3 aliases for `OSError` · 24ee91ba
      Matt Harbison authored
      These were different classes in py2, but now a handful of error classes are just
      an alias of `OSError`, like `IOError`, `EnvironmentError`, `WindowsError`, etc.
      
      This is the result of running a hacked version of `pyupgrade` 3.19.1[1]
      
          $ hg files -0 'relglob:**.py' | xargs -0 \
              pyupgrade --py38-plus --keep-percent-format --keep-mock --keep-runtime-typing
      
      The hack is because it doesn't have command line switches to disable most
      changes, so it makes tons of unrelated changes all at once.  The hack is to
      
        1) patch `pyupgrade._main._fix_tokens()` to immediately return its content arg
        2) change `pyupgrade._data.register_decorator()` to only register the function
           if it's from the fixer we're interested in:
      
            if func.__module__ in (
                "pyupgrade._plugins.exceptions",
            ):
                FUNCS[tp].append(func)
      
            return func
      
      [1] https://github.com/asottile/pyupgrade
      24ee91ba
  6. Dec 28, 2024
  7. Dec 18, 2024
    • Matt Harbison's avatar
      pyproject: defer the `hghave` version check of `black` to the project file · 384d71e3
      Matt Harbison authored
      This demonstrates the alternate way of testing for the proper version that was
      mentioned in the last commit.  Needing to manually evaluate from the project
      root when run in the test suite is a bit unfortunate.  Arguably it is limiting
      for 3rd party users, but they were already locked into a specific version before
      too, if using this sentinel.  This lock-in is only for the version check though,
      and then they can `cd /path/to/repo` to run their `test-*.t` with their config.
      On the plus side, we're allowing any minor variant of the required major
      version, we're not assuming the version string format that the tool produces,
      and there's one source of truth for the version.
      
      If running under `RUNTESTDIR` is omitted, then `hghave` will allow any version
      as long as the tool exists on `PATH`, but `test-check-format.t` will fail with
      the message in the previous commit.  I'd argue that's preferrable to suddenly
      quietly skipping the test when the requirement changes, but this was the
      previous behavior too, so that's maintained here.
      384d71e3
  8. Dec 22, 2020
    • Matt Harbison's avatar
      sslutil: add support for clients to set TLSv1.3 as the minimum protocol · 323e3626
      Matt Harbison authored
      AFAICT, all of the TLS versions are supported by the server without doing any
      explicit work, and there's only a `devel` config to specify an exact version on
      the server side.  Clients would also use TLSv1.3 if available, but this prevents
      the server from negotiating down.  This also causes "tls1.3" to be listed in
      `hg debuginstall`, even though it was previously supported (if the Python
      intepreter supported it- IDK if there's a good way to proactively test for and
      show future protocols without requiring manual updates like this).
      
      The v1.3 tests are nested inside the v1.2 tests for simplicity.  The v1.2 blocks
      already assume v1.0 and v1.1 support, so this seems reasonable for now.  If/when
      the older protocols start getting dropped, this will have to be reworked anyway.
      323e3626
  9. Oct 26, 2024
    • Matt Harbison's avatar
      hghave: make the description for "clang-format" ascii · f1312d08
      Matt Harbison authored
      test-fix-clang-format.t suddenly started failing on Windows by wiping the whole
      file content, and replacing with an error:
      
            $TESTTMP.sh: $TESTTMP.sh: cannot execute binary file
      
      Odd, because I don't have `clang-format` installed, so the test should be
      skipped.  The problem started with 73cf8b56c2f5, and I noticed that running
      `hghave` manually resulted in a `SyntaxError` (so I can't see how this isn't
      broken everywhere, but maybe it's because I'm using py3.9 on Windows):
      
          $ py hghave --list
          Traceback (most recent call last):
            File "hghave", line 8, in <module>
              import hghave
            File "c:\Users\Matt\hg\tests\hghave.py", line 627
          SyntaxError: Non-ASCII character '\xe2' in file c:\Users\Matt\hg\tests\hghave.py on line 627, but no encoding declared;
              see http://python.org/dev/peps/pep-0263/ for details
      f1312d08
    • Pierre-Yves David's avatar
      branching: merge stable into default · b2e90465
      Pierre-Yves David authored
      b2e90465
  10. Jun 29, 2023
    • kiilerix's avatar
      tests: use packaging from setuptools instead of deprecated distutils · a26a0519
      kiilerix authored
      When invoking StrictVersion in 3.12 we got:
          DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
      
      distutils is dead in the standard library, and we have to move towards using
      `setuptools` as general extern dependency. Instead of also requiring the extern
      `packaging`, we will just use the packaging that is vendored in setuptools.
      a26a0519
  11. Oct 23, 2024
    • Pierre-Yves David's avatar
      tests: use pyflakes as a tool, not a python module · 43602c67
      Pierre-Yves David authored
      The usage of pyflakes as a Python module was introduced in e397c6d74652, to work
      around issue between Python 2 and Python 3. This issues are long behind us now
      and we can get beck to using pyflakes as a tool, giving us more flexibility
      about how we install it.
      
      The `hghave` requirements is modified to check that we have a tool available,
      instead of a python module.
      43602c67
  12. Oct 22, 2024
  13. Feb 05, 2019
    • Ludovic Chabant's avatar
      extdiff: don't run gui programs when in a cli-only environment · d1b54c15
      Ludovic Chabant authored
      In order to provide a useful error message to override the behavior, we also
      need to slightly change the way that tool.gui is found in the config. Before,
      it had to be where tool.diffargs is located, which might not exist. Now,
      tool.isgui can exist on its own.
      
      A test is added for the new error message. We also need to force
      procutil.isgui() to return true, so we set $DISPLAY to a non-empty value
      before running any test expecting to have a gui.
      d1b54c15
  14. Jun 26, 2023
    • kiilerix's avatar
      tests: use packaging from setuptools instead of deprecated distutils · e679697a
      kiilerix authored
      When invoking StrictVersion in 3.12 we got:
          DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
      
      distutils is dead in the standard library, and we have to move towards using
      `setuptools` as general extern dependency. Instead of also requiring the extern
      `packaging`, we will just use the packaging that is vendored in setuptools.
      e679697a
  15. Jul 29, 2024
  16. Jul 18, 2024
  17. Jul 23, 2024
  18. Jul 18, 2024
  19. Feb 02, 2024
  20. Feb 28, 2023
  21. Jan 25, 2023
  22. Dec 06, 2022
  23. Dec 12, 2022
  24. Dec 11, 2022
  25. Nov 18, 2022
  26. May 29, 2022
  27. Jun 08, 2022
  28. May 21, 2022
  29. Mar 03, 2022
  30. Feb 16, 2022
  31. Feb 14, 2022
Loading