Skip to content
Snippets Groups Projects
  1. Nov 07, 2020
    • Jörg Sonnenberger's avatar
      transaction: drop per-file extra data support · 63edc384
      Jörg Sonnenberger authored
      At the moment, transactions support an optional extra data argument for
      all files to be stored in addition to the original offset. This is used
      in core only by the revlog inline to external data migration. It is used
      to memoize the number of revisions before the transaction. That number
      of can be computed during the walk easily, so drop the requirement.
      
      Differential Revision: https://phab.mercurial-scm.org/D9275
      63edc384
  2. Nov 12, 2020
    • Martin von Zweigbergk's avatar
      templates: define a {onelinesummary} keyword · f67741e8
      Martin von Zweigbergk authored
      It is sometimes useful to be able to use the configured
      `command-template.oneline-summary` in higher-level templates. For
      example, I would like to use it in an internal template that lists
      commits in a "review unit" (kind of a pull request). This patch adds
      support for that.
      
      We may want to define a way of formatting a context using a
      command-specific override (from
      `command-templates.oneline-summary.<command>`), but that will have to
      be a template function instead. I don't plan to do that, but I'm
      mentioning it now in case reviewers would prefer that we use a no-arg
      function (i.e. `{onelinesummary()}`) already today to prepare for
      that.
      
      Differential Revision: https://phab.mercurial-scm.org/D9314
      f67741e8
  3. Oct 30, 2020
  4. Nov 08, 2020
  5. Nov 16, 2020
  6. Nov 17, 2020
  7. Nov 16, 2020
  8. Nov 13, 2020
  9. Nov 17, 2020
  10. Nov 16, 2020
  11. Nov 17, 2020
    • Yuya Nishihara's avatar
      chgserver: backport py3 buffered I/O workarounds from procutil · b56feaa9
      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.
      b56feaa9
  12. Nov 12, 2020
  13. Nov 10, 2020
  14. Oct 20, 2020
  15. Oct 22, 2020
  16. Oct 12, 2020
  17. Oct 22, 2020
  18. Nov 13, 2020
    • Martin von Zweigbergk's avatar
      errors: catch urllib errors specifically instead of using safehasattr() · ae00e170
      Martin von Zweigbergk authored
      Before this patch, we would catch `IOError` and `OSError` and check if
      the instance had a `.code` member (indicates `HTTPError`) or a
      `.reason` member (indicates the more generic `URLError`). It seems to
      me that can simply catch those exception specifically instead, so
      that's what this code does. The existing code is from fbe8834923c5
      (commands: report http exceptions nicely, 2005-06-17), so I suspect
      it's just that there was no `urllib2` (where `URLError` lives) back
      then.
      
      The old code mentioned `SSLError` in a comment. The new code does
      *not* try to catch that. The documentation for `ssl.SSLError` says
      that it has a `.reason` property, but `python -c 'import ssl;
      print(dir(ssl.SSLError("foo", Exception("bar"))))` doesn't mention
      that property on either Python 2 or Python 3 on my system. It also
      seems that `sslutil` is pretty careful about converting `ssl.SSLError`
      to `error.Abort`. It also is carefult to not assume that instances of
      the exception have a `.reason`. So I at least don't want to catch
      `ssl.SSLError` and handle it the same way as `URLError` because that
      would likely result in a crash. I also wonder if we don't need to
      handle it at all (because `sslutil` might handle all the cases). It's
      now early in the release cycle, so perhaps we can just see how it
      goes?
      
      Differential Revision: https://phab.mercurial-scm.org/D9318
      ae00e170
  19. Nov 12, 2020
  20. Nov 06, 2020
  21. Nov 11, 2020
  22. Sep 01, 2020
  23. Nov 10, 2020
  24. Nov 03, 2020
  25. Nov 06, 2020
    • Gregory Szorc's avatar
      global: use python3 in shebangs · c102b704
      Gregory Szorc authored
      Python 3 is the future. We want Python scripts to be using Python 3
      by default.
      
      This change updates all `#!/usr/bin/env python` shebangs to use
      `python3`.
      
      Does this mean all scripts use or require Python 3: no.
      
      In the test environment, the `PATH` environment variable in tests is
      updated to guarantee that the Python executable used to run
      run-tests.py is used. Since test scripts all now use
      `#!/usr/bin/env python3`, we had to update this code to install
      a `python3` symlink instead of `python`.
      
      It is possible there are some random scripts now executed with the
      incorrect Python interpreter in some contexts. However, I would argue
      that this was a pre-existing bug: we should almost always be executing
      new Python processes using the `sys.executable` from the originating
      Python script, as `python` or `python3` won't guarantee we'll use the
      same interpreter.
      
      Differential Revision: https://phab.mercurial-scm.org/D9273
      c102b704
  26. Nov 09, 2020
  27. Oct 22, 2020
  28. Oct 07, 2020
  29. Oct 22, 2020
    • Martin von Zweigbergk's avatar
      errors: add config that lets user get more detailed exit codes · 21733e8c
      Martin von Zweigbergk authored
      This adds an experimental config that lets the user get more detailed
      exit codes. For example, there will be a specific error code for
      input/user errors. This is part of
      https://www.mercurial-scm.org/wiki/ErrorCategoriesPlan. I've made the
      config part of tweakdefaults.
      
      I've made the config enabled by default in tests. My reasoning is that
      we want to see that each specific error case gives the right exit code
      and we don't want to duplicate all error cases in the entire test
      suite. It also makes it easy to grep the `.t` files for `[255]` to
      find which cases we have left to fix. The logic for the current exit
      codes is quite simple, so I'm not too worried about regressions
      there. I've added a test case specifically for the "legacy" exit
      codes.
      
      I've set the detailed exit status only for the case of
      `InterventionRequired` and `SystemExit` for now (the cases where we
      currently return something other than 255), just to show that it
      works.
      
      Differential Revision: https://phab.mercurial-scm.org/D9238
      21733e8c
Loading