Skip to content
Snippets Groups Projects
  1. Oct 26, 2022
  2. Nov 04, 2022
    • Raphaël Gomès's avatar
      dirstate-v2: update constant that wasn't kept in sync · 5743e19b
      Raphaël Gomès authored
      Despite the best efforts of the comment, this constant wasn't kept in sync
      when the flags were being rewritten.
      
      The fact that this doesn't actually break anything in the Rust implementation
      too much (which does use directories) relies on the fact that all nodes
      can have children and that dirstate traversal is not based on that flag, but
      for metadata in optimizations. However the bug could become more serious should
      we start encoding stronger guarantees using a combination of flags including
      this one.
      5743e19b
  3. Oct 18, 2022
    • Matt Harbison's avatar
      lfs: avoid closing connections when the worker doesn't fork · 3556f039
      Matt Harbison authored
      Probably not much more than an minor optimization, but could be useful in the
      case of `hg verify` where missing blobs are fetched one at a time.
      3556f039
    • Matt Harbison's avatar
      lfs: fix blob corruption when tranferring with workers on posix · abf47186
      Matt Harbison authored
      The problem seems to be that the connection used to request the location of the
      blobs is sitting in the connection pool, and then when workers are forked, they
      all see and attempt to use the same connection.  This garbles everything.  I
      have no clue how this ever worked reliably (but it seems to, even on Linux, with
      SCM Manager 1.58).  See previous discussion when worker support was added[1].
      
      It shouldn't be a problem on Windows, since the workers are just threads in the
      same process, and can see which connections are marked available and which are
      in use.  (The fact that `mercurial.keepalive.ConnectionManager.set_ready()`
      doesn't acquire a lock does give me some pause though.)
      
      [1] https://phab.mercurial-scm.org/D1568#31621
      abf47186
    • Matt Harbison's avatar
      keepalive: add `__repr__()` to the HTTPConnection class to ease debugging · 76fbb1b6
      Matt Harbison authored
      By default, this just printed the class name and memory address.  By displaying
      the address and ports on both sides of the socket, it makes it easier to figure
      out what's in the ConnectionManager, and correlate with WireShark traces.
      
      It looks like the two connections mentioned in the previous commit come about
      because the LFS POST request to access the blobs opens connection 1, and gets a
      401.  Then for some reason, the follow up with credentials opens a new socket,
      instead of using the existing one in the pool.  I have no clue why.
      
      This can be seen with something like this in the blobstore:
      
      ```
          for h in self.urlopener.handlers:
              if hasattr(h, "close_all"):
                  print('open connections on %s in pid %d' % (type(h), os.getpid()))
                  for host, conns in h._cm.get_all().items():
                      for c in conns:
                          print('connection: %r' % c)
      ```
      76fbb1b6
    • Matt Harbison's avatar
      keepalive: ensure `close_all()` actually closes all cached connections · 8251f7cc
      Matt Harbison authored
      While debugging why LFS blob downloads are getting corrupted with workers, I
      noticed that prior to spinning up the workers, the ConnectionManager has 2
      connections to the server and calling `KeepAliveHandler.close_all()` left one
      behind.  The reason is the value component of `self._cm.get_all().items()` is a
      list, and `self._cm.remove()` modifies said list while the caller is iterating
      over it.  Now `get_all()` is a deep copy of both the dict and lists in all
      cases.
      8251f7cc
  4. Nov 02, 2022
  5. Oct 31, 2022
  6. Oct 24, 2022
  7. Oct 20, 2022
  8. Oct 19, 2022
  9. Oct 18, 2022
  10. Oct 10, 2022
    • Arseniy Alekseyev's avatar
      dirstate-v2: skip evaluation of hgignore regex on cached directories · eb02decd
      Arseniy Alekseyev authored
      By making the computation of [has_ignored_ancestor] lazy we're eliding
      its computation in the common case when none of its descendants have
      changed on disk.
      
      On a ~400k files repo, with a cached status, we saw a ~64% reduction
      in CPU time, resulting in a speedup of ~10-15% (on ZFS), and a speedup
      of ~38% of XFS (XFS has faster stat operations for some reason).
      eb02decd
  11. Sep 30, 2022
    • Craig Ozancin's avatar
      releasenotes: use re.MULTILINE mode when checking admonitions · 943509a5
      Craig Ozancin authored
      Release note admonitions must start at the beginning of a line within
      the changeset description:
      
      .. admonitions::
      
      The checkadmonitions function search for and validates admonitions.
      
      Unfortunately, since the ctx.description is multi-line, the regex search
      always fails unless the admonition is on the first line.
      
      This changeset adds re.MULTILINE to the re.compile to make the re opbject
      multi-line.
      943509a5
  12. Oct 10, 2022
  13. Oct 05, 2022
    • Arseniy Alekseyev's avatar
      rhg: parallellize computation of [unsure_is_modified] · 52464a20
      Arseniy Alekseyev authored
      [unsure_is_modified] is called for every file for which we can't
      determine its status based on its size and mtime alone.
      
      In particular, this happens if the mtime of the file changes
      without its contents changing.
      
      Parallellizing this improves performance significantly when
      we have many of these files.
      
      Here's an example run (on a repo with ~400k files after dropping FS caches)
      
      ```
      before:
      real	0m53.901s
      user	0m27.806s
      sys	0m31.325s
      
      after:
      real	0m32.017s
      user	0m34.277s
      sys	1m26.250s
      ```
      
      Another example run (a different FS):
      
      ```
      before:
      real	3m28.479s
      user	0m31.800s
      sys	0m25.324s
      
      after:
      real	0m29.751s
      user	0m41.814s
      sys	1m15.387s
      ```
      52464a20
  14. Sep 21, 2022
  15. Sep 22, 2022
  16. Sep 20, 2022
  17. Sep 22, 2022
  18. Sep 20, 2022
  19. Oct 04, 2022
    • Matt Harbison's avatar
      revset: handle wdir() in `sort(..., -topo)` · 117dcc4a
      Matt Harbison authored
      The last apparent usage of `repo.changelog.parentrevs` in revsets is in
      `children()`, but since the sets being operated on never include wdir(), it's
      never called with `wdirrev` and the wdir() arg on the command line is
      effectively ignored instead of aborting there.  I'm not sure how to fix that.
      
      Before (on a clone of hg):
      
          $ python3.8 hg perf::revset --config extensions.perf=contrib/perf.py 'sort(all(), -topo)'
          ! wall 0.123663 comb 0.130000 user 0.130000 sys 0.000000 (best of 76)
      
      After:
      
          $ python3.8 hg perf::revset --config extensions.perf=contrib/perf.py 'sort(all(), -topo)'
          ! wall 0.123838 comb 0.130000 user 0.130000 sys 0.000000 (best of 75)
      117dcc4a
  20. Oct 03, 2022
    • Matt Harbison's avatar
      revset: handle wdir() in `roots()` · e02dcc62
      Matt Harbison authored
      This is already handled in `heads()`, and both are needed to determine if a set
      is contiguous.
      
      I'm guessing the `0 <= p` check was to try to filter out the null revision, but
      it looks like that comes through in the corner case of a new repo with no
      commits.  But that was already the case, as shown by the tests.
      
      Before (on a clone of hg):
      
          $ python3.8 hg perf::revset --config extensions.perf=contrib/perf.py 'roots(all())'
          ! wall 0.059301 comb 0.040000 user 0.040000 sys 0.000000 (best of 100)
      
      After:
      
          $ python3.8 hg perf::revset --config extensions.perf=contrib/perf.py 'roots(all())'
          ! wall 0.059387 comb 0.060000 user 0.060000 sys 0.000000 (best of 100)
      e02dcc62
  21. Sep 20, 2022
  22. Jul 25, 2022
    • Euxane TRAN-GIRARD's avatar
      contrib: add pull_logger extension · 79105036
      Euxane TRAN-GIRARD authored
      This extension logs the pull parameters, i.e. the remote and common heads,
      when pulling from the local repository.
      
      The collected data should give an idea of the state of a pair of repositories
      and allow replaying past synchronisations between them. This is particularly
      useful for working on data exchange, bundling and caching-related
      optimisations.
      79105036
  23. Oct 04, 2022
  24. Oct 03, 2022
    • Mathias De Mare's avatar
      mergetools: don't let meld open all changed files on startup · a6efc1f1
      Mathias De Mare authored
      In meld 3.16, a multi-file change with option '-a' results in
      an overview list being opened.
      In meld 3.20, a multi-file change with option '-a' results in
      an overview list AND every changed file being opened.
      
      Simply removing '-a' seems to work fine for both cases
      and also behaves the same as before for single-file changes.
      
      As per the release notes, this is due to the following change
      in meld 3.19.0:
      "Make the --auto-compare command line flag work again (Kai Willadsen)"
      
      See also https://gitlab.gnome.org/GNOME/meld/-/issues/516
      a6efc1f1
Loading