Skip to content
Snippets Groups Projects
  1. Dec 11, 2023
    • Pierre-Yves David's avatar
      changelog: never inline changelog · dcaa2df1
      Pierre-Yves David authored
      The test suite mostly use small repositories, that implies that most changelog in the
      tests are inlined. As a result, non-inlined changelog are quite poorly tested.
      Since non-inline changelog are most common case for serious repositories, this
      lack of testing is a significant problem that results in high profile issue like
      the one recently fixed by 66417f55ea33 and 849745d7da89.
      
      Inlining the changelog does not bring much to the table, the number of total
      file saved is negligible, and the changelog will be read by most operation
      anyway.
      
      So this changeset is make it so we never inline the changelog, and de-inline the
      one that are still inlined whenever we touch them.
      
      By doing that, we remove the "dual code path" situation for writing new entry to
      the changelog and move to a "single code path" situation. Having a single
      code path simplify the code and make sure it is covered by test (if test cover
      that situation obviously)
      
      
      This impact all tests that care about the number of file and the exchange size,
      but there is nothing too complicated in them just a lot of churn.
      
      The churn is made "worse" by the fact rust will use the persistent nodemap on
      any changelog now. Which is overall a win as it means testing the persistent
      nodemap more and having less special cases.
      
      In short, having inline changelog is mostly useless and an endless source of
      pain. We get rid of it.
      dcaa2df1
  2. Jul 10, 2023
  3. Mar 10, 2023
  4. Jan 04, 2023
    • Matt Harbison's avatar
      tests: drop `(py3 !)` output matching predicates · 950c3991
      Matt Harbison authored
      Presumably these were paired with `(no-py3 !)` at one point, but now they were
      unconditionally true.
      
      test-check-code.t required a couple of `(glob)` markers on the changed lines in
      test-lfs-serve-access.t, because of the `$LOCALIP` usage on those lines.  Not
      sure how those lines slipped through the checks previously.
      950c3991
  5. May 02, 2022
  6. Sep 22, 2022
  7. Jan 18, 2022
  8. Dec 07, 2021
  9. Aug 03, 2021
  10. Jul 09, 2021
  11. Jan 14, 2021
  12. Apr 06, 2021
  13. Mar 04, 2021
  14. Nov 23, 2020
  15. Nov 12, 2020
  16. Feb 26, 2020
    • sliquister's avatar
      exchange: turn on option that makes concurrent pushes work better · edc8504b
      sliquister authored
      The motivation is simply to make hg work better out of the box.
      
      This is a slight backwards compatibility break, because client
      extensions could have assumed that the list of heads the client sees
      during discovery will be the list of heads during the entirety of the
      push. It seems unlikely to matter, and not worth mentioning.
      
      There's a fair amount of diff in tests, but this is just due to
      sending a few more bytes on the wire, except for test-acl.t.
      The extra "invalid branch cache" lines in test-acl.t don't seem to
      indicate a problem: the branchcache now get computed during the bundle
      application (because of the check:updated-heads bundle part), but
      doesn't get rolled back when transactions rollback, thus causing a
      message in the next operation computing the branch cache. Before this
      change, I assume the branchcache was only computed on transaction
      commit, so not computed at all when the transactions roll back, thus
      no messages.
      
      Differential Revision: https://phab.mercurial-scm.org/D8202
      edc8504b
  17. Sep 08, 2019
    • Pierre-Yves David's avatar
      changegroup: move message about added changes to transaction summary · d7304434
      Pierre-Yves David authored
      Before that, applying multiple changegroups in the same transaction issued the
      message multiple time. This result in a confusing output:
      
          adding changesets
          adding manifests
          adding file changes
          added 32768 changesets with 60829 changes to 2668 files
          adding changesets
          adding manifests
          adding file changes
          added 8192 changesets with 16885 changes to 1553 files
          adding changesets
          adding manifests
          adding file changes
          added 1020 changesets with 1799 changes to 536 files
          adding changesets
          adding manifests
          ...
      
      Instead, we now only issue the message once at the end of the transaction,
      summing up all added changesets, changes and files. The line is identical, but
      happens sightly later in the output.
      
      There are other suboptimal behavior around issue multiple changegroup (eg:
      progress bar). We'll cover them later.
      
      This impact of lot of test as one would expect, but a two pass check show they
      are just the order change we expected.
      
      To deal with "under the hood" bundle application by internal code, we had to
      take a slightly hacky move. We could clean that up with a more official way to
      enter "under the hood" section, however I want to keep this series simple to get
      it landed. This kind of change have a very high bit rot rate since it impact a
      lot of test output.
      d7304434
  18. Feb 09, 2019
  19. Nov 12, 2018
  20. Oct 13, 2018
    • Matt Harbison's avatar
      tests: replace `cd ..` with an absolute path in a couple ssh tests · 52b773f5
      Matt Harbison authored
      These tests are broken under py3 on Windows to the point where the `cd ..` was
      actually escaping into the system wide $TEMP.  The subsequent `hg init` created
      a repo there, and then added a local extension to the hgrc.  This breaks every
      single subsequent test when it tries to `hg init` in its $TESTTMP, and can't
      load the localwrite.py extension.  And since I botched this the first time and
      replaced the wrong `cd ..`, this just replaces all of them.  I've noticed test
      garbage in $TEMP recently, and maybe this will help.
      
      Perhaps `hg init` shouldn't load the config for the local repo, but this is an
      easy enough workaround for now.
      52b773f5
  21. Oct 09, 2018
    • Gregory Szorc's avatar
      wireprotov2: change how revisions are specified to changesetdata · 41263df0
      Gregory Szorc authored
      Right now, we have a handful of arguments for specifying the revisions
      whose data should be returned. Defining how all these arguments
      interact when various combinations are present is difficult.
      
      This commit establishes a new, generic mechanism for specifying
      revisions. Instead of a hodgepodge of arguments defining things, we
      have a list of dicts that specify revision selectors. The final set
      of revisions is a union of all these selectors.
      
      We implement support for specifying revisions based on:
      
      * An explicit list of changeset revisions
      * An explicit list of changeset revisions plus ancestry depth
      * A DAG range between changeset roots and heads
      
      If you squint hard enough, this problem has already been solved by
      revsets. But I'm reluctant to expose revsets to the wire protocol
      because that would require servers to implement a revset parser.
      Plus there are security and performance implications: the set
      of revision selectors needs to be narrowly and specifically tailored
      for what is appropriate to be executing on a server. Perhaps there
      would be a way for us to express the "parse tree" of a revset
      query, for example. I'm not sure. We can explore this space another
      time. For now, the new mechanism should bring sufficient flexibility
      while remaining relatively simple.
      
      The selector "types" are prefixed with "changeset" because I plan
      to add manifest and file-flavored selectors as well. This will enable
      us to e.g. select file revisions based on a range of changeset
      revisions.
      
      Differential Revision: https://phab.mercurial-scm.org/D4979
      41263df0
  22. Sep 20, 2018
    • Gregory Szorc's avatar
      wireprotov2: allow multiple fields to follow revision maps · d059cb66
      Gregory Szorc authored
      The *data wire protocol commands emit a series of CBOR values.
      Because revision/delta data may be large, their data is emitted
      outside the map as a top-level bytestring value.
      
      Before this commit, we'd emit a single optional bytestring
      value after the revision descriptor map. This got the job done.
      But it was limiting in that we could only send a single field.
      And, it required the consumer to know that the presence of a
      key in the map implied the existence of a following bytestring
      value.
      
      This commit changes the encoding strategy so top-level bytestring
      values in the stream are explicitly denoted in a "fieldsfollowing"
      key. This key contains an array defining what fields that follow
      and the expected size of each field.
      
      By defining things this way, we can easily send N bytestring
      values without any ambiguity about their order. In addition,
      clients only need to know how to parse ``fieldsfollowing`` to
      know if extra values are present.
      
      Because this breaks backwards compatibility, we've bumped the version
      number of the wire protocol version 2 API endpoint.
      
      Differential Revision: https://phab.mercurial-scm.org/D4620
      d059cb66
  23. Sep 17, 2018
    • Anton Shestakov's avatar
      bundle2: make server.bundle2.stream default to True · 4bd6e444
      Anton Shestakov authored
      Support for bundle2 streaming clones has been shipped in Mercurial 4.5
      (7eedbd5d4880), but was never activated by default. It's time to have more
      people use it. The new format allows streaming clones to transport cache
      (hooray for speed) and phaseroots (fixes phase-related issues).
      
      Changes in tests:
      
      bundle2 capabilities now have "stream=v2" (plus a '\n' as a separator) and
      therefore take 14 bytes more: "%0Astream%3Dv2". Tip for tests that have data
      encoded with CBOR: 0xd3 - 0xc5 = 14.
      
      $USUAL_BUNDLE2_CAPS$ replaces $USUAL_BUNDLE2_CAPS_SERVER$, which is the same
      thing, but without "stream=v2".
      
      Since streaming clones now also transfer caches, the reported byte and file
      counts are higher (e.g. 816 bytes in 9 files instead of 613 bytes in 4 files,
      a bit of --debug and manual math confirms that the caches take these extra 203
      bytes in 5 files).
      
      Differential Revision: https://phab.mercurial-scm.org/D4680
      4bd6e444
  24. Sep 19, 2018
  25. Sep 04, 2018
  26. Aug 18, 2018
    • Matt Harbison's avatar
      tests: conditionalize out tests that msys is mangling · 2dfc2262
      Matt Harbison authored
      This was exposed by ac0a87160012.  The paths for convert and ssh respectively
      are being turned into:
      
         $TESTTMP\bzr+ssh:\foobar@selenic.com\baz\.hg
      
         'C:\\C:\\Users\\Matt\\AppData\\Local\\Temp\\hgtests.8awa9x\\child1\\test-ssh-bundle1.t-sshv2\\nonexistent\\.hg
      
      The errno value raised is 123, and the message is
      
         The filename, directory name, or volume label syntax is incorrect
      2dfc2262
  27. May 20, 2018
  28. Apr 06, 2018
  29. Mar 24, 2018
  30. Apr 03, 2018
  31. Apr 04, 2018
  32. Mar 14, 2018
    • Gregory Szorc's avatar
      wireproto: nominally don't expose "batch" to version 2 wire transports · cd0ca979
      Gregory Szorc authored
      The unified frame-based protocol will (eventually) support
      multiple requests per client transmission. This means that the
      [very hacky] "batch" command has no purpose existing in this protocol.
      
      This commit marks the command as applying to v1 transports only.
      
      But because SSHv2 == SSHv1 currently, we had to hack it back in
      for the SSHv2 transport. Bleh.
      
      Tests changed because the capabilities string changed. The order of
      tokens in the string is not important.
      
      Differential Revision: https://phab.mercurial-scm.org/D2856
      cd0ca979
  33. Jan 18, 2018
    • Boris Feld's avatar
      revbranchcache: advertise and use 'rbc' exchange capability · 2090044a
      Boris Feld authored
      The feature is now advertised and use.
      
      Updating the branchmap cache can be very expensive (up to minutes on large
      repository) and fetching revision branch data is about 80% of that. Exchanging
      the rev branch cache over the wire really help to recover from branch map
      invalidation.
      
      (There is a good chance other in flight chance would conflict on
      test-http-bad-server.t and other. So here is a small note to help update that
      test again: capabilities=19bytes, part-107bytes)
      2090044a
  34. Feb 27, 2018
    • Gregory Szorc's avatar
      wireproto: don't expose changegroupsubset capability if not available · e8995997
      Gregory Szorc authored
      We just marked the changegroupsubset command as only available to
      version 1 of the wire transports. There is a capability of the same
      name of the command that indicates if the command is supported.
      
      This commit teaches the capabilities code to conditionally emit that
      capability depending on whether the command is available for the
      current transport.
      
      Most test output is reordering of capabilities. But the limited tests
      for version 2 of the SSH protocol do show the capability disappearing.
      
      Differential Revision: https://phab.mercurial-scm.org/D2486
      e8995997
  35. Feb 13, 2018
    • Gregory Szorc's avatar
      tests: test using both versions of SSH protocol · 1ee1a42b
      Gregory Szorc authored
      Now that the version 2 of the SSH protocol is usable in core, we
      can start actively testing it more widely outside of low-level
      protocol tests.
      
      We add #testcases variants to a handful of tests so we exercise both
      version 1 and version 2 of the SSH protocol when testing. This will
      allow us to more easily find regressions and variances as protocol 2
      is developed. It will also make it easier to continue testing with
      protocol version 1 once version 2 is enabled by default.
      
      There are a handful of tests using ssh:// that should also gain test
      variances. One - test-push-race.t - already has a #testcases. This
      would require combinatorial cases. I didn't want to go down that
      rabbit hole, so that test is unchanged. Thinking aloud, there is
      probably an opportunity to automatically run tests with multiple
      server/protocol implementations. Ideally any test that performed
      server interaction would run with all supported server implementations
      and protocols so we could find variances between servers and protocols.
      But this has been a long-standing issue with our test harness. I
      don't think it is an easily solved problem. But it would be nice...
      
      Differential Revision: https://phab.mercurial-scm.org/D2206
      1ee1a42b
  36. Jan 22, 2018
    • Gregory Szorc's avatar
      bundle2: always advertise client support for stream parts · 1d118f9f
      Gregory Szorc authored
      Previously, enabling of stream clone over bundle2 was a server-side
      only change. And clients would only advertise bundle2 support for
      stream clones if an experimental config option was set.
      
      This situation wasn't forward compatible because in the future
      (when the feature is enabled on servers by default), an old client
      would send a request to the server but it wouldn't send its own
      bundle2 capability support for stream parts. Servers would have to
      infer that clients not sending this capability were old Mercurial
      clients that only sent the capability if the feature was
      explicitly enabled. Implicit and inferred behavior makes implementing
      servers hard. It's much better to be explicit about client features.
      
      We should either make the config option for bundle2 stream clones
      disable the feature client-side as well (so a server doesn't see
      a request from a client not advertising stream support). Or we
      should always advertise stream support if a client is willing
      to accept stream parts.
      
      Since I anticipating stabilizing stream clone support in bundle2
      quickly, I think it's safe to always advertise client support
      in the bundle2 capabilities. So this commit changes things to
      do that.
      
      Because capabilities now vary between client and server, we had
      to create variations of the variable substitutions for those
      strings.
      
      Differential Revision: https://phab.mercurial-scm.org/D1931
      1d118f9f
Loading