Skip to content
Snippets Groups Projects
  1. Feb 14, 2023
  2. Feb 13, 2023
    • Pierre-Yves David's avatar
      dirstate: explicitly write the dirstate after `keyword` "overwrite" · 44528f4a
      Pierre-Yves David authored
      I am working on making the dirstate write patterns more predictable. This patch is
      part of a small series of similar patches that adds a explicit dirstate write in
      a handful of location where the dirstate is updated "a bit in a strange way".
      
      With this explicit write, we are no longer relying on implicite write of the
      dirstate on `wlock` release. This make the world a better place.
      44528f4a
    • Pierre-Yves David's avatar
      dirstate: explicitly write the dirstate after `eol` dirstate manipulation · 981d2f13
      Pierre-Yves David authored
      I am working on making the dirstate write patterns more predictable. This patch is
      part of a small series of similar patches that adds a explicit dirstate write in
      a handful of location where the dirstate is updated "a bit in a strange way".
      
      With this explicit write, we are no longer relying on implicite write of the
      dirstate on `wlock` release. This make the world a better place.
      981d2f13
    • Pierre-Yves David's avatar
      dirstate: explicitly write the dirstate after mq dirstate rebuild · 89796af6
      Pierre-Yves David authored
      I am working on making the dirstate write patterns more predictable. This patch is
      part of a small series of similar patches that adds a explicit dirstate write in
      a handful of location where the dirstate is updated "a bit in a strange way".
      
      With this explicit write, we are no longer relying on implicite write of the
      dirstate on `wlock` release. This make the world a better place.
      89796af6
  3. Feb 14, 2023
    • Pierre-Yves David's avatar
      transaction: quietly rollback if no other changes than temporary files · 27fd12ec
      Pierre-Yves David authored
      If no actual change have been made, we don't really need to roll them back. We
      only have to cleanup some temporary files and it seems reasonable to do that
      quietly.
      
      This will help us to use the transaction in wider context¹ without impacting the
      user experience.
      
      [1] as in Python context managers that lives longer.
      27fd12ec
    • Pierre-Yves David's avatar
      transaction: run abort callback in all cases · 3128018e
      Pierre-Yves David authored
      Previously, these possibly important callback were "forgotten" when running a
      quick rollback.
      
      This is now fixed, as the tests shown.
      3128018e
    • Pierre-Yves David's avatar
      transaction: clarify the "quick abort" scenario · 2f348bab
      Pierre-Yves David authored
      Right now, the transaction has a code-pass to do a "quick abort" that skip most¹
      (too much) of the logic when the right condition are detected²
      
      We are about to improve this logic in multiple aspect. We clarify the code
      first.
      
      The conditional return in `_can_quick_abort` looks a bit weird because we are
      about to make them more complex very soon.
      
      [1] actually too much
      [2] actually not often enough
      2f348bab
  4. Feb 07, 2023
    • Pierre-Yves David's avatar
      test: use a more direct form of interruption in fncache "recover" testing · 420fad6b
      Pierre-Yves David authored
      The previous test was relying on implementation details and harder to maintain.
      
      The new version is closer to the initial intend : "What happens if the process
      die without cleanup".
      
      This change is motivated by further changes around the transaction and dirstate
      logic that would break the fragile equilibrium that existed before this patch.
      
      Making this change early make it easier to review on its own and remove noise
      in future larger changes.
      420fad6b
    • Pierre-Yves David's avatar
      test: use a more direct approach to test racy mutation · 3997c64e
      Pierre-Yves David authored
      The previous test was relying on implementation details and harder to maintain.
      
      The new version is closer to the initial intend : "What happens the file get overwritten from under the current process"
      
      This change is motivated by further changes around the transaction and dirstate
      logic that would break the fragile equilibrium that existed before this patch.
      
      Making this change early make it easier to review on its own and remove noise
      in future larger changes.
      3997c64e
  5. Feb 13, 2023
  6. Feb 07, 2023
    • Pierre-Yves David's avatar
      test: explicitly "add" file before some commit in test-keyword.t · 93d72a7d
      Pierre-Yves David authored
      `hg commit -A` will revert the `hg addremove` step if the commit fails. However
      `hg rollback` currently does not.
      
      We are about to improve internal consistency around transaction and dirstate
      and the behavior of `hg rollback` will align on the other behavior in the
      process.
      
      Before doing so, we make sure the test is using a separate call to `hg add` to
      avoid the test scenario to be affected by that future change.
      
      note: the behavior change for `hg rollback` seems fine as it affect a niche
      usecase and `hg rollback` usage have been strongly discouraged for a while.
      93d72a7d
  7. Feb 13, 2023
    • Pierre-Yves David's avatar
      test: explicitly "add" file before some commit in test-filecache.py · 09367b3d
      Pierre-Yves David authored
      `hg commit -A` will revert the `hg addremove` step if the commit fails. However
      `hg rollback` currently does not.
      
      We are about to improve internal consistency around transaction and dirstate and the behavior of `hg rollback` will align on the other behavior in the process.
      
      Before doing so, we make sure the test is using a separate call to `hg add` to
      avoid the test scenario to be affected by that future change.
      
      note: the behavior change for `hg rollback` seems fine as it affect a niche
      usecase and `hg rollback` usage have been strongly discouraged for a while.
      09367b3d
    • Pierre-Yves David's avatar
      test: explicitly "add" file before some commit in test-bookmark.t · 1e6015dd
      Pierre-Yves David authored
      `hg commit -A` will revert the `hg addremove` step if the commit fails. However
      `hg rollback` currently does not.
      
      We are about to improve internal consistency around transaction and dirstate and the behavior of `hg rollback` will align on the other behavior in the process.
      
      Before doing so, we make sure the test is using a separate call to `hg add` to
      avoid the test scenario to be affected by that future change.
      
      note: the behavior change for `hg rollback` seems fine as it affect a niche
      usecase and `hg rollback` usage have been strongly discouraged for a while.
      1e6015dd
    • Pierre-Yves David's avatar
      test: explicitly "add" file before some commit in test-rollback.t · dbcc4522
      Pierre-Yves David authored
      `hg commit -A` will revert the `hg addremove` step if the commit fails. However
      `hg rollback` currently does not.
      
      We are about to improve internal consistency around transaction and dirstate and the behavior of `hg rollback` will align on the other behavior in the process.
      
      Before doing so, we make sure the test is using a separate call to `hg add` to
      avoid the test scenario to be affected by that future change.
      
      note: the behavior change for `hg rollback` seems fine as it affect a niche
      usecase and `hg rollback` usage have been strongly discouraged for a while.
      dbcc4522
  8. Jan 11, 2023
  9. Jan 12, 2023
  10. Jan 11, 2023
  11. Feb 03, 2023
    • Matt Harbison's avatar
      run-tests: stop ignoring venv-installed packages · afa9d737
      Matt Harbison authored
      This will allow test dependencies to be installed within a venv, instead of
      tampering with sys/user sites.  One thing to note here is that the `VIRTUAL_ENV`
      path takes precedence over system-site, unlike when run directly with an
      activated `venv`.  For example, `sys.path` as viewed from a feature test in
      `hghave.py`, when running `hghave vcr` directly with an activated `venv`:
      
          sys.path: [
              '/home/jenkins/hg-committed/tests',
              '/usr/lib/python38.zip',
              '/usr/lib/python3.8',
              '/usr/lib/python3.8/lib-dynload',
              '/home/jenkins/test_venv/lib/python3.8/site-packages'
          ]
      
      vs `sys.path` from the same feature test, when run by `run-tests.py` with this
      change:
      
          sys.path: [
              '/home/jenkins/hg-committed/tests',
              '/home/jenkins/hg-committed',
              '/home/jenkins/hg-committed/tests',
              '/home/jenkins/test_venv/lib/python3.8/site-packages',
              '/usr/lib/python38.zip',
              '/usr/lib/python3.8',
              '/usr/lib/python3.8/lib-dynload',
              '/home/jenkins/.local/lib/python3.8/site-packages',
              '/usr/local/lib/python3.8/dist-packages',
              '/usr/lib/python3/dist-packages'
          ]
      afa9d737
  12. Jan 30, 2023
  13. Jan 31, 2023
  14. Jan 30, 2023
    • Pierre-Yves David's avatar
      setup: treat error output and non-zero return code differently · ac93876e
      Pierre-Yves David authored
      Choking on Mercurial's stderr mean armless warning can derails the whole install
      process. We do like to be able to issue warning to people so we stop considering
      any stderr is a fatal mistake.
      
      This allow us to actually boostrap a version of Mercurial without loosing to
      many sanity point. For example in case where evolve is not loaded, something
      that happens when the recorded version is malformatted. Creating a wonderful
      ouroboros.
      ac93876e
    • Pierre-Yves David's avatar
      setup: make the version computation process more resistant · 8d390a13
      Pierre-Yves David authored
      The tag fetching might return and empty string¹, from there everything derails
      quickly. As setup tools becomes more picky about version format we make the
      whole seems a bit more robust.
      
      The resulting version will be obviously weird, but at least it will actually
      install itself.
      
      [1] This is a problem we will address in the next changesets.
      8d390a13
    • Matt Harbison's avatar
      bundlerepo: enforce the requirements declared by the underlying repository · 84680c00
      Matt Harbison authored
      Previously, `hg log -r 'bundle()' -R bundle.hg` was failing for me when run from
      source, complaining about an unknown parent, when the system installed `hg`
      didn't.  Some debugging showed the index was 0 length.  It turned out that I
      didn't have the C extensions compiled, which a simple `hg log -r .` was able to
      indicate.  The problem being that the RequirementError got handled by RepoError,
      which uses an empty directory as a fallback to process the bundle.
      84680c00
  15. Jan 28, 2023
  16. Apr 29, 2021
  17. Dec 13, 2022
  18. Jan 26, 2023
  19. Dec 13, 2022
  20. Jan 25, 2023
    • Pierre-Yves David's avatar
      dirstate: rename parentchange to changing_parents · 7a8bfc05
      Pierre-Yves David authored
      Since the new argument breaks the API anyway, we can rename it to a better name.
      
      The previous name `parentchange` might be seen as something active, a function
      that would directly change the parents, however this is just a context manager
      to frame the operation that will change the parents and adjust the
      dirstate content accordingly.
      
      In addition, the future sister method that will be about changes to tracking and
      files would have a hard time fitting in the same naming scheme in a clear way.
      
      The new naming uses a clear prefix will make it more distinct from other
      dirstate methods and easier to extend with other similar contexts.
      7a8bfc05
    • Pierre-Yves David's avatar
      dirstate: pass the repo to the `changeparent` method · c166b212
      Pierre-Yves David authored
      If we want the context to be responsible for writing (and we want it), we need
      to have access to a localrepository object.
      
      So we now requires a localrepository object as an argument to this context
      manager.
      c166b212
Loading