1. 20 May, 2015 2 commits
  2. 22 May, 2015 1 commit
    • Pierre-Yves David's avatar
      sshpeer: introduce a "doublepipe" class · 3dd3ccf7b807
      Pierre-Yves David authored
      This class is responsible for ensuring we still process the server output
      streamed through the ssh's 'stderr' pipe during the initial wait for other
      protocol streams.
      
      It currently only works on posix system because of its use of 'select.select'.
      3dd3ccf7b807
  3. 20 May, 2015 1 commit
    • Pierre-Yves David's avatar
      util: add a simple poll utility · c2ec81891502
      Pierre-Yves David authored
      We'll use it to detect when a sshpeer have server output to be displayed.
      
      The implementation is super basic because all case support is not the focus of
      this series.
      c2ec81891502
  4. 03 Jun, 2015 4 commits
    • Laurent Charignon's avatar
      crecord: fix blue artifact bug coming back from help screen · 6e62a5b3442d
      Laurent Charignon authored
      Before this patch, with record's curses interface:
      - When one pressed the ? key to see the help menu and then leaves the help menu
      - Then, blue artifacts would remain on the screen
      
      This patch forces a screen clear / refresh after coming back from the help menu.
      Since we don't have UI test for crecord I checked on my machine that the bug
      does not reproduce.
      6e62a5b3442d
    • Matt Harbison's avatar
      scmutil: consistently return subrepos relative to ctx1 from itersubrepos() · c0995cd8ff6f
      Matt Harbison authored
      Previously, if a subrepo was added in ctx2 and then compared to another without
      it (ctx1), the subrepo for ctx2 was returned amongst all of the ctx1 based
      subrepos, since no subrepo exists in ctx1 to replace it in the 'subpaths' dict.
      The two callers of this, basectx.status() and cmdutil.diffordiffstat(), both
      compare the yielded subrepo against ctx2, and thus saw no changes when ctx2's
      subrepo was returned.  The tests here previously didn't mention 's/a' for the
      'p1()' case.
      
      This appears to have been a known issue, because some diffordiffstat() comments
      mention that the subpath disappeared, and "the best we can do is ignore it".  I
      originally ran into the issue with some custom convert code to flatten a tree of
      subrepos causing hg.putcommit() to abort, but this new behavior seems like the
      correct status and diff behavior regardless.  (The abort in convert isn't
      something users will see, because convert doesn't currently support subrepos in
      the official repo.)
      c0995cd8ff6f
    • Matt Harbison's avatar
      context: introduce the nullsub() method · 95c271356a66
      Matt Harbison authored
      Ultimately, this will be used by scmutil.  The subrepo module already imports
      it, so it can't import the subrepo module to access the underlying method.
      95c271356a66
    • Matt Harbison's avatar
      subrepo: introduce the nullsubrepo() method · c4a92867c048
      Matt Harbison authored
      This will be used in an upcoming patch.  It's a one-off use, but seems better to
      be contained in the subrepo module, than for the next patch to overwrite the
      _ctx and _state fields in another module.  '' is used as the default revision in
      subrepo.state() if it can't be found, so it seems like a safe choice.
      c4a92867c048
  5. 07 May, 2015 3 commits
    • Yuya Nishihara's avatar
      ssl: prompt passphrase of client key file via ui.getpass() (issue4648) · 21b536f01eda
      Yuya Nishihara authored
      This is necessary to communicate with third-party tools through command-server
      channel. This requires SSLContext backported to Python 2.7.9+.
      
      It doesn't look nice to pass ui by sslkwargs, but I think it is the only way
      to do without touching various client codes including httpclient (aka http2).
      ui is mandatory if certfile is specified, so it has no default value.
      
      BTW, test-check-commit-hg.t complains that ssl_wrap_socket() has foo_bar
      naming. Should I bulk-replace it to sslwrapsocket() ?
      21b536f01eda
    • Yuya Nishihara's avatar
      https: do not inherit httplib.HTTPSConnection that creates unused SSLContext · f7ccbc2776b7
      Yuya Nishihara authored
      HTTPSConnection of Python 2.7.9 creates SSLContext in __init__, which involves
      a password prompt for decrypting the private key. This means the password was
      asked twice, one for unused SSLContext, and next for our ssl function.
      
      Because our httpsconnection replaces connect() method at all, we can simply
      drop httplib.HTTPSConnection. Instead, class and instance attributes are copied
      from it.
      
      HTTPSConnection of Python 2.7.8 and 2.6.9 seem to have no such problem.
      
      https://hg.python.org/cpython/file/v2.7.9/Lib/httplib.py#l1183
      f7ccbc2776b7
    • Yuya Nishihara's avatar
      test-https: test basic functions of client certificate authentication · 4d705f6a3c35
      Yuya Nishihara authored
      Because hgweb doesn't support client certificates, I just patched it to
      require client certificates that are signed and verified by the server
      certificate. This won't be ideal for production servers, but should be okay
      for the test.
      
      The encrypted key file will be used by future patches. I couldn't figure out
      a way to redirect a password prompt provided by OpenSSL, so it isn't tested
      for now.
      4d705f6a3c35
  6. 01 Jun, 2015 2 commits
  7. 02 Jun, 2015 1 commit
    • Jordi Gutiérrez Hermoso's avatar
      revlog: raise an exception earlier if an entry is too large (issue4675) · eee88912db0a
      Jordi Gutiérrez Hermoso authored
      Before we were relying on _pack to error out when trying to pass an
      integer that was too large for the "i" format specifier. Now we check
      this earlier so we can form a better error message.
      
      The error message unfortunately must exclude the filename at this
      level of the call stack. The problem is that this name is not
      available here, and the error can be triggered by a large manifest or
      by a large file itself. Although perhaps we could provide the name of
      a revlog index file (from the revlog object, instead of the revlogio
      object), this seems like too much leakage of internal data structures.
      It's not ideal already that an error message even mentions revlogs,
      but this does seem unavoidable here.
      eee88912db0a
  8. 03 Jun, 2015 1 commit
    • Steve Borho's avatar
      wix: move library.zip and all *.pyd into a lib/ folder · 95e042d77a5f
      Steve Borho authored
      This makes the root install folder (on Windows) nice and tidy. The
      only files left in the root folder are:
      
      hg.exe
      python27.dll
      COPYING.rtf
      ReadMe.html
      
      the last of which was probably out-of-date 7 years ago
      95e042d77a5f
  9. 20 May, 2015 1 commit
    • Pierre-Yves David's avatar
      sshpeer: run the ssh command unbuffered · c88975a4d264
      Pierre-Yves David authored
      This is necessary to use non-blocking IO base on polling. Such polling is
      needed to restore real time output with ssh peer.
      
      Changeset fce065538bcf is talking about 5x regression on Mac OS X when playing
      with this value. So we introduced our own buffering layer in previous
      changesets. This seems to keep the regression away (we are even issuing much
      less read).
      c88975a4d264
  10. 31 May, 2015 2 commits
    • Pierre-Yves David's avatar
      sshpeer: use a 'bufferedinputpipe' for standard output of the ssh process · e461230cc95b
      Pierre-Yves David authored
      We need this pipe to still be buffered when will switch to unbuffered pipe.
      (switch motivated by the need of using polling to restore real time output from
      ssh server). This is the only pipe that needs to be wrapped because this is the
      one who do extensive usage of 'readline'. The stderr pipe of the process is
      alway read in non blocking raw chunk, so it won't benefit from the
      buffering.
      e461230cc95b
    • Pierre-Yves David's avatar
      util: introduce a bufferedinputpipe utility · be930f16a52a
      Pierre-Yves David authored
      To restore real time server output through ssh, we need to using polling feature
      (like select) on the pipes used to communicate with the ssh client. However
      we cannot use select alongside python level buffering of these pipe (because we
      need to know if the buffer is non-empty before calling select).
      
      However, unbuffered performance are terrible, presumably because the 'readline'
      call is issuing 'read(1)' call until it find a '\n'. To work around that we
      introduces our own overlay that do buffering by hand, exposing the state of the
      buffer to the outside world.
      
      The usage of polling IO will be introduced later in the 'sshpeer' module. All
      its logic will be very specific to the way mercurial communicate over ssh and
      does not belong to the generic 'util' module.
      be930f16a52a
  11. 28 May, 2015 1 commit
  12. 06 Feb, 2015 1 commit
    • Pierre-Yves David's avatar
      bundle2: use bundle2 by default · ff955e7b1085
      Pierre-Yves David authored
      All the test change have been isolated and validated. We have free to turn on
      bundle2 as the default exchange protocol.
      
      "To reach a port we must set sail –
      Sail, not tie at anchor
      Sail, not drift."
      ff955e7b1085
  13. 01 Jun, 2015 1 commit
    • Pierre-Yves David's avatar
      wireprotocol: distinguish list and set in getbundle argument · 30ab130af221
      Pierre-Yves David authored
      The 'bundlecaps' argument is expected to be a set, but 'listkeys' is
      expected to be a list where ordering matters. We introduce a new 'scsv'
      argument type for the 'set' version and move 'csv' to the 'list'
      version.
      
      'test-ssh.t' is changed because this introduced an instability in the order we
      were producing listkeys parts.
      30ab130af221
  14. 26 May, 2015 1 commit
    • Gregory Szorc's avatar
      exchange: support transferring .hgtags fnodes mapping · 0c2ded041d10
      Gregory Szorc authored
      On Mozilla's mozilla-beta repository .hgtags fnodes resolution takes
      ~18s from a clean cache on my machine. This means that the first time
      a user runs `hg tags`, `hg log`, or any other command that displays or
      accesses tags data, a ~18s pause will occur. There is no output during
      this pause. This results in a poor user experience and perception
      that Mercurial is slow.
      
      The .hgtags changeset to filenode mapping is deterministic. This
      patch takes advantage of that property by implementing support
      for transferring .hgtags filenodes mappings in a dedicated bundle2
      part. When a client advertising support for the "hgtagsfnodes"
      capability requests a bundle, a mapping of changesets to .hgtags
      filenodes will be sent to the client.
      
      Only mappings of head changesets included in the bundle will be sent. The
      transfer of this mapping effectively eliminates one time tags cache related
      pauses after initial clone.
      
      The mappings are sent as binary data. So, 40 bytes per pair of
      SHA-1s. On the aforementioned mozilla-beta repository,
      659 * 40 = 26,360 raw bytes of mappings are sent over the wire
      (in addition to the bundle part headers). Assuming 18s to populate
      the cache, we only need to transfer this extra data faster than
      1.5 KB/s for overall clone + tags cache population time to be shorter.
      Put into perspective, the mozilla-beta repository is ~1 GB in size.
      So, this additional data constitutes <0.01% of the cloned data.
      The marginal overhead for a multi-second performance win on clones
      in my opinion justifies an on-by-default behavior.
      0c2ded041d10
  15. 02 Jun, 2015 1 commit
    • Gregory Szorc's avatar
      bundle2: part handler for processing .hgtags fnodes mappings · d29201352af7
      Gregory Szorc authored
      .hgtags fnodes cache entries can be expensive to compute, especially
      if there are hundreds of even thousands of them. This patch implements
      support for receiving a bundle2 part that contains a mapping of
      changeset to .hgtags fnodes.
      
      An upcoming patch will teach the server to send this part, allowing
      clients to bypass having to redundantly compute these values.
      
      A number of tests changed due to the client advertising the "hgtagsfnodes"
      capability.
      d29201352af7
  16. 03 Jun, 2015 1 commit
  17. 02 Jun, 2015 3 commits
  18. 01 Jun, 2015 6 commits
    • Matt Mackall's avatar
      merge with stable · eb52de500d2a
      Matt Mackall authored
      eb52de500d2a
    • Matt Harbison's avatar
      hgwebdir: avoid redundant repo and directory entries when 'web.name' is set · 78e8890cfb4b
      Matt Harbison authored
      Previously, when 'web.name' was set on a subrepo parent and 'web.collapse=True',
      the parent repo would show in the list with the configured 'web.name', and a
      directory with the parent repo's filesystem name (with a trailing slash) would
      also appear.  The subrepo(s) would unexpectedly be excluded from the list of
      repositories.  Clicking the directory entry would go right to the repo page.
      
      Now both the parent and the subrepos show up, without the additional directory
      entry.
      
      The configured hgweb paths used '**' for finding the repos in this scenario.
      
      
      A couple of notes about the tests:
      
      - The area where the subrepo was added has a comment that it tests subrepos,
        though none previously existed there.  One now does.
      
      - The 'web.descend' option is required for collapse to work.  I'm not sure what
        the previous expectations were for the test.  Nothing changed with it set,
        prior to adding the code in this patch.  It is however required for this test.
      
      - The only output changes are for the hyperlinks, obviously because of the
        'web.name' parameter.
      
      - Without this code change, there would be an additional diff:
      
          --- /usr/local/mercurial/tests/test-hgwebdir.t
          +++ /usr/local/mercurial/tests/test-hgwebdir.t.err
          @@ -951,7 +951,7 @@
             /rcoll/notrepo/e/
             /rcoll/notrepo/e/e2/
             /rcoll/notrepo/f/
          -  /rcoll/notrepo/f/f2/
          +  /rcoll/notrepo/f/
      
      
           Test repositories inside intermediate directories
      
      I'm not sure why the fancy name doesn't come out, but it is enough to
      demonstrate that the parent is not listed redundantly, and the subrepo isn't
      skipped.
      
      --HG--
      branch : stable
      78e8890cfb4b
    • Matt Mackall's avatar
      Added signature for changeset ed18f4acf435 · d46f6b078799
      Matt Mackall authored
      --HG--
      branch : stable
      d46f6b078799
    • Matt Mackall's avatar
      Added tag 3.4.1 for changeset ed18f4acf435 · 0a8390250125
      Matt Mackall authored
      --HG--
      branch : stable
      0a8390250125
    • Katsunori FUJIWARA's avatar
      templatekw: compare target context and its parent exactly (issue4690) · ed18f4acf435
      Katsunori FUJIWARA authored
      Before this patch, template keywords `{file_mods}`, `{file_adds}` and
      `{file_dels}` use values gotten by `repo.status(ctx.p1().node(),
      ctx.node())`.
      
      But this doesn't work as expected if `ctx` is `memctx` or
      `workingcommitctx`. Typical case of templating with these contexts is
      customization of the text shown in the commit message editor by
      `[committemplate]` configuration.
      
      In this case, `ctx.node()` returns None and it causes comparison
      between `ctx.p1()` and `workingctx`. `workingctx` lists up all changed
      files in the working directory even at selective committing.
      
      BTW, `{files}` uses `ctx.files()` and it works as expected.
      
      To compare target context and its parent exactly, this patch passes
      `ctx.p1()` and `ctx` without `node()`-nize. This avoids unexpected
      comparison with `workingctx`.
      
      This patch uses a little redundant template configurations in
      `test-commit.t`, but they are needed to avoid regression around
      problems fixed by a4958cdb2202 and 1e6fb8db666e: accessing on `ctx`
      may break `ctx._status` field.
      
      --HG--
      branch : stable
      ed18f4acf435
    • Katsunori FUJIWARA's avatar
      i18n-ja: synchronized with 8594d0b3018e · b3840fb03dba
      Katsunori FUJIWARA authored
      --HG--
      branch : stable
      b3840fb03dba
  19. 29 May, 2015 2 commits
  20. 27 May, 2015 2 commits
  21. 31 May, 2015 1 commit
    • Matt Mackall's avatar
      tests: add (?) flag for optional lines · 6025cac3d02f
      Matt Mackall authored
      When the test engine fails to match output on a line marked with (?),
      it will simply continue to the next expected line and try again. This
      allows simplifying tests that have either version-specific or
      non-fixed behavior, for instance:
      
        $ coin-flip
        heads (?)
        tails (?)
      
      (There's no form of back-tracking attempted, so optional matches
      should be specific.)
      6025cac3d02f
  22. 27 May, 2015 1 commit
  23. 26 May, 2015 1 commit