Skip to content
Snippets Groups Projects
  1. Dec 07, 2023
  2. Dec 02, 2023
    • Anton Shestakov's avatar
      procutil: move stdin assignment outside of try-finally block · a9e00554
      Anton Shestakov authored
      There is an stdin variable in the global scope of this module. And in the
      `finally` block of this try-finally statement we're checking `if stdin is not
      None`.  Let's make sure we don't confuse code check tools into thinking we want
      to use global stdin by moving this line of code outside of `try`.
      
      This was caught by pytype 2023.11.21 on Python 3.11.2.
      a9e00554
    • Anton Shestakov's avatar
      zeroconf: give inet_aton() str instead of bytes · b79f13d6
      Anton Shestakov authored
      All other uses of this function in this extension are already fixed (i.e. use
      strings instead of bytes).
      
      This was caught by pytype 2023.11.21 on Python 3.11.2.
      b79f13d6
  3. Dec 06, 2023
    • Pierre-Yves David's avatar
      revlog: avoid wrongly updating the data file location on "divert" · 849745d7
      Pierre-Yves David authored
      If we are in the inline case, we need to align the location of the "data" file
      with the temporary location of the file (i.e. "00changelog.i.a"). However we
      should not do that for non-inline case… and before this changeset we had been
      doing it. In addition `index_file` is already a property taking care of updating
      the "segment file" filename when needed. So we can simply remove all that code.
      
      As a result, code trying to read the diverted data before they were committed
      ended deeply confused as the "00changelog.i.a" file is nothing like the
      "00changelog.d" file.
      
      However nothing corrupted data as all writing where properly handled outside of
      the "segment file".
      
      In "best" cases this small in-memory corruption of the filename when unnoticed
      until the transaction was committed or rolled back and in the worse case, some
      data reading was failing during the transaction and resulted in the transaction
      to be rolled back. However wrong data never reached the disk, so this bug should
      be have corrupted any repository.
      
      This is not catch by tests because most test use a small repository and
      therefor an inline revlog. In addition the bug only triggers when a
      changelog read is done in the following "rare" situation:
      - after some delayed write
      - after that data have been written in a "divert" file (i.e. `00.changelog.i.a`)
      - before transaction commit
      - outside of a "writing" context
      
      The issue was introduced in d83d788590a8
      849745d7
    • Pierre-Yves David's avatar
      revlog: avoid exposing delayed index entry too widely in non-inline revlog · 66417f55
      Pierre-Yves David authored
      Before this change, the index entry would be seen as "appended" to the data
      file. It did not hurt too much as there are never accessed for reading, but this
      was odd. So lets stop doing so.
      66417f55
    • Pierre-Yves David's avatar
      revlog: add one more assert about state of thing when splitting · 962974a5
      Pierre-Yves David authored
      This assert is currently happy, but it does not hurt to adds it to clarify
      expected state and catch potential error in the future.
      962974a5
  4. Dec 02, 2023
  5. Dec 03, 2023
  6. Dec 04, 2023
  7. Dec 02, 2023
    • Matt Harbison's avatar
      tests: fill in the Windows pattern for `$EADDRNOTAVAIL$` matching · e2632d9d
      Matt Harbison authored
      This fixes test-https.t on Windows.
      
      It looks like the real error translation is "Cannot assign requested address.",
      and the message here is the start of a longer description, so I'm not sure why
      this part is emitted.  But it's not worth digging into, as it's evidently the
      same failure.
      e2632d9d
    • Matt Harbison's avatar
      tests: avoid a cascading failure on Windows · 1dd01023
      Matt Harbison authored
      The `identify --debug` command here on Windows emits
      
          skip updating dirstate: identity mismatch
      
      because of the debug switch, which got captured and added to `.hgtags`, and then
      hijinx ensued.  The point of `--debug` seemed to be to get the long hash, so
      just do that with templating.  I have not idea if the message is indicating a
      problem- there seems to be many more of them in other tests that are not present
      on Linux.
      1dd01023
    • Matt Harbison's avatar
      phabricator: stringify the argument to `getattr()` · 4ed9efb2
      Matt Harbison authored
      This fixes a "TypeError: getattr(): attribute name must be string" crash and
      subsequent test spew.  This likely broke in 18c8c18993f0 and was missed in CI
      because `pytest-vcr` is missing.
      4ed9efb2
  8. Nov 13, 2023
  9. Nov 21, 2023
  10. Nov 07, 2023
  11. Nov 06, 2023
  12. Nov 01, 2023
  13. Oct 18, 2023
    • Raphaël Gomès's avatar
      rust-matchers: fix quadratic complexity in `FileMatcher` · 687e192d
      Raphaël Gomès authored
      Concretely, this command:
      
      ```
      $ echo hg up -r <nodeid>; time hg revert dir1 dir2 -r <othernode> --debug
      hg up -r <nodeid>
      
      real	0m14.690s
      user	0m14.766s
      sys	0m5.430s
      ```
      
      was much slower despite using 16 cores before this change.
      The approach taken here is the same one used in match.py, in exactmatcher.
      
      This changeset was originally written by Valentin Gatien-Baron in a private
      repository.
      I have redacted the commit message and did a minor clean up of the code.
      687e192d
  14. Oct 27, 2023
    • Pierre-Yves David's avatar
      revlog: add a small cache of unfiltered chunk · 0250e450
      Pierre-Yves David authored
      This can provides a massive boost to the reading of multiple revision and the
      computation of a valid delta chain.
      
      This greatly help operation like `hg log --patch`, delta computation (helping
      pull/unbundle), linkrev adjustment (helping copy tracing).
      
      A first round of benchmark for `hg log --patch --limit 1000` shows improvement
      in the 10-20% range on "small" repository like pypy or mercurial and large
      improvements (about 33%) for more complex ones like netbeans and mozilla's.
      
      These speeds up are consistent with the improvement to `hg pull` (from a server
      sending poor deltas) I saw benchmarking this last year. Further benchmark will
      be run during the freeze.
      
      I added some configuration in the experimental space to be able to further test
      the effect of various tuning for now. This feature should fit well in the
      "usage/resource profile" configuration that we should land next cycle.
      
      When it does not provides a benefit the overhead of the cache seem to be around
      2%, a small price for the big improvement. In addition I believe we could shave
      most of this overhead with a more efficent lru implementation.
      0250e450
    • Pierre-Yves David's avatar
      revlog: minor refactor in the chunk gather process · c2d2e5b6
      Pierre-Yves David authored
      We will introduce some caching in this method in the next changeset, we make
      some of the most "disruptive" change first as touching this could break (and
      maybe did during the development process).
      c2d2e5b6
Loading