Read about our upcoming Code of Conduct on this issue

  1. 08 Dec, 2020 1 commit
  2. 12 Dec, 2020 1 commit
    • Jörg Sonnenberger's avatar
      revlog: support none compression · 84130fd74a22
      Jörg Sonnenberger authored
      revlog files had uncompressed revlog entries support since forever, but
      it wasn't selectable or exposed explicitly. It is occassionally useful
      for performance testing as it avoids the latency of zlib or zstd. It
      also has the nice side effect of providing a non-default compression
      engine out-of-the-box.
      
      Differential Revision: https://phab.mercurial-scm.org/D9572
      84130fd74a22
  3. 10 Dec, 2020 1 commit
  4. 02 Dec, 2020 1 commit
    • Pulkit Goyal's avatar
      procutils: don't try to get `.buffer` if sys.stdin is None · 81c1f5d1801f
      Pulkit Goyal authored
      While hunting down following test failure of test-chg.t on Python 3, I stumbled
      the case when `.buffer` is not available as sys.stdin is None.
      
      	--- /home/pulkit/repo/hg-committed/tests/test-chg.t
      	+++ /home/pulkit/repo/hg-committed/tests/test-chg.t.err
      	@@ -203,7 +203,31 @@
      	   $ CHGDEBUG=1 chg version -q 0<&-
      		 chg: debug: * stdio fds are missing (glob)
      	     chg: debug: * execute original hg (glob)
      		 -  Mercurial Distributed SCM * (glob)
      		 +  Traceback (most recent call last):
      		 +    File "/tmp/hgtests.avspvsq4/install/bin/hg", line 43, in <module>
      		 +      dispatch.run()
      		 +    File "/usr/lib/python3.6/importlib/util.py", line 233, in
      		 __getattribute__
      		 +      self.__spec__.loader.exec_module(self)
      		 +    File "<frozen importlib._bootstrap_external>", line 678, in
      		 exec_module
      		 +    File "<frozen importlib._bootstrap>", line 219, in
      		 _call_with_frames_removed
      		 +    File
      		 "/tmp/hgtests.avspvsq4/install/lib/python/mercurial/dispatch.py", line
      		 726, in <module>
      		 +      class lazyaliasentry(object):
      		 +    File
      		 "/tmp/hgtests.avspvsq4/install/lib/python/mercurial/dispatch.py", line
      		 737, in lazyaliasentry
      		 +      @util.propertycache
      		 +    File "/usr/lib/python3.6/importlib/util.py", line 233, in
      		 __getattribute__
      		 +      self.__spec__.loader.exec_module(self)
      		 +    File "<frozen importlib._bootstrap_external>", line 678, in
      		 exec_module
      		 +    File "<frozen importlib._bootstrap>", line 219, in
      		 _call_with_frames_removed
      		 +    File "/tmp/hgtests.avspvsq4/install/lib/python/mercurial/util.py",
      		 line 3473, in <module>
      		 +      f=procutil.stderr,
      		 +    File "/usr/lib/python3.6/importlib/util.py", line 233, in
      		 __getattribute__
      		 +      self.__spec__.loader.exec_module(self)
      		 +    File "<frozen importlib._bootstrap_external>", line 678, in
      		 exec_module
      		 +    File "<frozen importlib._bootstrap>", line 219, in
      		 _call_with_frames_removed
      		 +    File
      		 "/tmp/hgtests.avspvsq4/install/lib/python/mercurial/utils/procutil.py",
      		 line 127, in <module>
      		 +      stdin = sys.stdin.buffer
      		 +  AttributeError: 'NoneType' object has no attribute 'buffer'
      		 +  [1]
      
      		  server lifecycle
      		   ----------------
      
      Differential Revision: https://phab.mercurial-scm.org/D9500
      81c1f5d1801f
  5. 01 Dec, 2020 1 commit
  6. 05 Oct, 2020 1 commit
  7. 14 Oct, 2020 1 commit
  8. 05 Oct, 2020 1 commit
  9. 25 Jun, 2020 1 commit
  10. 09 Jun, 2020 1 commit
  11. 05 Jun, 2020 1 commit
  12. 07 May, 2020 2 commits
    • Raphaël Gomès's avatar
      formatting: add missing newline · 79f6f856c53f
      Raphaël Gomès authored
      Differential Revision: https://phab.mercurial-scm.org/D8509
      
      --HG--
      branch : stable
      79f6f856c53f
    • Rodrigo Damazio Bovendorp's avatar
      procutil: always waiting on child processes to prevent zombies with 'hg serve' · ed684a82e29b
      Rodrigo Damazio Bovendorp authored
      When runbgcommand is invoked by an extension with ensurestart=False, we never
      called waitpid - which is fine in most cases, except if that's happening on a
      command server (e.g. chg), in which case the child defunct process will just
      sit there for as long as the server is running.
      
      The actual semantics of SIGCHLD signal handling is a lot more complex than
      it seems, and the POSIX standard *seems* to read that it's ignored by default
      and everything would just work without the waitpid if we're not listening for
      it, but the truth is that it's only ignored if we *explicitly* set it to
      SIG_IGN. We further cannot set it to SIG_IGN or to a catch-all handler across
      all of 'hg serve', because Python's suprocess.Popen relies on that signal,
      and a few specific parts of hg also set custom handlers, so instead we wait
      for specific PIDs in dedicated threads.
      
      I did a poor-man's benchmark of the thread creation and it seems to take
      about 1ms, which is way better than the 20+ms from ensurestart=True.
      
      Differential Revision: https://phab.mercurial-scm.org/D8497
      
      --HG--
      branch : stable
      ed684a82e29b
  13. 12 Sep, 2020 1 commit
  14. 21 Jul, 2020 1 commit
  15. 17 Jul, 2020 1 commit
    • Manuel Jacob's avatar
      windows: always work around EINVAL in case of broken pipe for stdout / stderr · a37f290a7124
      Manuel Jacob authored
      In 29a905fe23ae, I missed the fact that the `winstdout` class works around two
      unrelated bugs (size limit when writing to consoles and EINVAL in case of
      broken pipe) and that the latter bug happens even when no console is involved.
      When writing a test for this, I realized that the same problem applies to
      stderr, so I applied the workaround for EINVAL to both stdout and stderr.
      
      The size limit is worked around in the same case as before (consoles on Windows
      on Python 2). For that, I changed the `winstdout` class.
      a37f290a7124
  16. 03 Feb, 2020 1 commit
  17. 01 Feb, 2020 1 commit
    • Matt Harbison's avatar
      resourceutil: account for the non-resource-like file hierarchy under py2exe · aab70b540d3d
      Matt Harbison authored
      After 9e367157a990, config files for py2exe were expected to be in
      C:\Program Files\Mercurial\mercurial\defaultrc because of the implied resource
      structure of 'mercurial.defaultrc.*.rc', relative to the executable.
      Accomodating this would require changes to the WIX and Inno scripts (and perhaps
      the script that generates the WIX script), as well as 3rd party bundlers like
      TortoiseHg.  But these files aren't read as resources anyway- they fall back to
      the filesystem APIs.  (If we really wanted to carry on the charade, the
      installer would have to also sprinkle various empty __init__.py files around.)
      
      Instead, this simply prunes the 'mercurial.' portion of the resource name when
      run with py2exe.  (PyOxidizer uses the resources API, not the filesystem
      fallback, so it is unaffected.)  Since this hack only affects the py2 Windows
      installers and is less risky, I think it's reasonable.  We haven't needed to
      load any 3rd party resource up to this point, and would have to make packaging
      changes anyway to handle that.
      
      Differential Revision: https://phab.mercurial-scm.org/D8058
      
      --HG--
      branch : stable
      aab70b540d3d
  18. 31 Jan, 2020 1 commit
  19. 24 Jan, 2020 1 commit
  20. 13 Jan, 2020 2 commits
  21. 30 Dec, 2019 2 commits
  22. 29 Dec, 2019 1 commit
    • Matt Harbison's avatar
      resourceutil: don't limit resources to the `mercurial` package · 52f0140c2604
      Matt Harbison authored
      This should make things a little clearer, in that it now requires the full
      package name to access a resource.  But the real motivation is that
      `extensions._disabledpaths()` walks the `hgext` directory looking for bundled
      extensions.  This in turn feeds, among other things:
      
          1) Listing disabled extensions in `hg help extensions`
          2) Indicating that an unknown command is in a non-enabled extension
          3) Displaying help for non-enabled extensions
          4) Generating documentation
          5) Announcing LFS is auto-enabled (or not) when cloning from an LFS source
      
      The filesystem based ResourceReader will happily return *.py and *.pyc, but the
      one supplied by PyOxidizer doesn't.  Presumably we can change that.  The only
      other idea I had here is for setup.py to generate a text file containing the
      list of extensions, but that doesn't seem great when running from source.
      
      Differential Revision: https://phab.mercurial-scm.org/D7772
      52f0140c2604
  23. 28 Dec, 2019 1 commit
  24. 18 Dec, 2019 1 commit
  25. 05 Dec, 2019 1 commit
    • Augie Fackler's avatar
      procutil: try and avoid angering CoreFoundation on macOS · a89381e04c58
      Augie Fackler authored
      We've seen failures like this:
      
          objc[57662]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
          objc[57662]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
      
      I think this is due to forking off some background processes during
      `hg update` or similar. I don't have any conclusive proof this is the
      fork() call that's to blame, but it's the most likely one since the
      regular `hg update` codepath uses the other fork() invocation (via
      workers) and we don't get this report from non-Google macOS users.
      
      Ugh.
      
      Differential Revision: https://phab.mercurial-scm.org/D7615
      a89381e04c58
  26. 16 Dec, 2019 1 commit
  27. 12 Dec, 2019 1 commit
  28. 09 Dec, 2019 1 commit
  29. 01 Dec, 2019 1 commit
  30. 25 Nov, 2019 1 commit
    • Jun Wu's avatar
      dateutil: correct default for Ymd in parsedate · b65bd4b61d78
      Jun Wu authored
      The code uses `0` for the default value of Ymd (year, month, and day), which
      seems suboptimal. For example, these will fail to parse:
      
        dateutil.parsedate('2000', formats=dateutil.extendeddateformats)
        dateutil.parsedate('Jan 2000', formats=dateutil.extendeddateformats)
      
      Fix it by providing sane defaults (1 instead of 0) for year, month, and day.
      
      The suboptimal behavior was introduced by 91bc001a592f (2010-12-29,
      "date: fix matching of underspecified date ranges"), which does not seem to
      justify the current behavior.
      
      Note end-users should not notice the subtle issue, because there are no formats
      in `defaultdateformats` that allow an explicit year with omitted month, or an
      explicit month with omitted day.
      
      Differential Revision: https://phab.mercurial-scm.org/D7520
      b65bd4b61d78
  31. 14 Nov, 2019 5 commits
  32. 27 Nov, 2020 1 commit
    • durin42's avatar
      formating: upgrade to black 20.8b1 · 89a2afe31e82
      durin42 authored
      This required a couple of small tweaks to un-confuse black, but now it
      works. Big formatting changes come from:
      
       * Dramatically improved collection-splitting logic upstream
       * Black having a strong (correct IMO) opinion that """ is better than '''
      
      Differential Revision: https://phab.mercurial-scm.org/D9430
      89a2afe31e82
  33. 17 Nov, 2020 1 commit
    • Yuya Nishihara's avatar
      chgserver: backport py3 buffered I/O workarounds from procutil · b56feaa9b520
      Yuya Nishihara authored
      I've recently switched to new machine and I found chg's stdout is fully
      buffered.
      
      Even though chg server is a daemon process, it inherits the environment
      where the chg client originally forked the server. This means the server's
      stdout might have been wrapped by LineBufferedWrapper. That's why we need
      to do wrap/unwrap in both ways.
      
      The "if" condition in _restoreio() looks weird, but I'm not willing to
      clean things up because stdio behavior is fundamentally different between
      py2 and py3, and py2 support will be dropped anyway.
      b56feaa9b520