Skip to content
Snippets Groups Projects
  1. Feb 22, 2025
  2. Nov 28, 2024
  3. Dec 11, 2023
    • Pierre-Yves David's avatar
      changelog: never inline changelog · dcaa2df1f688
      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.
      dcaa2df1f688
  4. May 02, 2022
  5. Jan 24, 2022
    • Pierre-Yves David's avatar
      stream-clone: filter possible missing requirements using all supported one · 6d2ddea0721a
      Pierre-Yves David authored
      The `supportedformat` requirements is missing some important requirements and it
      seems better to filter out with all requirements we know, not just an
      "arbitrary" subset.
      
      The `supportedformat` set is lacking some important requirements (for example
      `revlog-compression-zstd`). This is getting fixed on default (for Mercurial 6.1)
      
      However, fixing that in 6.1 means the stream requirements sent over the wire
      will contains more items. And if we don't apply this fix on older version, they
      might end up complaining about lacking support for feature they actually support
      for years.
      
      This patch does not fix the deeper problem (advertised stream requirement
      lacking some of them), but focus on the trivial part : Lets use the full set of
      supported requirement for looking for unsupported ones.
      
      This patch should be simple to backport to older version of Mercurial and
      packager should be encouraged to do so.
      
      This is a graft of d9017df70135 from default.
      
      Differential Revision: https://phab.mercurial-scm.org/D12091
      6d2ddea0721a
  6. Aug 25, 2021
  7. May 20, 2021
  8. Apr 06, 2021
  9. Oct 22, 2020
  10. Feb 09, 2019
  11. Feb 05, 2019
  12. Dec 28, 2018
    • Matt Harbison's avatar
      extensions: deprecate extsetup without a `ui` argument (API) · 28a4fb793ba1
      Matt Harbison authored
      9.5 years should be enough time, but there were some tests for the old style
      still (which are now updated).  Exthelper doesn't fallback to the old API, so
      this is for consistency.
      
      .. api::
      
         The extension hook ``extsetup`` without a `ui` argument has been deprecated,
         and will be removed in the next version.  Add a `ui` argument to avoid the
         deprecation warning.
      28a4fb793ba1
  13. Nov 16, 2018
    • Matt Harbison's avatar
      subrepo: print the status line before creating the peer for better diagnostics · 69d4c8c5c25e
      Matt Harbison authored
      I ran into a problem where I tried updating to a different branch, and the
      process appeared to hang.  It turned out that the subrepo revision wasn't
      available locally, and I must have originally cloned it from an `hg serve -S` on
      a machine that currently wasn't serving anything.  It took 2+ minutes to
      timeout, and didn't mention what it was connecting to even then.
      
      There are a couple of other issues in this scenario too.
      
        - The repo is dirty after the failed checkout because the top level repo is
          updated first.  We should probably make 2 passes- top down to pull
          everything needed, and then do an update once everything is in place.
      
        - Something must be reading .hgsubstate from wdir because if the same merge
          command is run after the timeout, a prompt is issued that the local and
          remote subrepo diverged, instead of hanging.  But it lists the local version
          and remote version as having the same hash.
      69d4c8c5c25e
  14. Sep 04, 2018
  15. Apr 14, 2018
  16. Apr 12, 2018
  17. Apr 11, 2018
  18. Jan 18, 2018
    • Jörg Sonnenberger's avatar
      wireproto: support for pullbundles · aacfca6f9767
      Jörg Sonnenberger authored
      Pullbundles are similar to clonebundles, but served as normal inline
      bundle streams. They are almost transparent to the client -- the only
      visible effect is that the client might get less changes than what it
      asked for, i.e. not all requested head revisions are provided.
      
      The client announces support for the necessary retries with the
      partial-pull capability. After receiving a partial bundle, it updates
      the set of revisions shared with the server and drops all now-known
      heads from the request list. It will then rerun getbundle until
      no changes are received or all remote heads are present.
      
      Extend badserverext to support per-socket limit, i.e. don't assume that
      the same limits should be applied to all sockets.
      
      Differential Revision: https://phab.mercurial-scm.org/D1856
      aacfca6f9767
  19. Apr 04, 2018
  20. Apr 03, 2018
  21. Mar 11, 2018
  22. Mar 06, 2018
    • Gregory Szorc's avatar
      merge with stable · 7bf80d9d9543
      Gregory Szorc authored
      There were a handful of merge conflicts in the wire protocol code due
      to significant refactoring in default. When resolving the conflicts,
      I tried to produce the minimal number of changes to make the incoming
      security patches work with the new code.
      
      I will send some follow-up commits to get the security patches better
      integrated into default.
      7bf80d9d9543
  23. Feb 21, 2018
    • Gregory Szorc's avatar
      wireproto: declare operation type for most commands (BC) (SEC) · e3c228b4510d
      Gregory Szorc authored
      The permissions model of hgweb relies on a dictionary to declare
      the operation associated with each command - either "pull" or
      "push." This dictionary was established by d3147b4e3e8a in 2008.
      Unfortunately, we neglected to update this dictionary as new
      wire protocol commands were introduced.
      
      This commit defines the operations of most wire protocol commands
      in the permissions dictionary. The "batch" command is omitted because
      it is special and requires a more complex solution.
      
      Since permissions checking is skipped unless a command has an entry in
      this dictionary (this security issue will be addressed in a subsequent
      commit), the practical effect of this change is that various wire
      protocol commands now HTTP 401 if web.deny_read or web.allow-pull,
      etc are set to deny access. This is reflected by test changes. Note
      how various `hg pull` and `hg push` operations now fail before
      discovery. (They fail during the initial "capabilities" request.)
      
      This change fixes a security issue where built-in wire protocol
      commands would return repository data even if the web config were
      configured to deny access to that data.
      
      I'm on the fence as to whether we should HTTP 401 the capabilities
      request. On one hand, it can expose repository metadata and can tell
      callers things like what version of Mercurial the server is running.
      On the other hand, a client may need to know the capabilities in order
      to authenticate in a follow-up request. It appears that Mercurial
      clients handle the HTTP 401 on *any* protocol request, so we should
      be OK sending a 401 for "capabilities." But if this causes problems,
      it should be possible to allow "capabilities" to always work.
      
      .. bc::
      
         Various read-only wire protocol commands now return HTTP 401
         Unauthorized if the hgweb configuration denies read/pull access to
         the repository.
      
         Previously, various wire protocol commands would still work and
         return data if read access was disabled.
      e3c228b4510d
  24. Feb 17, 2018
  25. Dec 03, 2017
  26. Nov 05, 2017
  27. Oct 12, 2017
    • Denis Laxalde's avatar
      transaction-summary: show the range of new revisions upon pull/unbundle (BC) · eb586ed5d8ce
      Denis Laxalde authored
      Upon pull or unbundle, we display a message with the range of new revisions
      fetched. This revision range could readily be used after a pull to look out
      what's new with 'hg log'. The algorithm takes care of filtering "obsolete"
      revisions that might be present in transaction's "changes" but should not be
      displayed to the end user.
      eb586ed5d8ce
  28. Oct 05, 2017
    • Saurabh Singh's avatar
      serve: make tests compatible with chg · a6d95a8b7243
      Saurabh Singh authored
      chg only supports 'hg serve' when the options to the serve command
      follow the 'hg serve'. For example, 'hg -R <repo> serve ..' is unsupported.
      This leads to issues with chg running for the following tests:
      
       - test-bundle2-exchange.t
       - test-clone-uncompressed.t
       - test-hgweb-csp.t
       - test-http-bad-server.t
       - test-http-bundle1.t
       - test-http-protocol.t
       - test-http.t
      
      There was an effort made earlier to fix this issue for chg and the tests were
      fixed to confirm to the compatible pattern. But the new tests did not take care
      of the same and hence, fail. Hopefully, there will be continuous build setup
      for chg after all tests are made compatible with chg so that we can avoid such
      issues.
      
      Test Plan:
      Ran the aforementioned tests with and without '--chg' option.
      
      Differential Revision: https://phab.mercurial-scm.org/D946
      a6d95a8b7243
  29. Oct 01, 2017
    • Gregory Szorc's avatar
      commands: rename clone --uncompressed to --stream and document · fffd3369aa83
      Gregory Szorc authored
      --uncompressed isn't a very good name and its description in the
      help documentation isn't very useful. We refer to this concept as
      "stream clones" in a number of places. I think it makes sense to
      change the user-facing argument to use the mode --stream. So this
      commit does that.
      
      We keep --uncompressed around for backwards compatibility.
      
      While we're here, we overhaul the help docs for streaming clones
      to be somewhat useful.
      
      All tests have been updated to reflect the new preferred --stream
      argument. A test for backwards compatibility of --uncompressed has
      been added.
      
      .. bc::
      
         `hg clone --stream` should now be used instead of --uncompressed.
      
         --uncompressed is marked as deprecated and is an alias for --stream.
         There is no schedule for elimination of --uncompressed.
      
      Differential Revision: https://phab.mercurial-scm.org/D864
      fffd3369aa83
  30. May 11, 2017
  31. May 09, 2017
  32. Mar 31, 2017
  33. Mar 30, 2017
    • Pierre-Yves David's avatar
      run-tests: auto-replace 'TXNID' output · 728d37353e1e
      Pierre-Yves David authored
      Hooks related to the transaction are aware of the transaction id. By definition
      this txn-id is unique and different for each transaction. As a result it can
      never be predicted in test and always needs matching. As a result, touching any
      like with this data is annoying. We solve the problem once and for all by
      installing an automatic replacement. In test, this will now show as:
      
        TXNID=TXN:$ID$
      728d37353e1e
  34. Feb 16, 2017
    • Jun Wu's avatar
      runtests: set web.address to localhost · 161ab32b44a1
      Jun Wu authored
      Previously, "hg serve" will listen on "", which is not clear which interface
      it will actually listen on - it could listen on all interfaces (ex. 0.0.0.0
      on IPv4).
      
      The run-tests.py script only checks "localhost" for available ports. So
      let's make it the same for "hg serve" by explicitly setting "web.address" to
      "localhost".
      
      This resolves some IPv6 EADDRINUSE errors.
      161ab32b44a1
  35. Feb 10, 2017
    • Pierre-Yves David's avatar
      wireproto: properly report server Abort during 'getbundle' · f3807a135e43
      Pierre-Yves David authored
      Previously Abort raised during 'getbundle' call poorly reported (HTTP-500 for
      http, some scary messages for ssh). Abort error have been properly reported for
      "push" for a long time, there is not reason to be different for 'getbundle'. We
      properly catch such error and report them back the best way available. For
      bundle, we issue a valid bundle2 reply (as expected by the client) with an
      'error:abort' part. With bundle1 we do as best as we can depending of http or
      ssh.
      f3807a135e43
  36. Dec 24, 2016
    • Gregory Szorc's avatar
      httppeer: advertise and support application/mercurial-0.2 · a520aefb96f1
      Gregory Szorc authored
      Now that servers expose a capability indicating they support
      application/mercurial-0.2 and compression, clients can key off
      this to say they support responses that are compressed with
      various compression formats.
      
      After this commit, the HTTP wire protocol client now sends an
      "X-HgProto-<N>" request header indicating its support for
      "application/mercurial-0.2" media type and various compression
      formats.
      
      This commit also implements support for handling
      "application/mercurial-0.2" responses. It simply reads the header
      compression engine identifier then routes the remainder of the
      response to the appropriate decompressor.
      
      There were some test changes, but only to logging. That points to
      an obvious gap in our test coverage. This will be addressed in a
      subsequent commit once server support is in place (it is hard to
      test without server support).
      a520aefb96f1
  37. Oct 28, 2016
    • Katsunori FUJIWARA's avatar
      tests: invoke printenv.py via sh -c for test portability · 34a5f6c66bc5
      Katsunori FUJIWARA authored
      On Windows platform, invoking printenv.py directly via hook is
      problematic, because:
      
        - unless binding between *.py suffix and python runtime, application
          selector dialog is displayed, and running test is blocked at each
          printenv.py invocations
      
        - it isn't safe to assume binding between *.py suffix and python
          runtime, because application binding is easily broken
      
          For example, installing IDE (VisualStudio with Python Tools, or
          so) often requires binding between source files and IDE itself.
      
      This patch invokes printenv.py via sh -c for test portability. This is
      a kind of follow up for d19787db6fe0, which eliminated explicit
      "python" for printenv.py. There are already other 'sh -c "printenv.py"'
      in *.t files, and this fix should be reasonable.
      
      This changes were confirmed in cases below:
      
        - without any application binding for *.py suffix
        - with binding between *.py suffix and VisualStudio
      
      This patch also replaces "echo + redirection" style with "heredoc"
      style, because:
      
        - hook command line is parsed by cmd.exe as shell at first, and
        - single quotation can't quote arguments on cmd.exe, therefore,
        - "printenv.py foobar" should be quoted by double quotation, but
        - nested quoting (or tricky escaping) isn't readable
      34a5f6c66bc5
Loading