Skip to content
Snippets Groups Projects
  1. Feb 16, 2017
    • Jun Wu's avatar
      dummyssh: use LOCALIP · bfdb0741
      Jun Wu authored
      This patch replaces hard-coded 127.0.0.1 with $LOCALIP in dummyssh.
      bfdb0741
    • Jun Wu's avatar
      runtests: export LOCALIP · d4916aeb
      Jun Wu authored
      Previously, tests hard-code local IP address as "127.0.0.1". That won't work
      for IPv6.
      
      This patch exports the $LOCALIP environment variable, which is set to "::1"
      if we decide to use IPv6.
      d4916aeb
    • Jun Wu's avatar
      tinyproxy: use IPv6 if HGIPV6 is set to 1 · d8d698bc
      Jun Wu authored
      This patch makes tinyproxy.py work in IPv6 mode if HGIPV6 is set to 1.
      
      This will make test-http-proxy.t pass on IPv6 machines.
      d8d698bc
    • Jun Wu's avatar
      dumbhttp: use IPv6 if HGIPV6 is set to 1 · d05fefbb
      Jun Wu authored
      This will fix flaky tests using dumbhttp.
      
      The patch was tested on gcc112.fsffrance.org using the following command:
      
        ./run-tests.py -j 40 --runs-per-test 120 test-bundle2-remote-changegroup.t
      d05fefbb
    • Jun Wu's avatar
      runtests: export HGIPV6 to hint test scripts whether to use IPv6 · 225f574e
      Jun Wu authored
      Previously, run-tests.py only exports HGPORT, and scripts in tests do not
      know if IPv6 should be used. And that breaks scripts like dumbhttp.py which
      always uses IPv4.
      
      This patch makes run-tests.py export HGIPV6, which can help test scripts
      like dumbhttp.py and tinyproxy.py to decide whether to use IPv6 or not.
      225f574e
  2. Feb 17, 2017
    • Jun Wu's avatar
      runtests: prefer IPv4 to IPv6 · a489ee9b
      Jun Wu authored
      To make IPv6 work, there are multiple areas that need to fix. Before they
      all get fixed, use IPv4 by default.
      
      This should fix tests caused on IPv6 systems.
      a489ee9b
    • Rainer Woitok's avatar
      doc: correct example concerning "hg purge" alias in man page "hgrc.5" · e7eca6e1
      Rainer Woitok authored
      The "hg purge" alias as currently described in "hgrc.5" issues a possibly
      confusing error message like
      
         rm: missing operand
         Try 'rm --help' for more information.
      
      if no files are to be purged at all.
      
      This patch slightly modifies the example by adding a "-f" option to the
      "rm" command.
      e7eca6e1
  3. Feb 07, 2017
  4. Feb 15, 2017
    • Augie Fackler's avatar
      ui: introduce neverpager() call · 3ed6e439
      Augie Fackler authored
      I'm about to add direct paging support to some commands, and as a
      result we need a way to communicate from the higher layers of dispatch
      that paging is explicitly disabled.
      3ed6e439
    • Augie Fackler's avatar
      pager: move more behavior into core · 9c2977ce
      Augie Fackler authored
      This moves the global flag and the --pager=yes logic into core. Only
      functionality change is that users now always get a --pager flag and
      can enable the pager via the flag without the extension active.
      
      Moving the flag into core exposes a defect in the ro localization,
      which will have to be corrected later.
      9c2977ce
    • Augie Fackler's avatar
      pager: move pager-initiating code into core · 61b41220
      Augie Fackler authored
      No functionality change.
      
      A previous version of this API had a category argument on
      ui.pager(). As I migrated the commands in core, I couldn't come up
      with good enough consistency in any categorization scheme so I just
      scrapped the whole idea. It may be worth revisiting in the future.
      61b41220
  5. Feb 16, 2017
    • Jun Wu's avatar
      test-logtoprocess: use cat to wait for outputs · 3844b329
      Jun Wu authored
      Commands started by logtoprocess are running asynchronously. To be able to
      test the output, we need to block and wait for the output.
      
      The patch uses "| cat" to wait for such "asynchronous" outputs, to make the
      test more reliable. I have also written a short notice at the top, hopefully
      people would be aware of the pitfall when changing the test.
      3844b329
  6. Feb 17, 2017
  7. Feb 16, 2017
    • Jun Wu's avatar
      localrepo: move extension loading to a separate method · 74af89c6
      Jun Wu authored
      The stateful chg plan [1] requires a special repo object, where ideally all
      side effects caused by loading the repo object could be reverted by just
      dropping (gabbage collect) the loaded repo object.
      
      Currently, that is impossible because repo.__init__ calls
      "extensions.loadall", which may have unpredictable side-effects that cannot
      be reverted by dropping the repo object.
      
      This patch moves "extensions.loadall" to a separate method, so chg could
      subclass localrepository and make extensions loading a no-op.
      
      [1]: mercurial-scm.org/pipermail/mercurial-devel/2017-February/092547.html
      74af89c6
    • Pulkit Goyal's avatar
      py3: convert the mode argument of os.fdopen to unicodes · d194f0db
      Pulkit Goyal authored
      Couple of these from the earlier series got lost while rebasing. So this patch
      converts them again.
      d194f0db
    • Jun Wu's avatar
      runtests: unindent an "if True" block · 1ee685de
      Jun Wu authored
      The block was left to make review easier. This patch unindents it.
      1ee685de
    • Jun Wu's avatar
      runtests: set web.ipv6 if we use IPv6 · f07ca071
      Jun Wu authored
      As explained by the previous patch, we need to set "web.ipv6=True" if we
      decide to use IPv6. Otherwise "hg serve" will still try to listen on IPv4.
      
      This patch makes it so by appending web.ipv6 to "extra configs".
      
      This patch was tested in a Linux system with IPv6, by the following steps:
      
        1. Change hgweb/server.py temporarily to write a file if
           IPv6HTTPServer.__init__ is called.
        2. run-tests.py -l --keep-tmpdir test-serve.t
        3. Check the generated .hgrc, make sure it sets web.ipv6=1.
        4. Check the log file to make sure IPv6HTTPServer.__init__ is called.
      f07ca071
    • Jun Wu's avatar
      runtests: checkportisavailable should only check one family · 1f803482
      Jun Wu authored
      As explained by the previous patch, checkportisavailable() should only check
      the preferred family - either IPv4 or IPv6, not both.
      
      This patch makes it so.
      1f803482
    • Jun Wu's avatar
      runtests: add a function to test if IPv6 is available · 15f9084a
      Jun Wu authored
      Previously, checkportisavailable returns True if the port is free either on
      IPv4 or IPv6, but the hg server only uses IPv4 by default. That leads to
      issues when IPv4 port is not free but the IPv6 one is.
      
      To address that, run-tests should stick with either IPv4 or IPv6. This patch
      adds a function similar to checkportisavailable to test if IPv6 is
      available, and assigns the result to a variable.
      
      The new function was tested in a Linux system script with the following
      steps:
      
        1. Run "ip addr del ::1/128 dev lo" to delete lo's IPv6 address,
           Confirm checkipv6available() returns False.
        2. Run "ip addr add ::1/128 dev lo" to add back lo's IPv6 address.
           Confirm checkipv6available() returns True.
        3. Start a web server taking the 8000 port.
           Confirm checkipv6available(8000) is still True.
      15f9084a
  8. Feb 15, 2017
    • Simon Farnsworth's avatar
      histedit: log the time taken to read in the commands list · d4825798
      Simon Farnsworth authored
      If we're being fed an external command list from stdin (histedit --commands -),
      then the time spent reading stdin is outside our control. Log it.
      d4825798
    • Simon Farnsworth's avatar
      extdiff: log time spent in external diff program · 08e6f4da
      Simon Farnsworth authored
      We can't fix the time external diff programs take to run. Log that duration
      for us to remove from any stats we gather
      08e6f4da
    • Simon Farnsworth's avatar
      crecord: log blocked time waiting for curses input · a0c4e570
      Simon Farnsworth authored
      We want to know when we're blocked waiting for the user - log the time spent
      waiting in the curses keyboard handlers
      a0c4e570
    • Simon Farnsworth's avatar
      ui: give editor() a tag of its own · 60b5db2a
      Simon Farnsworth authored
      We know that calls to ui.editor() always block on the user's configured editor.
      Use a blocking tag that ensures that we don't see a huge variety of editor
      options in our logging.
      60b5db2a
    • Simon Farnsworth's avatar
      ui: time calls to ui.system · fd598149
      Simon Farnsworth authored
      We want to know when we're blocked on ui.system, and why. Allow the user to
      supply a tag - otherwise we record on an unspecific tag derived from cmd.
      fd598149
    • Simon Farnsworth's avatar
      ui: log time spent blocked on stdio · fdecd24c
      Simon Farnsworth authored
      We use a wrapper around Mercurial at Facebook that logs key statistics (like
      elpased time) to our standard performance tooling.
      
      This is less useful than it could be, because we currently can't tell when a
      command is slow because we need to fix Mercurial versus when a command is
      slow because the user isn't interacting quickly.
      
      Teach Mercurial to log the time it spends blocked, so that our tooling can
      pick it up and submit it with the elapsed time - we can then do the math in
      our tooling to see if Mercurial is slow, or if the user simply failed to
      interact.
      
      Combining this with the command duration log means that we can ensure that
      we concentrate performance efforts on the things that bite Facebook users.
      
      The perfwrite microbenchmark shifts from:
      Linux:
      ! wall 3.213560 comb 0.410000 user 0.350000 sys 0.060000 (best of 4)
      Mac:
      ! wall 0.342325 comb 0.180000 user 0.110000 sys 0.070000 (best of 20)
      
      before this change to:
      ! wall 3.478070 comb 0.500000 user 0.420000 sys 0.080000 (best of 3)
      Mac:
      ! wall 0.218112 comb 0.220000 user 0.150000 sys 0.070000 (best of 15)
      
      showing a small hit in comb time, but firmly in the noise on wall time.
      fdecd24c
    • Simon Farnsworth's avatar
      contrib: add a write microbenchmark to perf.py · 5a9e4dc8
      Simon Farnsworth authored
      I'm adding some performance logging to ui.write - this benchmark lets us
      confirm that the cost of that logging is acceptably low.
      
      At this point, the microbenchmark on Linux over SSH shows:
      
      ! wall 3.213560 comb 0.410000 user 0.350000 sys 0.060000 (best of 4)
      
      while on the Mac locally, it shows:
      
      ! wall 0.342325 comb 0.180000 user 0.110000 sys 0.070000 (best of 20)
      5a9e4dc8
    • Simon Farnsworth's avatar
      ui: provide a mechanism to track and log blocked time · e92daf15
      Simon Farnsworth authored
      We want to log the time Mercurial spends trapped in things outside
      programmatic control. Provide a mechanism to give us both command runtime
      and as many different sources of blocking as we deem useful.
      e92daf15
    • Simon Farnsworth's avatar
      mercurial: switch to util.timer for all interval timings · 22fbca1d
      Simon Farnsworth authored
      util.timer is now the best available interval timer, at the expense of not
      having a known epoch. Let's use it whenever the epoch is irrelevant.
      22fbca1d
    • Simon Farnsworth's avatar
      util: introduce timer() · ae5d60bb
      Simon Farnsworth authored
      As documented for timeit.default_timer, there are better timers available for
      performance measures on some platforms. These timers don't have a set epoch,
      and thus are only useful for interval measurements, but have higher
      resolution, and thus get you a better measurement overall.
      
      Use the same selection logic as Python's timeit.default_timer. This is a
      platform clock on Python 2 and early Python 3, and time.perf_counter on Python
      3.3 and later (where time.perf_counter is introduced as the best timer to use).
      ae5d60bb
  9. Dec 22, 2016
Loading