Skip to content
Snippets Groups Projects
  1. Jan 03, 2025
    • Matt Harbison's avatar
      windows: stop enabling legacy stdio by default in the `hg` executable · 6ec2e133d86f
      Matt Harbison authored
      We need to stop doing this in order to exercize the new code in the previous
      commit.  The environment variable can still be manually set to revert to the
      previous state of things that has been used since py3 support was added, for
      now.  We should try to get away from it entirely though, because this problem
      affects more than what is written up in issue6952.[1]
      
      I've tested locally with the `hg.exe` form of this, and the tests pass.  That
      gives me some hope, but 1) the pager wouldn't typically be used in tests due to
      the runner capturing the output, unless a pager is explicitly requested (like a
      few tests do), and 2) the tests are basically all ascii characters anyway, so
      that's kind of hard to screw up.  (The test runner sets `HGENCODING=ascii`, I
      assume for portability, so that's unlikely to change.  I've also managed to
      generate corrupt file names when trying to write a test for an issue with
      non-ascii file names[2], using code that works perfectly fine outside the test
      runner.  But we do seem to be getting the output that was previously missing,
      and the project CI system will cover `hg.bat` when it tests the wheels.)
      
      [1] mercurial/tortoisehg/thg#5854
      [2] mercurial/tortoisehg/thg#5923
      6ec2e133d86f
    • Pierre Augier's avatar
      windows: effect of PYTHONLEGACYWINDOWSSTDIO when not defined · f9b8ac279227
      Pierre Augier authored
      Fix issue6952.
      f9b8ac279227
  2. Dec 17, 2024
  3. Dec 16, 2024
    • Matt Harbison's avatar
      30f2e8de0a82
    • Matt Harbison's avatar
      pure: add an "abstractmethod" and some type hints to parsers.py to help pytype · 8de9bab826bc
      Matt Harbison authored
      It looks like `BaseIndexObject` is meant to be a base class with common
      implementation across the subclasses.  Both subclasses provide the class attrs
      typed here, as well as `_calculate_index()` that are accessed by the base class.
      The trick is, `revlog.RustIndexProxy` also uses it as a base class, and forwards
      some methods such that it doesn't want or need this method.  This is kind of a
      workaround to keep everything happy.
      
      Likewise, it doesn't need the 3 class variables, because it overrides the
      methods in this class that use them.  But there's no way to conditionally
      declare these.  Their presence seems conditional on the version of Python- see
      199b0e62b403.  (Also, it looks like the rust class doesn't override `append()`,
      which would need `_extra`.  Not sure if this is an oversight, or if it's more of
      a "protected" field instead of private.)
      
      `PersistentNodeMapIndexObject` says it's for debugging, so I'm not going to
      bother trying to figure out what the 3 required class attr types are right now,
      and risk introducing a cycle that confuses pytype.
      8de9bab826bc
  4. Dec 17, 2024
  5. Dec 30, 2024
  6. Dec 13, 2024
    • Arseniy Alekseyev's avatar
      rust-hgignore: add a scripting command to print the hgignore regexp · b89c934e6269
      Arseniy Alekseyev authored
      Add a command `script::hgignore --print-re` to print the
      hgignore regexp.
      
      One complication is that the `rootfilesin`-only matcher doesn't use a
      regular expression, and the existing converts it to something that's
      not a regular expression.
      
      We add code to handle that case.
      
      Since this command is now sufficient to generate a tidy-looking
      regexp for scripting, this frees up the "debug" command to report
      the internal regexp used by the regex engine, so we make that
      change too.
      b89c934e6269
  7. Dec 06, 2024
    • Arseniy Alekseyev's avatar
      rust-ignore: construct regex Hir object directly, avoiding large regex string · 1866119cbad7
      Arseniy Alekseyev authored
      Rework how we convert patterns to regexes in rust.
      Instead of going patterns -> string -> Regex, which is slow and causes
      some correctness issues, build a structured regex_syntax::hir::Hir value,
      which is faster and it also prevents surprising regex escape.
      
      This change makes the time of `build_regex_match` go from ~70-80ms
      to ~40ms in my testing (for a large hgignore).
      
      The bug I mentioned involves regex patterns that "escape" their
      intended scope. For example, a sequence of hgignore regexp patterns like
      this would previously lead to surprising behavior:
      
          foo(?:
          bar
          baz
          )
      
      this matches foobar and foobaz, and doesn't match bar and baz.
      
      The new behavior is to report a pattern parse error
      The Python hg also has this bug, so this bugfix
      not really helping much, but it's probably better to
      fall back to real Python bugs than to simulate them.
      1866119cbad7
  8. Dec 22, 2024
    • Felipe Resende's avatar
      subrepo: fix calling outgoing with multiple paths · 85c095c1f8bc
      Felipe Resende authored
      When recursing into a subrepository all the paths were being passed on to them.
      However, each subrepository is mapped to only one destination (subrepository
      state uses the destination to derive the final path). The for loop is
      responsible for recursing into the subrepository for each destination so we
      only need to pass the current destination.
      
      If we have the following repository structure parent/sub/sub_sub, and call
      outgoing to parent_p1 and parent_p2, the outgoing method will be called with
      the following arguments:
      
      dests = (parent_p1, parent_p2), subpath = None
      dests = (parent_p1 path.loc, ), subpath = sub
      dests = (parent_p1 path.loc, ), subpath = sub/sub_sub
      dests = (parent_p2 path.loc, ), subpath = sub
      dests = (parent_p2 path.loc, ), subpath = sub/sub_sub
      
      Then, the subrepositories absolute path will be formed concatenating both
      arguments. If subpath is absolute, dests is ignored.
      85c095c1f8bc
  9. Dec 29, 2024
  10. Dec 04, 2024
  11. Nov 28, 2024
  12. Dec 13, 2024
  13. Dec 14, 2024
  14. Dec 12, 2024
Loading