Skip to content
Snippets Groups Projects
  1. Jun 10, 2016
  2. Jun 08, 2016
    • Martijn Pieters's avatar
      graphmod: avoid sorting when already sorted · 63161726
      Martijn Pieters authored
      This is somewhat redundant now, but allows us to add a toposort that should not
      be re-sorted either.
      63161726
    • Gregory Szorc's avatar
      sslutil: per-host config option to define certificates · ecc9b788
      Gregory Szorc authored
      Recent work has introduced the [hostsecurity] config section for
      defining per-host security settings. This patch builds on top
      of this foundation and implements the ability to define a per-host
      path to a file containing certificates used for verifying the server
      certificate. It is logically a per-host web.cacerts setting.
      
      This patch also introduces a warning when both per-host
      certificates and fingerprints are defined. These are mutually
      exclusive for host verification and I think the user should be
      alerted when security settings are ambiguous because, well,
      security is important.
      
      Tests validating the new behavior have been added.
      
      I decided against putting "ca" in the option name because a
      non-CA certificate can be specified and used to validate the server
      certificate (commonly this will be the exact public certificate
      used by the server). It's worth noting that the underlying
      Python API used is load_verify_locations(cafile=X) and it calls
      into OpenSSL's SSL_CTX_load_verify_locations(). Even OpenSSL's
      documentation seems to omit that the file can contain a non-CA
      certificate if it matches the server's certificate exactly. I
      thought a CA certificate was a special kind of x509 certificate.
      Perhaps I'm wrong and any x509 certificate can be used as a
      CA certificate [as far as OpenSSL is concerned]. In any case,
      I thought it best to drop "ca" from the name because this reflects
      reality.
      ecc9b788
  3. May 27, 2016
  4. May 31, 2016
  5. Jun 09, 2016
  6. Jun 07, 2016
  7. Jun 01, 2016
  8. Jun 04, 2016
    • Pulkit Goyal's avatar
      py3: conditionalize cPickle import by adding in util · b5015791
      Pulkit Goyal authored
      The cPickle is renamed to _pickle in python3 and this C extension is available
       in pickle which was not included in earlier versions. So imports are conditionalized
       to import cPickle in py2 and pickle in py3. Moreover the use of pickle in py2 is
       switched to cPickle as the C extension is faster. The hack is added in util.py and
      the modules import util.pickle
      b5015791
  9. Jun 02, 2016
    • Matt Mackall's avatar
      bdiff: remove effectively dead code · d29cb5e7
      Matt Mackall authored
      Now that we extend matches backwards in the inner loop, the final
      adjustment has no effect.
      
      (A similar extension for the forward direction is trickier and has
      less benefit.)
      d29cb5e7
    • Matt Mackall's avatar
      bdiff: extend matches across popular lines · 66dbdd3c
      Matt Mackall authored
      For very large diffs that have large numbers of identical lines (JSON
      dumps) that also have large blocks of identical text, bdiff could become
      confused about which block matches which because it can only match
      very limited regions. The result is very large diffs for small sets of edits.
      
      The earlier recursion rebalancing fix made this behavior more frequent because
      it's now more prone to match block 1 to block 2. One frequent user of
      large JSON files reported being unable to pass the resulting diffs
      through their code review system.
      
      Prior to this change, bdiff would calculate the length of a match at
      (i, j) as 1 + length found at (i-1, j-1). With large number of popular
      (ignored) lines, this often meant matches couldn't be extended
      backwards at all and thus all matching regions were very small.
      Disabling the popularity threshold is not an option because it brings
      back quadratic behavior.
      
      Instead, we extend a match backwards until we either found a previously
      discovered match or we find a mismatching line. This thus successfully
      bridges over any popular lines inside and before a matching region.
      The larger regions then significant reduce the probability of confusion.
      66dbdd3c
  10. Jun 03, 2016
    • Yuya Nishihara's avatar
      test-revset: fix test vector for ordering issue of matching() · de4a80a2
      Yuya Nishihara authored
      592e0beee8b0 fixed matching() to preserve the order of the input set, but
      the test was incorrect. Given "A and B", "A" should be the input set to "B".
      But thanks to our optimizer, the test expression was rewritten as
      "(2 or 3 or 1) and matching(1 or 2 or 3)", therefore it was working well.
      
      Since I'm going to fix the overall ordering issue, the test needs to be
      adjusted to do the right thing.
      de4a80a2
  11. May 19, 2016
  12. May 12, 2016
  13. May 10, 2016
  14. May 07, 2016
  15. May 06, 2016
  16. Jun 04, 2016
  17. Jun 02, 2016
    • Kostia Balytskyi's avatar
      revset: make filteredset.__nonzero__ respect the order of the filteredset · 5e32852f
      Kostia Balytskyi authored
      This fix allows __nonzero__ to respect the direction of iteration of the
      whole filteredset. Here's the case when it matters. Imagine that we have a
      very large repository and we want to execute a command like:
      
          $ hg log --rev '(tip:0) and user(ikostia)' --limit 1
      
      (we want to get the latest commit by me).
      
      Mercurial will evaluate a filteredset lazy data structure, an
      instance of the filteredset class, which will know that it has to iterate
      in a descending order (isdescending() will return True if called). This
      means that when some code iterates over the instance of this filteredset,
      the 'and user(ikostia)' condition will be first checked on the latest
      revision, then on the second latest and so on, allowing Mercurial to
      print matches as it founds them. However, cmdutil.getgraphlogrevs
      contains the following code:
      
          revs = _logrevs(repo, opts)
          if not revs:
              return revset.baseset(), None, None
      
      The "not revs" expression is evaluated by calling filteredset.__nonzero__,
      which in its current implementation will try to iterate the filteredset
      in ascending order until it finds a revision that matches the 'and user(..'
      condition. If the condition is only true on late revisions, a lot of
      useless iterations will be done. These iterations could be avoided if
      __nonzero__ followed the order of the filteredset, which in my opinion
      is a sensible thing to do here.
      
      The problem gets even worse when instead of 'user(ikostia)' some more
      expensive check is performed, like grepping the commit diff.
      
      
      I tested this fix on a very large repo where tip is my commit and my very
      first commit comes fairly late in the revision history. Results of timing
      of the above command on that very large repo.
      
      -with my fix:
      real    0m1.795s
      user    0m1.657s
      sys     0m0.135s
      
      -without my fix:
      real    1m29.245s
      user    1m28.223s
      sys     0m0.929s
      
      I understand that this is a very specific kind of problem that presents
      itself very rarely, only on very big repositories and with expensive
      checks and so on. But I don't see any disadvantages to this kind of fix
      either.
      5e32852f
    • Katsunori FUJIWARA's avatar
      phases: make writing phaseroots file out avoid ambiguity of file stat · 3a2357c3
      Katsunori FUJIWARA authored
      Cached attribute repo._phasecache uses stat of '.hg/phaseroots' file
      to examine validity of cached contents. If writing '.hg/phaseroots'
      file out keeps ctime, mtime and size of it, change is overlooked, and
      old contents cached before change isn't invalidated as expected.
      
      To avoid ambiguity of file stat, this patch writes '.hg/phaseroots'
      file out with checkambig=True.
      
      This patch is a part of "Exact Cache Validation Plan":
      
          https://www.mercurial-scm.org/wiki/ExactCacheValidationPlan
      3a2357c3
    • Katsunori FUJIWARA's avatar
      dirstate: make writing branch file out avoid ambiguity of file stat · 083e107a
      Katsunori FUJIWARA authored
      Cached attribute dirstate._branch uses stat of '.hg/branch' file to
      examine validity of cached contents. If writing '.hg/branch' file out
      keeps ctime, mtime and size of it, change is overlooked, and old
      contents cached before change isn't invalidated as expected.
      
      To avoid ambiguity of file stat, this patch writes '.hg/branch' file
      out with checkambig=True.
      
      This patch is a part of "Exact Cache Validation Plan":
      
          https://www.mercurial-scm.org/wiki/ExactCacheValidationPlan
      083e107a
    • Katsunori FUJIWARA's avatar
      dirstate: make writing dirstate file out avoid ambiguity of file stat · 28f37ffc
      Katsunori FUJIWARA authored
      Cached attribute repo.dirstate uses stat of '.hg/dirstate' file to
      examine validity of cached contents. If writing '.hg/dirstate' file
      out keeps ctime, mtime and size of it, change is overlooked, and old
      contents cached before change isn't invalidated as expected.
      
      To avoid ambiguity of file stat, this patch writes '.hg/dirstate' file
      out with checkambig=True.
      
      The former diff hunk changes the code path for "dirstate.write()", and
      the latter changes the code path for "dirstate.savebackup()".
      
      This patch is a part of "Exact Cache Validation Plan":
      
          https://www.mercurial-scm.org/wiki/ExactCacheValidationPlan
      28f37ffc
    • Katsunori FUJIWARA's avatar
      bookmarks: make writing files out avoid ambiguity of file stat · f92afd23
      Katsunori FUJIWARA authored
      Cached attribute repo._bookmarks uses stat of '.hg/bookmarks' and
      '.hg/bookmarks.current' files to examine validity of cached
      contents. If writing these files out keeps ctime, mtime and size of
      them, change is overlooked, and old contents cached before change
      isn't invalidated as expected.
      
      To avoid ambiguity of file stat, this patch writes '.hg/bookmarks' and
      '.hg/bookmarks.current' files out with checkambig=True.
      
      This patch is a part of "Exact Cache Validation Plan":
      
          https://www.mercurial-scm.org/wiki/ExactCacheValidationPlan
      f92afd23
    • Katsunori FUJIWARA's avatar
      transaction: avoid ambiguity of file stat at closing transaction · 76b07a5c
      Katsunori FUJIWARA authored
      Files below, which might be changed at closing transaction, are used
      to examine validity of cached properties. If changing keeps ctime,
      mtime and size of a file, change is overlooked, and old contents
      cached before change isn't invalidated as expected.
      
        - .hg/bookmarks
        - .hg/dirstate
        - .hg/phaseroots
      
      To avoid ambiguity of file stat, this patch writes files out with
      checkambig=True at closing transaction.
      
      checkambig becomes True only at closing (= 'not suffix'), because stat
      information of '.pending' file isn't used to examine validity of
      cached properties.
      
      This patch is a part of "Exact Cache Validation Plan":
      
          https://www.mercurial-scm.org/wiki/ExactCacheValidationPlan
      76b07a5c
    • Katsunori FUJIWARA's avatar
      util: add __ne__ to filestat class for consistency · 82f6193f
      Katsunori FUJIWARA authored
      This is follow up for ca4065028e00, which introduced filestat class.
      82f6193f
  18. Apr 16, 2016
Loading