Skip to content
Snippets Groups Projects
  1. Mar 23, 2020
    • Raphaël Gomès's avatar
      rust: update all dependencies · d31d1c0685be
      Raphaël Gomès authored
      We do this periodically to say up to date.
      
      No major versions were crossed this time per se, but the `rand` is still in v0,
      and their 0.7x series broke three things:
          - Some distribution-related elements were moved to a separate crate,
            flashing a deprecation warning
          - The `LogNormal::new` associated function now returns a `Result`
          - Certain RNGs were updated to sample a `u32` instead of `usize` when their
            upper-bound is less than `u32::MAX` for better portability, which changed
            the output for 2 tests.
      
      Moreover, the recent use of the `regex` crate for ignore mechanisms prompted
      some benchmarking that revealed that `regex` was slower at compiling big regex
      than `Re2`. The author of `regex` was very quick to discover an optimization
      that yielded a 30% improvement. It's still slower than `Re2` in that regard, but
      less so in the 1.3.6 release.
      
      Differential Revision: https://phab.mercurial-scm.org/D8320
      d31d1c0685be
    • Raphaël Gomès's avatar
      rust: update micro-timer dependency · f451a347d21a
      Raphaël Gomès authored
      The new version uses a much more robust technique and should remove any existing
      risk of bad compiler error or performance hit.
      
      Differential Revision: https://phab.mercurial-scm.org/D8319
      f451a347d21a
  2. Mar 20, 2020
  3. Mar 25, 2020
    • Yuya Nishihara's avatar
      templater: fix cbor() filter to recursively convert smartset to list · 7333e8bb9781
      Yuya Nishihara authored
      The previous attempt, e3e44e6e7245 "templater: fix cbor() filter to accept
      smartset", was incomplete since obj may be a collection containing a smartset.
      
      This works around the problem by converting smartsets recursively. Another
      option is to teach cborutil how to encode a smartset. That should be okay,
      but I hesitated to add "import smartset" to cborutil.py as the cborutil is
      pretty generic.
      7333e8bb9781
  4. Mar 23, 2020
  5. Mar 24, 2020
    • Raphaël Gomès's avatar
      rust-matchers: use the `regex` crate · 496868f1030c
      Raphaël Gomès authored
      Instead of falling back to Python when a code path with "ignore" functionality
      is reached and `Re2` is not installed, the default compilation (i.e. without
      the `with-re2` feature) will use the `regex` crate for all regular expressions
      business.
      
      As with the introduction of `Re2` in a previous series, this yields a big
      performance boost compared to the Python + C code in `status`, `diff`, `commit`,
      `update`, and maybe others.
      
      For now `Re2` looks to be faster at compiling the DFA (1.5ms vs 5ms for
      Netbeans' `.hgignore`) and a bit faster in actual use: (123ms vs 137ms for
      the parallel traversal of Netbeans' clean repo). I am in talks with the author
      of `regex` to see whether that performance difference is a bug, a "won't fix",
      or a tuning issue.
      
      The `regex` crate is already one of our dependencies and using this code does
      not require any additional work from the end-user than to use the Rust
      extensions.
      
      Differential Revision: https://phab.mercurial-scm.org/D8323
      496868f1030c
  6. Mar 15, 2020
    • Yuya Nishihara's avatar
      templater: add subsetparents(rev, revset) function · 7cd5c0968139
      Yuya Nishihara authored
      Naming suggestions are welcome. And this could be flagged as an (ADVANCED)
      function since the primary use case is to draw a graph.
      
      This provides all data needed for drawing revisions graph filtered by revset,
      and allows us to implement a GUI graph viewer in some languages better than
      Python. A frontend grapher will be quite similar to our graphmod since
      subsetparents() just returns parent-child relations in the filtered sub graph.
      
      Frontend example:
      
        https://hg.sr.ht/~yuja/hgv/browse/default/core/hgchangesetgrapher.cpp
      
      However, the resulting graph will be simpler than the one "hg log -G" would
      generate because redundant edges are eliminated. This should be the same graph
      rendering strategy as TortoiseHg.
      
      This function could be implemented as a revset predicate, but that would mean
      the scanning state couldn't be cached and thus slow.
      
      Test cases are split to new file since test-template-functions.t is quite
      big and we'll need a new branchy repository anyway.
      7cd5c0968139
    • Yuya Nishihara's avatar
      templater: remember cache key of evaluated revset · 1f81f680912f
      Yuya Nishihara authored
      This provides a hint for caching further computation result of the given
      revset. See the next patch for example.
      1f81f680912f
    • Yuya Nishihara's avatar
      templater: fix cbor() filter to accept smartset · e3e44e6e7245
      Yuya Nishihara authored
      So the wrapper type can return a bare smartset.
      e3e44e6e7245
    • Yuya Nishihara's avatar
      templater: introduce wrapper for smartset (API) · fc1fa3a07af6
      Yuya Nishihara authored
      I want to add a template function which takes a revset as an argument:
      
        {somefunc(..., revset(...))}
                       ^^^^^^^^^^^
                       evaluates to a revslist
      
      This wrapper will provide a method to get an underlying smartset. It should
      also be good for performance since count(revset(...)) will no longer have to
      fully consume the smartset for example, but that isn't the point of this
      change.
      fc1fa3a07af6
  7. Mar 21, 2020
  8. Mar 24, 2020
  9. Mar 22, 2020
  10. Mar 21, 2020
  11. Mar 19, 2020
    • Micha Wiedenmann's avatar
      ui: use "procutil.shellsplit" to parse command · b746a22349f9
      Micha Wiedenmann authored
      A commandline containing a space ('"C:\\Program Files\\bar.exe" "..."')
      must not simply split at whitespace, instead quoting has to be taken into
      account. Use "shlex.split()" to parse it instead.
      
      This can improve the error message if we fail to launch a user
      configured
      editor which does not exist. Consider
      
           [ui]
           editor = "C:\Program Files\editor\editor.exe"
      
      where the path does not exist. "hg histedit" currently aborts with
      
      > Abort: edit failed: Program exited with status 1
      
      here "Program" is not part of the message but the name of the program
      that failed (i.e. `basename("C:\\Program ")`). With this change the message
      instead reads
      
      > Abort: edit failed: C:\Program Files\editor\editor.exe exited with
      > status 1
      
      which is also not ideal since infact "cmd.exe" exited with code 1, not
      the editor. But the real error message ("File not found") gets swallowed by
      `procutil` and including the correct path improves the error message
      nevertheless.
      b746a22349f9
  12. Mar 20, 2020
  13. Mar 05, 2020
  14. Mar 20, 2020
  15. Mar 19, 2020
  16. Mar 18, 2020
  17. Mar 13, 2020
    • Martin von Zweigbergk's avatar
      fix: mark -r as advanced · a6ef1e8e2f6d
      Martin von Zweigbergk authored
      See the previous patch for reasoning. I planned to even mark it
      deprecated, but someone (timeless?) on the #mercurial IRC channel said
      they sometimes wanted to use `-r` with its existing semantics.
      
      Differential Revision: https://phab.mercurial-scm.org/D8288
      a6ef1e8e2f6d
    • Martin von Zweigbergk's avatar
      fix: add a -s option to format a revision and its descendants · 5205b46bd887
      Martin von Zweigbergk authored
      `hg fix -r abc123` will format that commit but not its
      descendants. That seems expected given the option name (`-r`), but
      it's very rarely what the user wants to do. The problem is that any
      descendants of that commit will not be formatted, leaving them as
      orphans that are hard to evolve. They are hard to evolve because the
      new parent will have formatting changes that the orphan doesn't have.
      
      I talked to Danny Hooper (who wrote most of the fix extension) about
      the problem and we agreed that deprecating `-r` in favor of a new `-s`
      argument (mimicing rebase's `-s`) would be a good way of reducing the
      risk that users end up with these hard-to-evolve orphans. So that's
      what this patch implements.
      
      Differential Revision: https://phab.mercurial-scm.org/D8287
      5205b46bd887
  18. Dec 13, 2019
  19. Mar 18, 2020
  20. Mar 17, 2020
  21. Mar 18, 2020
  22. Mar 12, 2020
  23. Mar 06, 2020
  24. Mar 17, 2020
  25. Jul 22, 2019
  26. Mar 13, 2020
  27. Mar 14, 2020
  28. Mar 13, 2020
Loading