1. 22 Oct, 2020 1 commit
  2. 17 Nov, 2020 3 commits
  3. 07 Nov, 2020 4 commits
    • Jörg Sonnenberger's avatar
      transaction: split new files into a separate set · ec73a6a75985
      Jörg Sonnenberger authored
      Journal entries with size 0 are common as they represent new revlog
      files. Move them from the dictionary into a set as the former is more
      dense. This reduces peak RSS by 70MB for the NetBSD test repository with
      around 450k files under .hg/store.
      
      Differential Revision: https://phab.mercurial-scm.org/D9278
      ec73a6a75985
    • Jörg Sonnenberger's avatar
      transaction: change list of journal entries into a dictionary · a985c4fb23ca
      Jörg Sonnenberger authored
      The transaction object used to keep a mapping table of path names to
      journal entries and a list of journal entries consisting of path and
      file offset to truncate on rollback. The offsets are used in three
      cases. repair.strip and rollback process all of them in one go, but they
      care about the order. For them, it is perfectly reasonable to read the
      journal back from disk as both operations already involve at least one
      system call per journal entry. The other consumer is the revlog logic
      for moving from inline to external data storage. It doesn't care about
      the order of the journal and just needs to original offset stored.
      Further optimisations are possible here to move the in-memory journal to
      a set(), but without memoisation of the original revlog size this could
      turn it into O(n^2) behavior in worst case when many revlogs need to
      migrated.
      
      Differential Revision: https://phab.mercurial-scm.org/D9277
      a985c4fb23ca
    • Jörg Sonnenberger's avatar
      transaction: rename find to findoffset and drop backup file support · a6f08085edfe
      Jörg Sonnenberger authored
      transaction.find used to support access to both the regular file and
      backup file list. They have different formats, so any consumer has to be
      aware of the difference alredy. There is no in-core consumer for the
      backup file access, so don't provide it.
      
      Differential Revision: https://phab.mercurial-scm.org/D9276
      a6f08085edfe
    • Jörg Sonnenberger's avatar
      transaction: drop per-file extra data support · 63edc384d3b7
      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
      63edc384d3b7
  4. 12 Nov, 2020 1 commit
    • Martin von Zweigbergk's avatar
      templates: define a {onelinesummary} keyword · f67741e8264b
      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
      f67741e8264b
  5. 30 Oct, 2020 1 commit
  6. 08 Nov, 2020 3 commits
  7. 17 Nov, 2020 2 commits
  8. 16 Nov, 2020 1 commit
  9. 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
  10. 12 Nov, 2020 4 commits
  11. 10 Nov, 2020 1 commit
  12. 20 Oct, 2020 1 commit
  13. 22 Oct, 2020 1 commit
  14. 12 Oct, 2020 1 commit
  15. 22 Oct, 2020 1 commit
  16. 13 Nov, 2020 1 commit
    • Martin von Zweigbergk's avatar
      errors: catch urllib errors specifically instead of using safehasattr() · ae00e170f2d1
      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
      ae00e170f2d1
  17. 12 Nov, 2020 1 commit
  18. 22 Oct, 2020 1 commit
  19. 07 Oct, 2020 1 commit
  20. 22 Oct, 2020 1 commit
    • Martin von Zweigbergk's avatar
      errors: add config that lets user get more detailed exit codes · 21733e8c924f
      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
      21733e8c924f
  21. 08 Nov, 2020 1 commit
    • Martin von Zweigbergk's avatar
      worker: raise exception instead of calling sys.exit() with child's code · 8f07f5a9c3de
      Martin von Zweigbergk authored
      When a worker process returns an error code, we would call
      `sys.exit()` with that exit code on the main process. The `SystemExit`
      exception would then get caught in `scmutil.callcatch()`, which would
      return that error code. The comment there says "Commands shouldn't
      sys.exit directly", which I agree with. This patch changes it so we
      raise a specific exception when a worker fails so we can catch
      instead. I think that means that `SystemExit` is now always an
      internal error.
      
      (I had earlier thought that this call to `sys.exit()` was from within
      the child process until Matt Harbison made me look again, so thanks
      for that!)
      
      Differential Revision: https://phab.mercurial-scm.org/D9287
      8f07f5a9c3de
  22. 03 Nov, 2020 1 commit
  23. 31 Oct, 2020 1 commit
  24. 29 Oct, 2020 1 commit
  25. 24 Oct, 2020 1 commit
    • Matt Harbison's avatar
      repoview: only pin obsolete wdir parents while there are unresolved conflicts · 341e014fe0fb
      Matt Harbison authored
      I noticed after doing an update from an obsolete revision with a dirty wdir that
      the obsolete commit stayed visible for no obvious reason.  It was decided in
      85b03b1e4715 not to clear mergestate once all of the conflicts were resolved, in
      order to allow re-resolving.  Since the point of pinning the obsolete parents
      was to allow resolving in the first place (aaeccdb6e654), it makes sense to also
      gate it on whether or not there are any remaining files to resolve.  This might
      result in pinning again if files are marked unresolved again, but that seems
      reasonable, given that it still solves the original issue.
      
      Note that this isn't purely cosmetic- pushing with a pinned obsolete revision is
      likely to cause complaints about pushing multiple heads or other unexpected
      errors.  So the faster it comes out of that state, the better.
      
      Differential Revision: https://phab.mercurial-scm.org/D9248
      
      --HG--
      branch : stable
      341e014fe0fb
  26. 28 Oct, 2020 1 commit
  27. 23 Oct, 2020 2 commits
  28. 29 Oct, 2020 1 commit