Skip to content
Snippets Groups Projects
  1. May 15, 2023
  2. May 09, 2023
  3. May 04, 2023
  4. Apr 28, 2023
  5. Apr 16, 2023
  6. May 02, 2023
    • Pierre-Yves David's avatar
      backup: fix issue when the backup end up in a different directory · a445194f
      Pierre-Yves David authored
      Because of store encoding, we might end up with the backup in a different
      directory than the initial copy (for example if the backup path make it cross
      the 120 char limit).
      
      This can create crash, especially since 6.4 where backup are used during revlog
      split.
      
      Making sure the directory exists fixes these crash We added a test covering this
      case.
      
      Strictly speaking, this has always been broken, however the new code in 6.4
      triggers it more easily.
      a445194f
    • Pierre-Yves David's avatar
      vfsproxy: inherit the `createmode` attribute too · d1d458fb
      Pierre-Yves David authored
      It is an important part of the API when creating directory. We will need it in
      the next changeset.
      d1d458fb
    • Pierre-Yves David's avatar
      revlog: test more complex file pattern for revlog split · f930af43
      Pierre-Yves David authored
      There have been a report of failure while splitting revlog. The file name
      involved was important. The pattern involved here are not problematic, but it
      help to setup the machinery to test multiple files, the actual fix and
      problematic file will arrive in a later changeset.
      f930af43
    • Raphaël Gomès's avatar
      repo-upgrade: write new requirement before upgrading the dirstate · b4b1791f
      Raphaël Gomès authored
      This will prevent a small race condition where another hg process still
      believes the repo is dirstate-v1 during the upgrade process.
      
      This is good to have, but it is not a proper fix for the underlying problem.
      There is code that assumes a requirement means a usage, e.g. having the
      `generaldelta` requirement would imply *all* revlogs to use general delta,
      but it's not true, it simply means that the repository advertises to the
      client it needs to understand `generaldelta` in order to read the repo.
      
      In the case of the dirstate, having the requirement *technically* should always
      be the same as using dirstate-v2, since there is only one dirstate and
      requirements should be as minimal as possible. However, we should not assume
      this and make the code more robust in a future patch (series).
      b4b1791f
  7. Apr 28, 2023
  8. May 03, 2023
    • Anton Shestakov's avatar
      transaction: tr._names are actually bytes, use byte string to join them · 392e2f31
      Anton Shestakov authored
      Looks like this is never checked in the tests? But trying e.g. `print(tr)` by
      hand before this change would give:
      
        TypeError: sequence item 0: expected str instance, bytes found
      
      Looks like tr._names are always bytes (although this isn't actually enforced,
      but maybe at some point it will at least be type checked e.g. by pytype).
      392e2f31
  9. Apr 16, 2023
    • Euxane TRAN-GIRARD's avatar
      nix: add nix-defined package and devel env (flake) · be676c31
      Euxane TRAN-GIRARD authored
      This adds a Nix Flake which defines:
      
      - package recipies to build and run Mercurial (C, C+Rust variants),
      - a meta package to run the test suite in an isolated sandbox,
      - a development environment with some tools
        (notably Python and the Black formatter, pinned to match the CI).
      
      Python is pinned to the recommended version.
      The Rust toolchain is a fairly recent one provided by the Nixpkgs channel.
      It is not yet pinned to the same version as the "reference" Debian package,
      but this does not seem to cause any issue.
      
      Example usage of local commands are provided in the `flake.nix` file.
      Once merged, it should also be possible to pull and run directly from the
      source repository directly with something like:
      `nix run hg+https://foss.heptapod.net/mercurial/mercurial-devel?ref=TOPIC&dir=contrib/nix' -- version`
      be676c31
  10. Apr 20, 2023
  11. Apr 16, 2023
  12. Mar 21, 2023
  13. Apr 26, 2023
  14. Apr 25, 2023
    • Matt Harbison's avatar
      fix: highlight the required configuration and behavior of the fixer tools · f4ff5558
      Matt Harbison authored
      The problem is that `hg help fix` didn't mention *how* to configure the tools,
      and while I knew that `{rootpath}` existed in the configuration, I missed that
      the tools require reading content from stdin.  (I configured `gofmt` to use
      `{rootpath}`, and that had the effect of squashing all changes in a file at `.`
      into the first commit and emptying that content from its descendants.)
      
      Basically all this does is put a pointer in the default (command level) help to
      the extension level help that mentions the configuration, and moves the
      extension level help that documents reading from stdin and writing to stdout to
      the top to give it more prominence.  The last sentence is adjusted a bit to
      reflect the new location.
      f4ff5558
  15. Apr 18, 2023
  16. Apr 19, 2023
  17. Apr 18, 2023
  18. Apr 19, 2023
    • Pierre-Yves David's avatar
      delta-find: never do anything fancy when general delta is off · 02325712
      Pierre-Yves David authored
      Without general delta, the only option is to do a delta against the previous
      revision in the revlog, or to do a full snapshot. So no need to dive into the
      more complicated logic.
      
      This prevent Mercurial to misbehave when applying remote deltas when
      `pulled-delta-reuse-policy` was set to "try-base" or "forced" and would produce
      and store invalid deltas.
      
      We add an associated tests to make sure this scenario is covered by tests.
      
      There are more code to cleanup after this, but I what to keep the fixing patch
      simple.
      02325712
    • Pierre-Yves David's avatar
      delta-find: assume the target-rev if not specified · ca1522fe
      Pierre-Yves David authored
      This will be useful in the next patch, but I am putting it in its own commit to
      make sure we can easily bisect any subtle side effect. (none are expected, but
      still)
      ca1522fe
  19. Mar 10, 2023
  20. Jan 30, 2023
  21. Apr 20, 2023
    • Arun Kulshreshtha's avatar
      chg: set CHGHG before connecting to command server · c2a1f866
      Arun Kulshreshtha authored
      cf4d2f31660d (!523) changed chg to set `CHGHG` itself when spawning a new command
      server, in order to ensure that the path to the `hg` executable would be checked
      during server validation. (This is useful when chg is built with `HGPATHREL`).
      
      However, that change broke chg because it failed to set `CHGHG` before trying
      to connect to an existing command server. This means that if `CHGHG` is not
      present in the environment, chg will always spawn a new command server, entirely
      negating the point of chg.
      
      This breakage wasn't initially caught because of the difficulty of writing
      automated tests with the `HGPATHREL` feature enabled, which meant the change
      was only tested manually to make sure that it fixed the problem with `HGPATHREL`
      that prompted the change.
      
      In practice, this functionality is only really useful when chg is built with
      `HGPATHREL`, so I considered wrapping it in an `#ifdef` to preserve the old
      behavior by default. However, this makes it hard to write tests since one would
      have to explicitly set `HGPATHREL=1` when running `run-tests.py` (which is why
      the original change lacked tests). It would be great if there were a way of
      testing features that are gated behind conditional compilation.
      c2a1f866
  22. Apr 24, 2023
  23. Apr 07, 2023
  24. Apr 18, 2023
  25. Apr 17, 2023
    • Pierre-Yves David's avatar
      revlog-split: make sure the self._indexfile attribut is reset (issue6811) · f952be90
      Pierre-Yves David authored
      Before this change, after a transaction committing a file split, a revlog
      object would have its `self._indexfile` attribute desynchronised from the
      actual file storing the data. If that same object is reused (as we do for the
      manifest during clone bundles), this lead to the data being writting in the
      wrong location and the repository to go corrupt.
      
      We not properly reset the attribut when applicable and everything is back in
      working order.
    • Pierre-Yves David's avatar
      revlog-split: also check a case where bundle contains multiple changegroup · 2bb2a1ff
      Pierre-Yves David authored
      This case is not affected, we remains in the same transaction. However it seems
      important to improve the test coverage around these "features". It also helped
      to assert the scop of the critical bug.
      2bb2a1ff
    • Pierre-Yves David's avatar
      revlog-split: show manifest data loss situation when using clonebundle · 54f68495
      Pierre-Yves David authored
      After the commit of the transaction from applying the clone bundle, changes to
      the manifest from the subsequent pull would write index data in the wrong file.
      This lead to data being "lost" after the pull and the repository to be
      corrupted. We add a test checking this specific scenario.
      
      In practice, the issue only affects the manifest but we also test the issue with a file for future proofing things up.
      
      See test documentation and failure for details.
      54f68495
Loading