Skip to content
Snippets Groups Projects
  1. Jul 11, 2022
  2. Jul 10, 2022
    • Manuel Jacob's avatar
      procutil: make stream detection in make_line_buffered more correct and strict · 094a5fa3cf52
      Manuel Jacob authored
      In make_line_buffered(), we don’t want to wrap the stream if we know that lines
      get flushed to the underlying raw stream already.
      
      Previously, the heuristic was too optimistic. It assumed that any stream which
      is not an instance of io.BufferedIOBase doesn’t need wrapping. However, there
      are buffered streams that aren’t instances of io.BufferedIOBase, like
      Mercurial’s own winstdout.
      
      The new logic is different in two ways:
      
      First, only for the check, if unwraps any combination of WriteAllWrapper and
      winstdout.
      
      Second, it skips wrapping the stream only if it is an instance of io.RawIOBase
      (or already wrapped). If it is an instance of io.BufferedIOBase, it gets
      wrapped. In any other case, the function raises an exception. This ensures
      that, if an unknown stream is passed or we add another wrapper in the future,
      we don’t wrap the stream if it’s already line buffered or not wrap the stream
      if it’s not line buffered. In fact, this was already helpful during development
      of this change. Without it, I possibly would have forgot that WriteAllWrapper
      needs to be ignored for the check, leading to unnecessary wrapping if stdout is
      unbuffered.
      
      The alternative would have been to always wrap unknown streams. However, I
      don’t think that anyone would benefit from being less strict. We can expect
      streams from the standard library to be subclassing either io.RawIOBase or
      io.BufferedIOBase, so running Mercurial in the standard way should not regress
      by this change. Py2exe might replace sys.stdout and sys.stderr, but that
      currently breaks Mercurial anyway and also these streams don’t claim to be
      interactive, so this function is not called for them.
      6.2
      094a5fa3cf52
  3. Jul 05, 2022
  4. May 25, 2022
  5. May 18, 2022
  6. Jun 12, 2022
  7. Jun 15, 2022
    • Ian Moody's avatar
      convert: remove old ElementTree import cruft from darcs · 1572f790ee5e
      Ian Moody authored
      All the `import elementtree` attempts seem to pre-date py2.5, when it was
      brought into the standard library, and the manual `cElementTree` fast
      implementation import has been unnecessary and deprecated since py3.3.
      1572f790ee5e
  8. Jun 16, 2022
  9. Jun 10, 2022
  10. Jun 08, 2022
  11. Jun 10, 2022
  12. Jun 14, 2022
  13. Jun 08, 2022
  14. Jun 09, 2022
    • Raphaël Gomès's avatar
      hg-cpython: fallback when encountering an unknown matcher · 44319aa4a2a4
      Raphaël Gomès authored
      At this point in the process, nothing user-visible has happened, it is still
      safe to fallback. This can happen now that we're going to be using
      "container matchers" like unionmatcher and intersectionmatcher.
      
      This is easier and less error-prone than recursive checking beforehand since
      only the presence of a transformation case will allow the process to continue.
      44319aa4a2a4
  15. Jun 14, 2022
Loading