Skip to content
Snippets Groups Projects
  1. Jun 30, 2016
    • Gregory Szorc's avatar
      tests: test case where default ca certs not available · afbe1fe4c44e
      Gregory Szorc authored
      I'm not a fan of TLS tests not testing both branches of a possible
      configuration. While we have test coverage of the inability to validate
      a cert later in this file, I insist that we add this branch so
      our testing of security code is extra comprehensive.
      afbe1fe4c44e
    • Gregory Szorc's avatar
      sslutil: don't load default certificates when they aren't relevant · 13edc11eb7b7
      Gregory Szorc authored
      Before, we would call SSLContext.load_default_certs() when
      certificate verification wasn't being used. Since
      SSLContext.verify_mode == ssl.CERT_NONE, this would ideally
      no-op. However, there is a slim chance the loading of system
      certs could cause a failure. Furthermore, this behavior
      interfered with a future patch that aims to provide a more
      helpful error message when we're unable to load CAs.
      
      The lack of test fallout is hopefully a sign that our
      security code and tests are in a relatively good state.
      13edc11eb7b7
    • Gregory Szorc's avatar
      sslutil: display a better error message when CA file loading fails · 2f7f1e10f840
      Gregory Szorc authored
      Before, sslcontext.load_verify_locations() would raise a
      ssl.SSLError which would be caught further up the stack and converted
      to a urlerror. By that time, we lost track of what actually errored.
      
      Trapping the error here gives users a slightly more actionable error
      message.
      
      The behavior between Python <2.7.9 and Python 2.7.9+ differs. This
      is because our fake SSLContext class installed on <2.7.9 doesn't
      actually do anything during load_verify_locations: it defers actions
      until wrap_socket() time. Unfortunately, a number of errors can occur
      at wrap_socket() time and we're unable to ascertain what the root
      cause is. But that shouldn't stop us from providing better error
      messages to people running a modern and secure Python version.
      2f7f1e10f840
    • Gregory Szorc's avatar
      tests: add test for empty CA certs file · 072e4a595607
      Gregory Szorc authored
      smf reported that an environment with no loaded CA certs resulted
      in a weird error. I'd like to detect this a bit better so we can
      display an actionable error message.
      
      The actual error being globbed over in this patch is "unknown error"
      with a ssl.c line number. That isn't useful at all.
      072e4a595607
  2. Jun 06, 2016
  3. Jun 24, 2016
    • Martijn Pieters's avatar
      journal: new experimental extension · cf092a3d202a
      Martijn Pieters authored
      Records bookmark locations and shows you where bookmarks were located in the
      past.
      
      This is the first in a planned series of locations to be recorded; a future
      patch will add working copy (dirstate) tracking, and remote bookmarks will be
      supported as well, so the journal storage format should be fairly generic to
      support those use-cases.
      cf092a3d202a
  4. Jun 27, 2016
  5. Jun 28, 2016
  6. Jun 29, 2016
  7. Jun 27, 2016
  8. Jun 24, 2016
    • Jun Wu's avatar
      chg: send SIGPIPE to server immediately when pager exits (issue5278) · cf99de051385
      Jun Wu authored
      If the user press 'q' to leave the 'less' pager, it is expected to end the
      hg process immediately. We currently rely on SIGPIPE for this behavior. But
      SIGPIPE won't arrive if we don't write anything (like doing heavy
      computation, reading from network etc). If that happens, the user will feel
      that the hg process just hangs.
      
      The patch address the issue by adding a SIGCHLD signal handler and sends
      SIGPIPE to the server as soon as the pager exits.
      
      This is also an issue with hg's pager implementation.
      cf99de051385
    • Jun Wu's avatar
      chgserver: do not ignore SIGPIPE if pager is used · 247ea0dfdb94
      Jun Wu authored
      We rely on SIGPIPE to exit when the pager exits. And Python ignores SIGPIPE
      by default. Explicitly set SIGPIPE handler to SIG_DFL (terminate) just like
      pager.py.
      247ea0dfdb94
    • Martin von Zweigbergk's avatar
      debug: make debug{revlog,index,data} --dir not just a flag · 33a6b750b5b9
      Martin von Zweigbergk authored
      The directory argument (for tree manifests) should belong to to the
      --dir argument. I had mistakenly made --dir a flag. One effect of this
      was that I had meant for "-m" to be optional, but instead it changed
      the behavior of --dir, so with "hg debugdata -m --dir dir1 0", the -m
      took over and the "dir1" got treated as a revision in the root
      manifest log.
      33a6b750b5b9
    • Martin von Zweigbergk's avatar
      debugdata: disallow trailing option with -c/-m · 26ac04a39e11
      Martin von Zweigbergk authored
      Before this change, "hg debugdata -c 0 foo" was allowed.
      26ac04a39e11
  9. Jun 26, 2016
  10. Jun 24, 2016
  11. Mar 13, 2016
  12. Jun 27, 2016
    • Henrik Stuart's avatar
      patch: allow copy information to be passed in · 40d53d4b5925
      Henrik Stuart authored
      When displaying patches from graphical tools where you can browse through
      individual files, with diff being called separately on each, recomputing the
      limits of file copy history can become rather expensive on large repositories.
      Instead, we can compute it once and pass it in for subsequent calls.
      40d53d4b5925
  13. Jun 23, 2016
    • liscju's avatar
      largefiles: check file in the repo store before checking remotely (issue5257) · ecbbf4d56ee8
      liscju authored
      Problem was files to check were gathered in the repository where
      the verify was launched but verification was done on the remote
      store. It was observed when user committed in cloned repository
      and ran verify before pushing - committed files were marked
      as non existing.
      
      This commit fixes this by checking in the remote store only files
      that are not existing in the repository store where verify was launched.
      
      Solution is similiar to fd288d118074
      ecbbf4d56ee8
  14. Jun 27, 2016
  15. Jun 24, 2016
    • liscju's avatar
      largefiles: fix misleading comments in lfutil instore and storepath · 01c0324acfec
      liscju authored
      Problem in both cases is cache in largefiles has assigned
      meaning - user cache which is additional place to get/put
      files. Those two function works on store - the main place
      to store largefiles in the repository - .hg/largefiles and
      using "cache" to describe it is misleading.
      01c0324acfec
  16. Jun 26, 2016
    • Gregory Szorc's avatar
      revset: implement match() in terms of matchany() · bcefb25acf52
      Gregory Szorc authored
      match() is the special case of a single element list being passed
      to matchany() with the additional error checking that the revset
      spec is defined. Change the implementation to remove the redundant
      code and have match() call matchany().
      bcefb25acf52
    • Gregory Szorc's avatar
      scmutil: improve documentation of revset APIs · 526b027b0130
      Gregory Szorc authored
      I can never remember the differences between the various revset
      APIs. I can never remember that scmutil.revrange() is the one I
      want to use from user-facing commands.
      
      Add some documentation to clarify this.
      
      While we're here, the argument name for revrange() is changed to
      "specs" because that's what it actually is.
      526b027b0130
  17. Jun 25, 2016
  18. Jun 26, 2016
    • Gregory Szorc's avatar
      i18n: use unicode literal · 47fb4beb992b
      Gregory Szorc authored
      Other parts of this expression are already using unicode literals.
      We need this to make Python 3 happy and to avoid an implicit
      conversion in Python 2.
      47fb4beb992b
    • Gregory Szorc's avatar
      pycompat: add HTTPPasswordMgrWithDefaultRealm to Python 3 block · 2646fbba4ca7
      Gregory Szorc authored
      Looks like we missed this in 800ec7c048b0.
      2646fbba4ca7
    • Gregory Szorc's avatar
      ui: path option to declare which revisions to push by default · 31d3ab7985b8
      Gregory Szorc authored
      Now that we have a mechanism for declaring path sub-options, we can
      start to pile on features!
      
      Many power users have expressed frustration that bare `hg push`
      attempts to push all local revisions to the remote. This patch
      introduces the "pushrev" path sub-option to control which revisions
      are pushed when no "-r" argument is specified.
      
      The value of this sub-option is a revset, naturally.
      
      A future feature addition could potentially introduce a "pushnames"
      sub-options that declares the list of names (branches, bookmarks,
      topics, etc) to push by default. The entire "what to push by default"
      feature should probably be considered before this patch lands.
      31d3ab7985b8
    • Gregory Szorc's avatar
      ui: don't fixup [paths] sub-options · b62bce819d0c
      Gregory Szorc authored
      As part of developing a subsequent patch I discovered that sub-option
      values like "." were getting converted to paths. This is because the
      [paths] section is treated specially during config loading.
      
      This patch prevents post-processing sub-options from the [paths]
      section.
      b62bce819d0c
  19. Jun 25, 2016
    • Gregory Szorc's avatar
      sslutil: abort when unable to verify peer connection (BC) · e1778b9c8d53
      Gregory Szorc authored
      Previously, when we connected to a server and were unable to verify
      its certificate against a trusted certificate authority we would
      issue a warning and continue to connect. This is obviously not
      great behavior because the x509 certificate model is based upon
      trust of specific CAs. Failure to enforce that trust erodes security.
      This behavior was defined several years ago when Python did not
      support loading the system trusted CA store (Python 2.7.9's
      backports of Python 3's improvements to the "ssl" module enabled
      this).
      
      This commit changes behavior when connecting to abort if the peer
      certificate can't be validated. With an empty/default Mercurial
      configuration, the peer certificate can be validated if Python is
      able to load the system trusted CA store. Environments able to load
      the system trusted CA store include:
      
      * Python 2.7.9+ on most platforms and installations
      * Python 2.7 distributions with a modern ssl module (e.g. RHEL7's
        patched 2.7.5 package)
      * Python shipped on OS X
      
      Environments unable to load the system trusted CA store include:
      
      * Python 2.6
      * Python 2.7 on many existing Linux installs (because they don't
        ship 2.7.9+ or haven't backported modern ssl module)
      * Python 2.7.9+ on some installs where Python is unable to locate
        the system CA store (this is hopefully rare)
      
      Users of these Pythongs will need to configure Mercurial to load the
      system CA store using web.cacerts. This should ideally be performed
      by packagers (by setting web.cacerts in the global/system hgrc file).
      Where Mercurial packagers aren't setting this, the linked URL in the
      new abort message can contain instructions for users.
      
      In the future, we may want to add more code for finding the system
      CA store. For example, many Linux distributions have the CA store
      at well-known locations (such as /etc/ssl/certs/ca-certificates.crt
      in the case of Ubuntu). This will enable CA loading to "just work"
      on more Python configurations and will be best for our users since
      they won't have to change anything after upgrading to a Mercurial
      with this patch.
      
      We may also want to consider distributing a trusted CA store with
      Mercurial. Although we should think long and hard about that because
      most systems have a global CA store and Mercurial should almost
      certainly use the same store used by everything else on the system.
      e1778b9c8d53
    • Gregory Szorc's avatar
      sslutil: remove out of place comment · 222f6834c69a
      Gregory Szorc authored
      This comment likely got orphaned as a result of refactoring in this
      file. It isn't providing any useful value. So delete it.
      222f6834c69a
  20. Jun 24, 2016
Loading