Skip to content
Snippets Groups Projects
  1. Mar 20, 2023
  2. Mar 07, 2023
    • kiilerix's avatar
      statprof: with Python 3.12, lineno is (more) often None · 972f3e5c
      kiilerix authored
      test-profile.t failed with errors like:
        TypeError: %d format: a real number is required, not NoneType
      
      statprof.py already handled None values as -1 in some cases. Do the same in
      more cases.
      972f3e5c
    • kiilerix's avatar
      py3: fix for Python 3.12 emitting SyntaxWarning on invalid escape sequences · 805d4a46
      kiilerix authored
      Mercurial became very noisy after https://github.com/python/cpython/commit/a60ddd31be7ff96a8189e7483bf1eb2071d2bddf ,
      for example:
      
        $ python3.12 mercurial/store.py
        mercurial/store.py:406: SyntaxWarning: invalid escape sequence '\.'
          EXCLUDED = re.compile(b'.*undo\.[^/]+\.(nd?|i)$')
      
      This verbosity made some tests fail.
      
      The problems were mostly insufficiently escaped regexps, relying on the Python
      parser/scanner preserving invalid escape sequences.
      805d4a46
    • kiilerix's avatar
      cext: fix for PyLong refactoring in CPython 3.12 · 0d3690f8
      kiilerix authored
      Compiling Mercurial with Python 3.12 a5 would fail with:
      
      mercurial/cext/dirs.c: In function '_addpath':
      mercurial/cext/dirs.c:19:44: error: 'PyLongObject' {aka 'struct _longobject'} has no member named 'ob_digit'
         19 | #define PYLONG_VALUE(o) ((PyLongObject *)o)->ob_digit[0]
            |                                            ^~
      mercurial/cext/dirs.c:97:25: note: in expansion of macro 'PYLONG_VALUE'
         97 |                         PYLONG_VALUE(val) += 1;
            |                         ^~~~~~~~~~~~
      mercurial/cext/dirs.c:19:44: error: 'PyLongObject' {aka 'struct _longobject'} has no member named 'ob_digit'
         19 | #define PYLONG_VALUE(o) ((PyLongObject *)o)->ob_digit[0]
            |                                            ^~
      mercurial/cext/dirs.c:108:17: note: in expansion of macro 'PYLONG_VALUE'
        108 |                 PYLONG_VALUE(val) = 1;
            |                 ^~~~~~~~~~~~
      mercurial/cext/dirs.c: In function '_delpath':
      mercurial/cext/dirs.c:19:44: error: 'PyLongObject' {aka 'struct _longobject'} has no member named 'ob_digit'
         19 | #define PYLONG_VALUE(o) ((PyLongObject *)o)->ob_digit[0]
            |                                            ^~
      mercurial/cext/dirs.c:145:23: note: in expansion of macro 'PYLONG_VALUE'
        145 |                 if (--PYLONG_VALUE(val) <= 0) {
            |                       ^~~~~~~~~~~~
      
      This was caused by
      https://github.com/python/cpython/commit/c1b1f51cd1632f0b77dacd43092fb44ed5e053a9 .
      0d3690f8
  3. Oct 27, 2022
    • Jordi Gutiérrez Hermoso's avatar
      histedit: fix diff colors · 22d7cb81
      Jordi Gutiérrez Hermoso authored
      The problem here is that indexing a bytestring gives you integers, not
      chars, so the comparison to b'+' ends up being wrong.
      
      We don't really have a way to test curses output, so no tests to
      verify the correctness of this behaviour.
      22d7cb81
  4. Mar 15, 2023
    • Pierre-Yves David's avatar
      dirstate: fix a potential traceback when in `copy` and `rename` · 9fc0d244
      Pierre-Yves David authored
      Before this changes, calling `hg copy` or `hg rename` could trigger a traceback
      about using an invalidated dirstate. This wasn't caught by the test as it needed
      the blackbox extension to preload the dirstate first in a way "refresh"
      invalidates it.
      
      Changing the context creation patterns fixes it.
      9fc0d244
  5. Mar 14, 2023
  6. Mar 06, 2023
  7. Mar 09, 2023
    • Felipe Contreras's avatar
      fastexport: rework newline logic · dd42156b
      Felipe Contreras authored
      Newlines should only be added when otherwise the stream would look weird
      without them (on blobs), therefore they are the exception.
      
      Flip the logic so they are added, not skipped.
      dd42156b
  8. Mar 13, 2023
  9. Mar 10, 2023
  10. Mar 06, 2023
    • Arseniy Alekseyev's avatar
      encoding: avoid quadratic time complexity when json-encoding non-UTF8 strings · 95acba2c
      Arseniy Alekseyev authored
      Apparently the code uses "+=" with a bytes object, which is linear-time, so the
      whole encoding is quadratic-time. This patch makes us use a bytearray object,
      instead, which has a(n amortized-)constant-time append operation.
      
      The encoding is still not particularly fast, but at least a 10MB file
      takes tens of seconds, not many hours to encode.
      95acba2c
  11. Mar 08, 2023
    • Pierre-Yves David's avatar
      bundle: prevent implicite bundling of internal changeset · bcf54837
      Pierre-Yves David authored
      Now that the two mains source of on-disk bundle are preventing the inclusion of
      internal changesets in their bundling. We can add a lower level check that
      would prevent any other leakage of internal-phase changesets.
      
      We keep the door open to some usage, like the temporary bundle using during
      strip for example.
      bcf54837
  12. Mar 10, 2023
  13. Mar 08, 2023
  14. Mar 10, 2023
  15. Mar 09, 2023
    • Pierre-Yves David's avatar
      strip: explicitly compute the boundary of the backup bundle · 7a017cd0
      Pierre-Yves David authored
      We want to make change to the set of backed up revision in a future changeset,
      we start with a change of the computation without any changes in the semantic
      to clarify later changeset.
      
      The could of costly assert are here to testify that the result is still
      correct. They will be removed in the next changesets, but I wanted them in this
      changeset to help in case someone bisect a regression to this changeset in the
      future.
      7a017cd0
  16. Mar 10, 2023
    • Pierre-Yves David's avatar
      outgoing: fix common-heads computation from `missingroots` argument · f95ab2c5
      Pierre-Yves David authored
      When initializing a `outgoing` object, the `common set` can be defined explicitly (with the `commonheads` argument`) or implicitly (with the missingroots arguments).
      
      It turns out the logic to compute `commonheads` from `missingroots` is buggy, as it does not consider the parents of enough changesets. Previously, it only considered parents of "missingroots` items, while it need to consider all parents of missing. Here is an example:
      
        F
        |\
        C E
        | |
        B D
        |/
        A
      
      If we use [E] as missing-roots, the missing set is [E, F], and the common-heads
      are [C, D]. However you cannot only consider the parent of [E] to find them, as
      [C] is not a parent of [E].
      
      This already fix the bundle generated in one test, and it would prevent many
      other to misbehave with future change from this series.
      f95ab2c5
  17. Mar 09, 2023
    • Jason R. Coombs's avatar
      bundle: include required phases when saving a bundle (issue6794) · 385a4f80
      Jason R. Coombs authored
      We now properly computes and includes phases above secret in bundle,
      previously, they would be skipped, and then the code computing them would
      crash.
      
      Note that from this changeset, we also include the heads associated with the
      changegroup's "target" phase. This turned out to be necessary to ensure the
      movement of changeset included in the bundle, but already known locally.
      
      This explain why lines for "secret" heads appears in multiple tests.
      385a4f80
  18. Mar 08, 2023
  19. Mar 07, 2023
  20. Mar 02, 2023
  21. Mar 07, 2023
  22. Mar 06, 2023
    • Pierre-Yves David's avatar
      undo-files: clean existing files up before writing new one · 92734603
      Pierre-Yves David authored
      the in the initial design of journal/undo interaction, ages ago, new file always
      overwrote previous files. This is no longer the case for a long while, so it is
      time to properly clean things up before writing new ones.
      
      Otherwise, inconsistent "undo" state might exist on disk, leading `hg rollback`
      to misbehave (more that intended).
      92734603
  23. Mar 07, 2023
  24. Mar 06, 2023
Loading