Skip to content
Snippets Groups Projects
  1. Sep 11, 2019
  2. 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
  3. Feb 09, 2019
  4. Nov 12, 2018
  5. 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
  6. 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
  7. Sep 26, 2018
  8. 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
  9. Sep 26, 2018
  10. Sep 25, 2018
  11. 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
  12. Sep 19, 2018
  13. Sep 04, 2018
  14. May 28, 2018
    • Matt Harbison's avatar
      outgoing: pay attention to `default:pushurl` for bookmarks and subrepos · dfb888aa
      Matt Harbison authored
      The problem here was that `default:pushurl` and `default` get translated to a
      single entry in `ui.paths` named 'default', with an attribute for 'pushloc',
      'loc', and 'rawloc'.  ui.expandpath() then always takes the `rawloc` attribute.
      Maybe the ui.expandpath() API is busted and should be removed?  Or maybe
      getpath() should return a copy that adds an attribute reflecting the URL of the
      path chosen?
      
      I thought that I could remove the code in hg._outgoing() and pass the location
      resolved in commands.py as `dest`, but unfortunately that code is needed there
      to resolve #branch type URLs.  Maybe that should be pulled up to commands.py,
      because I can't see any reasonable behavior for a subrepo path that's
      constructed out of that type of URL.
      
      The push command already resolves this early, so that works properly.  But it
      looks like bundle, histedit, largefiles, patchbomb, and summary use a similar
      pattern, so they are likely similarly affected.
      dfb888aa
  15. May 20, 2018
  16. Mar 25, 2018
  17. Apr 23, 2018
    • Boris Feld's avatar
      sshpeer: reflect actual command activity one handshake · 58bbd14b
      Boris Feld authored
      The output from devel-peer-request is expected to give data about request and
      roundtrip done to the server. Changeset a9cffd14aa04 changed some of that by
      grouping hello and between commands call. However, the old sequence of command
      was "emulated" in sshpeer.
      
      Update the sshpeer to reflect this grouping of commands and update the tests
      that use it.
      58bbd14b
  18. Apr 06, 2018
  19. Mar 24, 2018
  20. Apr 03, 2018
  21. Apr 04, 2018
  22. 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
  23. 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
  24. Mar 05, 2018
  25. 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
  26. 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
  27. 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
  28. Jan 12, 2018
  29. Dec 16, 2017
  30. Dec 14, 2017
    • Kostia Balytskyi's avatar
      sshpeer: allow for additional environment passing to ssh exe · 31d21309
      Kostia Balytskyi authored
      We already have the ability to customize the ssh command line arguments, let's
      add the ability to customize its environment as well.
      
      Example use-case is ssh.exe from Git on Windows. If `HOME` enviroment variable
      is present and has some non-empty value, ssh.exe will try to access that
      location for some stuff (for example, it seems for resolving `~` in
      `.ssh/config`). Git for Windows seems to sometimess set this variable to the
      value of `/home/username` which probably works under Git Bash, but does not
      work in a native `cmd.exe` or `powershell`. Whatever the root cause, setting
      `HOME` to be an empty string heals things. Therefore, some distributors
      might want to set `sshenv.HOME=` in the configuration (seems less intrusive
      that forcing everyone to tweak their env).
      
      Test Plan:
      - rt
      
      Differential Revision: https://phab.mercurial-scm.org/D1683
      31d21309
  31. Dec 11, 2017
    • Matt Harbison's avatar
      tests: remove (glob) annotations that were only for '\' matches · 4441705b
      Matt Harbison authored
      # skip-blame because this was mechanically rewritten the following script.  I
      ran it on both *.t and *.py, but none of the *.py changes were proper.  All *.t
      ones appear to be, and they run without addition failures on both Windows and
      Linux.
      
        import argparse
        import os
        import re
      
        ap = argparse.ArgumentParser()
        ap.add_argument('path', nargs='+')
        opts = ap.parse_args()
      
        globre = re.compile(r'^(.*) \(glob\)(.*)$')
      
        for p in opts.path:
            tmp = p + '.tmp'
            with open(p, 'rb') as src, open(tmp, 'wb') as dst:
                for line in src:
                    m = globre.match(line)
                    if not m or '$LOCALIP' in line or '*' in line:
                        dst.write(line)
                        continue
                    if '?' in line[:-3] or ('?' in line[:-3] and line[-3:] != '(?)'):
                        dst.write(line)
                        continue
                    dst.write(m.group(1) + m.group(2) + '\n')
            os.unlink(p)
            os.rename(tmp, p)
      4441705b
  32. Oct 17, 2017
    • Boris Feld's avatar
      pull: retrieve bookmarks through the binary part when possible · 44b8b5ad
      Boris Feld authored
      This makes pull consistent with the part used by push and provide us with a
      more compact representation of bookmarks.
      
      In addition, this opens the way for smarter bookmark exchanges (e.g. filtering
      by names or only sending the bookmark relevant to the pulled set, etc).
      44b8b5ad
  33. Nov 13, 2017
    • Boris Feld's avatar
      push: include a 'check:bookmarks' part when possible · ad5f2b92
      Boris Feld authored
      Before updating the actual bookmark update, we can start with updating the way
      we check for push race. Checking bookmarks state earlier is useful even if we
      still use pushkey. Aborting before the changegroup is added can save a lot of
      time.
      ad5f2b92
  34. Nov 26, 2017
  35. Nov 20, 2017
  36. Nov 05, 2017
  37. Oct 12, 2017
    • Denis Laxalde's avatar
      transaction-summary: show the range of new revisions upon pull/unbundle (BC) · eb586ed5
      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.
      eb586ed5
Loading