Skip to content
Snippets Groups Projects
  1. Feb 22, 2023
  2. Feb 23, 2023
    • Pierre-Yves David's avatar
      narrow: drop the dedicated backup code · 39256bee
      Pierre-Yves David authored
      Now that the transaction manage the writes, we can simply use the transaction for backup.
      
      Some extra cleanup to ensure all changes happens within a transaction will be
      made in the next changesets.
      39256bee
  3. Feb 24, 2023
  4. Feb 22, 2023
  5. Feb 20, 2023
    • Pierre-Yves David's avatar
      dirstate: invalidate on all exceptions · 2323b74f
      Pierre-Yves David authored
      Previously, we would miss SystemExit, KeyboardInterrupt etc.
      
      This "fix" on the bug tested in "test-largefiles-update.t" by preventing the
      precisely tested situation to happens at all. However this reveal a similar bug
      with a different timing.
      
      I have not been able to deal with that pre-existing bug so far. So I updated the
      test to point that out.
      2323b74f
  6. Feb 21, 2023
  7. Feb 18, 2023
    • Pierre-Yves David's avatar
      test-chg: use a different log to avoid flakyness · 889d2a2e
      Pierre-Yves David authored
      The test was deleting the log file to start anew. However a trailing working
      process might still be alive at this time, and recreate the very same log on
      exit.
      
      We see the trace of such worker in the expected content of server.log (see the
      trace modified by this patch). This is flaky because we don't know *when* the
      worker will write to the file and there is a race with the `hg init cached`
      command.
      
      A much simpler and reliable way to start anew without having such race is… to
      write to a different log file. No reuse → no conflict, no conflict → no race, no
      race → no flakiness.
      889d2a2e
  8. Jan 27, 2023
  9. Feb 14, 2023
    • Matt Harbison's avatar
      tag: disallow tagging the working directory · 4fc6b423
      Matt Harbison authored
      It's kinda silly, but a clear error message is better than a stacktrace about
      subscripting `None` when trying to generate the default commit message.  I'm
      surprised that `.revsingle(..).node()` returns None instead of `nodemod.wdirid`,
      but now there's a test to catch if this changes.
      4fc6b423
  10. Feb 16, 2023
    • Pierre-Yves David's avatar
      localrepo: stop doing special dirstate backup at transaction open · ff12f424
      Pierre-Yves David authored
      Since the dirstate writes are already managed by the transaction, we already do
      a backup of the dirstate when necessary (and even trigger one to keep `hg
      rollback` happy).
      
      We needs some special code to deal with the initial empty checkout, but it is
      not too complicated.
      
      Managing variable filename (as dirstate-v2 uses) at the "journalfile" level, is
      complex and fragile (which is consistent with the fact these files are not
      journal…). If we no longer do it, our life is significantly simpler.
      
      In some sense, we apply the xkcd-1134¹ solution to our savebackup/restorebackup
      problem.
      
      [1] https://xkcd.com/1134/
      
      (the change to test-hardlink are expect as decreasing the number of duplicated
      backup drive the hardlink count down)
      ff12f424
    • Pierre-Yves David's avatar
      test-hardlink: stop explicitly listing `undo.dirstate` · a28cedb2
      Pierre-Yves David authored
      The files is on its way out.
      a28cedb2
    • Pierre-Yves David's avatar
      test: fix the flakyness in test-remotefilelog-local.t · 983e2db1
      Pierre-Yves David authored
      I now get about 80% of my `test-chg` CI run that fails on flakyness in this
      tests.
      
      It turns out this is only ambiguous status that end up doing file download. So…
      calling status early will do that potential download separately and the calls we
      scrutinize during that test will be just fine.
      983e2db1
  11. Feb 15, 2023
  12. Jan 25, 2023
  13. Feb 15, 2023
    • Pierre-Yves David's avatar
      commit: use `dirstate.change_files` to scope the associated `addremove` · 28dfb2df
      Pierre-Yves David authored
      This was significantly more complicated than I expected, because multiple
      extensions get in the way.
      
      I introduced a context that lazily open the transaction and associated context
      to work around these complication. See the inline documentation for details.
      
      Introducing the wrapping transaction remove the need for dirstate-guard (one of
      the ultimate goal of all this), and slightly affect the result of a `hg
      rollback` after a `hg commit --addremove`. That last part is deemed fine. It
      aligns the behavior with what happens after a failed `hg commit --addremove` and
      nobody should be using `hg rollback` anyway.
      
      The small output change in the test come from the different transaction timing
      and fact the transaction now backup the dirstate before the addremove, which
      might mean "no file to backup" when the repository starts from an empty state.
      28dfb2df
  14. Feb 14, 2023
  15. 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
  16. Feb 13, 2023
  17. 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
  18. 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
  19. Jan 11, 2023
  20. Feb 03, 2023
    • Pierre-Yves David's avatar
      fix: add more information to the debug output · b5ecd0bc
      Pierre-Yves David authored
      The previous debug output did not help to understand which file where fixed in
      which revision. The new output should cover that.
      b5ecd0bc
    • 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
  21. Jan 31, 2023
  22. Jan 30, 2023
    • 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
Loading