Skip to content
Snippets Groups Projects
  1. Oct 21, 2019
  2. Oct 18, 2019
  3. Oct 06, 2019
    • Sushil Khanchi's avatar
      grep: enable all-files by default (BC) · 8cb5f96db235
      Sushil Khanchi authored
      This patch deprecates the `--all-files` flag and make the all-files
      behaviour as default.
      
      In test-grep.t, I removed '--all-files' from every command where it was
      used, to reflect that all-files behaviour is default and there is no
      change even after the removal.
      And other changes in test files are because of changed behaviour.
      
      Differential Revision: https://phab.mercurial-scm.org/D7000
      
      .. bc::
      
          `hg grep` now searches working copy file contents by default. We
          recognize this is a significant change from past behavior, but
          surveys of large bodies of users indicated nobody used (and almost
          nobody understood) the previous no-flags behavior of `hg
          grep`. The new behavior aligns with the behavior most users
          expected (including hg's maintainers), which also happens to be
          the behavior of `git grep`. Given that the old behavior was
          confusing to the point of being unusable, we were comfortable
          changing this behavior.
      8cb5f96db235
  4. Oct 21, 2019
    • Denis Laxalde's avatar
      lfs: dedent documentation section about .hglfs file · 26caf96a5fa9
      Denis Laxalde authored
      The leading ".hglfs::" is interpreted as a macro in generated man page
      and, as it is unknown, the whole section does not render. Also, having
      the section marked as preformatted (::) makes it render verbatim in
      HTML, which is not desired as the text contains formatting markers. So
      we just dedent the section and remove the ".hglfs::" line. The example
      file is still indented and rendered preformatted.
      26caf96a5fa9
  5. Oct 17, 2019
    • Pierre-Yves David's avatar
      copies: simplify chain loop · f0a2c1972e81
      Pierre-Yves David authored
      This is a mostly gratuitous change to make the code more direct.
      
      Differential Revision: https://phab.mercurial-scm.org/D7131
      f0a2c1972e81
    • Pierre-Yves David's avatar
      sidedatacopies: only fetch information once for merge · 90213d027154
      Pierre-Yves David authored
      Before this change, merge would result in reading the data from revlog twice.
      With this change, we keep the information in memory until we encounter the other
      parent.
      
      When looking at pypy, I see about 1/3 of the changesets with copy information
      being merge. Not doing duplicated fetch for them provide a significant speedup.
      
      revision: large amount; added files: large amount; rename small amount; c3b14617fbd7 9ba6ab77fd29
      before: ! wall 0.767042 comb 0.760000 user 0.750000 sys 0.010000 (median of 11)
      after:  ! wall 0.671162 comb 0.670000 user 0.650000 sys 0.020000 (median of 13)
      revision: large amount; added files: small amount; rename small amount; c3b14617fbd7 f650a9b140d2
      before: ! wall 1.170169 comb 1.170000 user 1.130000 sys 0.040000 (median of 10)
      after:  ! wall 1.030596 comb 1.040000 user 1.010000 sys 0.030000 (median of 10)
      revision: large amount; added files: large amount; rename large amount; 08ea3258278e d9fa043f30c0
      before: ! wall 0.209846 comb 0.200000 user 0.200000 sys 0.000000 (median of 46)
      after:  ! wall 0.170981 comb 0.170000 user 0.170000 sys 0.000000 (median of 56)
      revision: small amount; added files: large amount; rename large amount; df6f7a526b60 a83dc6a2d56f
      before: ! wall 0.013248 comb 0.010000 user 0.010000 sys 0.000000 (median of 223)
      after:  ! wall 0.013295 comb 0.020000 user 0.020000 sys 0.000000 (median of 222)
      revision: small amount; added files: large amount; rename small amount; 4aa4e1f8e19a 169138063d63
      before: ! wall 0.001672 comb 0.000000 user 0.000000 sys 0.000000 (median of 1000)
      after:  ! wall 0.001666 comb 0.000000 user 0.000000 sys 0.000000 (median of 1000)
      revision: small amount; added files: small amount; rename small amount; 4bc173b045a6 964879152e2e
      before: ! wall 0.000119 comb 0.000000 user 0.000000 sys 0.000000 (median of 8010)
      after:  ! wall 0.000119 comb 0.000000 user 0.000000 sys 0.000000 (median of 8007)
      revision: medium amount; added files: large amount; rename medium amount; c95f1ced15f2 2c68e87c3efe
      before: ! wall 0.168599 comb 0.160000 user 0.160000 sys 0.000000 (median of 58)
      after:  ! wall 0.133316 comb 0.140000 user 0.140000 sys 0.000000 (median of 73)
      revision: medium amount; added files: medium amount; rename small amount; d343da0c55a8 d7746d32bf9d
      before: ! wall 0.036052 comb 0.030000 user 0.030000 sys 0.000000 (median of 100)
      after:  ! wall 0.032558 comb 0.030000 user 0.030000 sys 0.000000 (median of 100)
      
      Differential Revision: https://phab.mercurial-scm.org/D7127
      90213d027154
  6. Oct 15, 2019
    • Pierre-Yves David's avatar
      copies: move from a copy on branchpoint to a copy on write approach · ffd04bc9f57d
      Pierre-Yves David authored
      Before this changes, any branch points results in a copy of the dictionary containing the
      copy information. This can be very costly for branchy history with few rename
      information. Instead, we take a "copy on write" approach. Copying the input data
      only when we are about to update them.
      
      In practice we where already doing the copying in half of these case (because
      `_chain` makes a copy), so we don't add a significant cost here even in the
      linear case. However the speed up in branchy case is very significant. Here are
      some timing on the pypy repository.
      
      revision: large amount; added files: large amount; rename small amount; c3b14617fbd7 9ba6ab77fd29
      before: ! wall 1.399863 comb 1.400000 user 1.370000 sys 0.030000 (median of 10)
      after:  ! wall 0.766453 comb 0.770000 user 0.750000 sys 0.020000 (median of 11)
      revision: large amount; added files: small amount; rename small amount; c3b14617fbd7 f650a9b140d2
      before: ! wall 1.876748 comb 1.890000 user 1.870000 sys 0.020000 (median of 10)
      after:  ! wall 1.167223 comb 1.170000 user 1.150000 sys 0.020000 (median of 10)
      revision: large amount; added files: large amount; rename large amount; 08ea3258278e d9fa043f30c0
      before: ! wall 0.242457 comb 0.240000 user 0.240000 sys 0.000000 (median of 39)
      after:  ! wall 0.211476 comb 0.210000 user 0.210000 sys 0.000000 (median of 45)
      revision: small amount; added files: large amount; rename large amount; df6f7a526b60 a83dc6a2d56f
      before: ! wall 0.013193 comb 0.020000 user 0.020000 sys 0.000000 (median of 224)
      after:  ! wall 0.013290 comb 0.010000 user 0.010000 sys 0.000000 (median of 222)
      revision: small amount; added files: large amount; rename small amount; 4aa4e1f8e19a 169138063d63
      before: ! wall 0.001673 comb 0.000000 user 0.000000 sys 0.000000 (median of 1000)
      after:  ! wall 0.001677 comb 0.000000 user 0.000000 sys 0.000000 (median of 1000)
      revision: small amount; added files: small amount; rename small amount; 4bc173b045a6 964879152e2e
      before: ! wall 0.000119 comb 0.000000 user 0.000000 sys 0.000000 (median of 8023)
      after:  ! wall 0.000119 comb 0.000000 user 0.000000 sys 0.000000 (median of 7997)
      revision: medium amount; added files: large amount; rename medium amount; c95f1ced15f2 2c68e87c3efe
      before: ! wall 0.201898 comb 0.210000 user 0.200000 sys 0.010000 (median of 48)
      after:  ! wall 0.167415 comb 0.170000 user 0.160000 sys 0.010000 (median of 58)
      revision: medium amount; added files: medium amount; rename small amount; d343da0c55a8 d7746d32bf9d
      before: ! wall 0.036820 comb 0.040000 user 0.040000 sys 0.000000 (median of 100)
      after:  ! wall 0.035797 comb 0.040000 user 0.040000 sys 0.000000 (median of 100)
      
      The extra cost in the linear case can be reclaimed later with some extra logic.
      
      Differential Revision: https://phab.mercurial-scm.org/D7124
      ffd04bc9f57d
  7. Oct 12, 2019
    • Pierre-Yves David's avatar
      copies: compute the exact set of revision to walk · 83bb1e89ab9b
      Pierre-Yves David authored
      This change make the code clearer by removing the revision queue. It comes
      without very noticeable performance impact. However the simpler code will be
      easier to update in later changesets.
      
      revision: large amount; added files: large amount; rename small amount; c3b14617fbd7 9ba6ab77fd29
      before: ! wall 1.430082 comb 1.430000 user 1.390000 sys 0.040000 (median of 10)
      after:  ! wall 1.405192 comb 1.410000 user 1.390000 sys 0.020000 (median of 10)
      revision: large amount; added files: small amount; rename small amount; c3b14617fbd7 f650a9b140d2
      before: ! wall 1.971366 comb 1.970000 user 1.950000 sys 0.020000 (median of 10)
      after:  ! wall 1.892541 comb 1.890000 user 1.870000 sys 0.020000 (median of 10)
      revision: large amount; added files: large amount; rename large amount; 08ea3258278e d9fa043f30c0
      before: ! wall 0.252594 comb 0.250000 user 0.240000 sys 0.010000 (median of 38)
      after:  ! wall 0.240075 comb 0.240000 user 0.240000 sys 0.000000 (median of 40)
      revision: small amount; added files: large amount; rename large amount; df6f7a526b60 a83dc6a2d56f
      before: ! wall 0.013100 comb 0.010000 user 0.010000 sys 0.000000 (median of 226)
      after:  ! wall 0.013247 comb 0.010000 user 0.010000 sys 0.000000 (median of 223)
      revision: small amount; added files: large amount; rename small amount; 4aa4e1f8e19a 169138063d63
      before: ! wall 0.001633 comb 0.000000 user 0.000000 sys 0.000000 (median of 1000)
      after:  ! wall 0.001670 comb 0.000000 user 0.000000 sys 0.000000 (median of 1000)
      revision: small amount; added files: small amount; rename small amount; 4bc173b045a6 964879152e2e
      before: ! wall 0.000078 comb 0.000000 user 0.000000 sys 0.000000 (median of 11984)
      after:  ! wall 0.000119 comb 0.000000 user 0.000000 sys 0.000000 (median of 7982)
      revision: medium amount; added files: large amount; rename medium amount; c95f1ced15f2 2c68e87c3efe
      before: ! wall 0.207093 comb 0.210000 user 0.210000 sys 0.000000 (median of 47)
      after:  ! wall 0.201551 comb 0.200000 user 0.200000 sys 0.000000 (median of 48)
      revision: medium amount; added files: medium amount; rename small amount; d343da0c55a8 d7746d32bf9d
      before: ! wall 0.038462 comb 0.040000 user 0.040000 sys 0.000000 (median of 100)
      after:  ! wall 0.036578 comb 0.030000 user 0.030000 sys 0.000000 (median of 100)
      
      Differential Revision: https://phab.mercurial-scm.org/D7076
      83bb1e89ab9b
    • Pierre-Yves David's avatar
      copies: add an explicit test using multiple roots · dda9482f60d2
      Pierre-Yves David authored
      We explicitly add a test checking for copies of connected revision but involving
      a different roots. This make sure the copies coming purely from the new roots
      does not interfere with the merge.
      
      Differential Revision: https://phab.mercurial-scm.org/D7075
      dda9482f60d2
  8. Oct 02, 2019
    • Pierre-Yves David's avatar
      sidedatacopies: fast path data fetching if revision has no sidedata · 8a2925265402
      Pierre-Yves David authored
      When using the side data mode, we know their won't be any copy information
      sidedata. Skipping revision restoration give an important speed boost.
      
      In the future, there will be other user of sidedata, reducing the efficiency of
      this. We should consider adding a dedicated flag in revlog V2 to preserve this
      optimisation. The current situation is good enough for now.
      
      revision: large amount; added files: large amount; rename small amount; c3b14617fbd7 9ba6ab77fd29
      before:  ! wall 2.401569 comb 2.400000 user 2.390000 sys 0.010000 (median of 10)
      after:   ! wall 1.429294 comb 1.430000 user 1.410000 sys 0.020000 (median of 10)
      revision: large amount; added files: small amount; rename small amount; c3b14617fbd7 f650a9b140d2
      before:  ! wall 3.519140 comb 3.520000 user 3.470000 sys 0.050000 (median of 10)
      after:   ! wall 1.963332 comb 1.960000 user 1.960000 sys 0.000000 (median of 10)
      revision: large amount; added files: large amount; rename large amount; 08ea3258278e d9fa043f30c0
      before:  ! wall 0.593880 comb 0.600000 user 0.590000 sys 0.010000 (median of 15)
      after:   ! wall 0.251679 comb 0.250000 user 0.250000 sys 0.000000 (median of 38)
      revision: small amount; added files: large amount; rename large amount; df6f7a526b60 a83dc6a2d56f
      before:  ! wall 0.013414 comb 0.020000 user 0.020000 sys 0.000000 (median of 220)
      after:   ! wall 0.013222 comb 0.020000 user 0.020000 sys 0.000000 (median of 223)
      revision: small amount; added files: large amount; rename small amount; 4aa4e1f8e19a 169138063d63
      before:  ! wall 0.002711 comb 0.000000 user 0.000000 sys 0.000000 (median of 1000)
      after:   ! wall 0.001631 comb 0.000000 user 0.000000 sys 0.000000 (median of 1000)
      revision: small amount; added files: small amount; rename small amount; 4bc173b045a6 964879152e2e
      before:  ! wall 0.000077 comb 0.000000 user 0.000000 sys 0.000000 (median of 12208)
      after:   ! wall 0.000078 comb 0.000000 user 0.000000 sys 0.000000 (median of 12012)
      revision: medium amount; added files: large amount; rename medium amount; c95f1ced15f2 2c68e87c3efe
      before:  ! wall 0.410067 comb 0.410000 user 0.410000 sys 0.000000 (median of 23)
      after:   ! wall 0.207786 comb 0.200000 user 0.200000 sys 0.000000 (median of 46)
      revision: medium amount; added files: medium amount; rename small amount; d343da0c55a8 d7746d32bf9d
      before:  ! wall 0.097004 comb 0.090000 user 0.090000 sys 0.000000 (median of 100)
      after:   ! wall 0.038495 comb 0.030000 user 0.030000 sys 0.000000 (median of 100)
      
      Differential Revision: https://phab.mercurial-scm.org/D7074
      8a2925265402
  9. Oct 18, 2019
  10. Oct 14, 2019
    • Yuya Nishihara's avatar
      rust-cpython: prepare for writing tests that require libpython · 8d432d3a2d7c
      Yuya Nishihara authored
      What I wanted is to disable the "cpython/extension-module<ver>" feature
      while building tests executable, but that seems not doable. Instead,
      this patch adds new features dedicated for tests.
      
      The make rule is extracted so that we can easily run cargo tests.
      
      Added a minimal test of ref-sharing as an example. More tests will follow.
      8d432d3a2d7c
  11. Oct 05, 2019
  12. Sep 21, 2019
  13. Sep 15, 2019
    • Yuya Nishihara's avatar
      rust-cpython: make PyLeakedRef operations relatively safe · ffc1fbd7d1f5
      Yuya Nishihara authored
      This patch encapsulates the access to the leaked reference to make most
      leaked-ref operations safe. The only exception is leaked_ref.map(). I
      couldn't figure out how to allow arbitrary map operation safely over an
      unsafe static reference. See the docstring and inline comment for details.
      
      Now leak_immutable() can be safely implemented as the PyLeakedRef owns
      its inner data.
      ffc1fbd7d1f5
    • Yuya Nishihara's avatar
      rust-cpython: put leaked reference in PyLeakedRef · ce6dd1cee4c8
      Yuya Nishihara authored
      The next patch will make PyLeakedRef manage the lifetime of the underlying
      object. leak_handle.data.take() will be removed soon.
      ce6dd1cee4c8
  14. Oct 18, 2019
    • Gregory Szorc's avatar
      run-tests: make code coverage work on Python 3 · 96eb9ef777a8
      Gregory Szorc authored
      This code path was obviously not tested on Python 3 because it
      blew up in several places due to str/bytes mismatch.
      
      For internal code, we normalize paths to bytes.
      
      For code calling into `coverage`, we normalize paths to str,
      which is what `coverage` seems to expect.
      
      After this, `run-tests.py -H` works on Python 3!
      
      Differential Revision: https://phab.mercurial-scm.org/D7133
      96eb9ef777a8
  15. Oct 17, 2019
  16. Oct 16, 2019
  17. Oct 17, 2019
  18. Oct 11, 2019
  19. Oct 16, 2019
  20. Oct 08, 2019
  21. Oct 15, 2019
  22. Oct 11, 2019
    • Raphaël Gomès's avatar
      rust-dirstate-status: add first Rust implementation of `dirstate.status` · 99394e6c5d12
      Raphaël Gomès authored
      Note: This patch also added the rayon crate as a Cargo dependency. It will
      help us immensely in making Rust code parallel and easy to maintain. It is
      a stable, well-known, and supported crate maintained by people on the Rust
      team.
      
      The current `dirstate.status` method has grown over the years through bug
      reports and new features to the point where it got too big and too complex.
      
      This series does not yet improve the logic, but adds a Rust fast-path to speed
      up certain cases.
      
      Tested on mozilla-try-2019-02-18 with zstd compression:
          - `hg diff` on an empty working copy:
              - c: 1.64(+-)0.04s
              - rust+c before this change: 2.84(+-)0.1s
              - rust+c: 849(+-)40ms
          - `hg commit` when creating a file:
              - c: 5.960s
              - rust+c before this change: 5.828s
              - rust+c: 4.668s
          - `hg commit` when updating a file:
              - c: 4.866s
              - rust+c before this change: 4.371s
              - rust+c: 3.855s
          - `hg status -mard`
              - c: 1.82(+-)0.04s
              - rust+c before this change: 2.64(+-)0.1s
              - rust+c: 896(+-)30ms
      
      The numbers are clear: the current Rust `dirstatemap` implementation is super
      slow, its performance needs to be addressed.
      This will be done in a future series, immediately after this one, with the goal
      of getting Rust to be at least to the speed of the Python + C implementation
      in all cases before the 5.2 freeze. At worse, we gate dirstatemap to only be used
      in those cases.
      
      Cases where the fast-path is not executed:
          - for commands that need ignore support (`status`, for example)
          - if subrepos are found (should not be hard to add, but winter is coming)
          - any other matcher than an `alwaysmatcher`, like patterns, etc.
          - with extensions like `sparse` and `fsmonitor`
      
      The next step after this is to rethink the logic to be closer to
      Jane Street's Valentin Gatien-Baron's Rust fast-path which does a lot less
      work when possible.
      
      Differential Revision: https://phab.mercurial-scm.org/D7058
      99394e6c5d12
  23. Oct 06, 2019
  24. Sep 30, 2019
    • Georges Racinet's avatar
      rust-cpython: removed now useless py_set() conversion · 33fe96a5c522
      Georges Racinet authored
      In rust-cpython 0.3.0, HashSets implement the appropriate
      ToPythonObject, we can therefore get rid of this hacky conversion.
      
      There still remains an inefficiency in `MissingAncestors.bases()`:
      we have to clone, because `to_py_object()` requires full ownership.
      However:
      
      - the only use case outside of unit tests used to be from
      `setdiscovery.partialdiscovery` which is now fully implemented
      in Rust.
      - it's not worse than what `py_set()` used to do
      
      Differential Revision: https://phab.mercurial-scm.org/D7120
      33fe96a5c522
  25. Oct 16, 2019
Loading