Skip to content
Snippets Groups Projects
  1. Feb 15, 2024
    • Arseniy Alekseyev's avatar
      tests: tweak chg test to make it fail less often · db5d7aee641e
      Arseniy Alekseyev authored
      the test apparently sometimes prints the word "start" as a part of profile,
      so let's no longer match "start":
      
         CHGHG=/*/install/bin/hg (glob)
      +  \x1b[90m   | 50.0%  0.01s  profiling.py:   __enter__       line 196:  self.start()\x1b[0m (esc)
      +  \x1b[90m   | 50.0%  0.01s  profiling.py:   start           line 261:  self._profiler.__enter__()\x1b[0m (esc)
      +  \x1b[90m   | 50.0%  0.01s  profiling.py:   statprofile     line 125:  statprof.start(mechanism=b'...\x1b[0m (esc)
      +  \x1b[90m   | 50.0%  0.01s  statprof.py:    start           line 356:  state.thread.start()\x1b[0m (esc)
      +  \x1b[90m   | 50.0%  0.01s  threading.py:   start           line 852:  self._started.wait()\x1b[0m (esc)
      db5d7aee641e
    • Arseniy Alekseyev's avatar
      cext: fix potential memory leaks of list items appended with PyList_Append · cb5175edd225
      Arseniy Alekseyev authored
      Also reduce the duplication in the tricky code that uses PyList_Append by
      extracting it into a function `pylist_append_owned`.
      cb5175edd225
  2. Feb 12, 2024
  3. Jan 08, 2024
  4. Feb 02, 2024
  5. Jan 30, 2024
  6. Jan 24, 2024
    • Anton Shestakov's avatar
      tests: use sha256line.py instead of /dev/random in test-censor.t (issue6858) · e7be2ddfb4c2
      Anton Shestakov authored
      Sometimes the systems that run our test suite don't have enough entropy and
      they cannot produce target file of the expected size using /dev/random, which
      results in test failures. Switching to /dev/urandom would give us way more
      available data at the cost of it being less "random", but we don't really need
      to use entropy for this task at all, since we only care if the file size after
      compression is big enough to not be stored inline in the revlog. So let's use
      something that we already have used to generate this kind of data in other
      tests.
      e7be2ddfb4c2
    • Anton Shestakov's avatar
      tests: make sha256line.py available for all tests · fa4c4fa232d6
      Anton Shestakov authored
      This was previously only used in test-revlog-delta-find.t, but it will be
      useful (and used) in other tests that might need to generate
      poorly-compressible files.
      fa4c4fa232d6
  7. Jan 14, 2024
    • Anton Shestakov's avatar
      tests: don't use "status" operand of dd in test-censor.t (issue6858) · c7edfccfc11f
      Anton Shestakov authored
      Some implementations don't have this operand, let's just direct stderr into
      /dev/null, that's pretty cross-platform.
      
      Also specify bs=512 (the default for me), because the default might be
      different on different systems. Other uses of dd in the tests do specify it, so
      this is more consistent.
      c7edfccfc11f
  8. Jan 11, 2024
  9. Jan 03, 2024
    • Georges Racinet's avatar
      pycompat: fix bytestr(bytes) in Python 3.11 · f0e7d51bb454
      Georges Racinet authored
      In Python 3.10, the `bytes` type itself does not have a `__bytes__`
      attribute, but it does in 3.11. Yet `bytes(bytes)` does not give
      the wished output, so we have to add an exceptional case.
      
      The added case in the doctest reproduces the problem with Python 3.11.
      
      Impact: error treatment in expressions such as `repo[b'invalid']` gets
      broken.
      f0e7d51bb454
  10. Jan 04, 2024
  11. Dec 27, 2023
  12. Nov 17, 2023
  13. Dec 21, 2023
  14. Dec 07, 2023
  15. Dec 12, 2023
  16. Dec 07, 2023
  17. Dec 02, 2023
    • Anton Shestakov's avatar
      procutil: move stdin assignment outside of try-finally block · a9e00554b3e4
      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.
      a9e00554b3e4
    • Anton Shestakov's avatar
      zeroconf: give inet_aton() str instead of bytes · b79f13d6ef25
      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.
      b79f13d6ef25
  18. Dec 06, 2023
    • Pierre-Yves David's avatar
      revlog: avoid wrongly updating the data file location on "divert" · 849745d7da89
      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
      849745d7da89
    • Pierre-Yves David's avatar
      revlog: avoid exposing delayed index entry too widely in non-inline revlog · 66417f55ea33
      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.
      66417f55ea33
    • Pierre-Yves David's avatar
      revlog: add one more assert about state of thing when splitting · 962974a5d068
      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.
      962974a5d068
  19. Dec 02, 2023
  20. Dec 03, 2023
  21. Dec 04, 2023
  22. Dec 02, 2023
    • Matt Harbison's avatar
      tests: fill in the Windows pattern for `$EADDRNOTAVAIL$` matching · e2632d9d1b6e
      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.
      e2632d9d1b6e
    • Matt Harbison's avatar
      tests: avoid a cascading failure on Windows · 1dd01023649d
      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.
      1dd01023649d
Loading