Skip to content
Snippets Groups Projects
  1. Jul 24, 2020
  2. Jul 23, 2020
  3. Jul 24, 2020
    • Martin von Zweigbergk's avatar
      templater: handle None returned from templatedir() · d5ccc059fbcd
      Martin von Zweigbergk authored
      My recent 91aa9bba3dc9 (templater: make templatepaths() return a
      single path, or None, 2020-07-21) didn't account for the fact that
      `templatedir()` returns `None` in frozen binaries. That is ironic,
      since the reason I'm working on this is to add support for built-in
      mapfiles in frozen binaries. This patch updates the callers to handle
      the `None` case. It's somewhat ugly, but I will have to revisit this
      soon anyway, since my goal is to make all callers handle that case by
      trying to read the map file using the resources API instead.
      
      Differential Revision: https://phab.mercurial-scm.org/D8810
      d5ccc059fbcd
  4. Jul 22, 2020
    • Martin von Zweigbergk's avatar
      templater: do search for include of unqualified builtin outside of config code · 4ccd5ec565c2
      Martin von Zweigbergk authored
      Commit 081b08e4ea13 (templater: look for mapfiles in template paths,
      2015-05-15) added support for using things like `%include
      map-cmdline.default` to include built-in map files without using a
      valid path to them. This patch rewrites that support by moving it into
      `_readmapfile()` so it can later be adapted for reading from a
      non-file resource.
      
      Differential Revision: https://phab.mercurial-scm.org/D8792
      4ccd5ec565c2
    • Martin von Zweigbergk's avatar
      templater: switch to lower-level config.parse() in _readmapfile() · 8ec3062b7047
      Martin von Zweigbergk authored
      I hope to modify this code to also work with resources loaded from
      memory (for PyOxidizer support). For that, we'll need to handle the
      lookup of relative `%include` path (not joined with the base directory
      of the containing file). This patch prepares for that by using
      `config.parse()` instead of `config.read()`, since the latter expects
      a file in the file system.
      
      As it happens, this change also lets us clean up the `config` class to
      not need the `_includepaths` field. That will happen next.
      
      Differential Revision: https://phab.mercurial-scm.org/D8791
      8ec3062b7047
    • Martin von Zweigbergk's avatar
      config: pass both relative and absolute paths to `include` callback · f7f142d74df3
      Martin von Zweigbergk authored
      The `include` callback is responsible for loading configs from
      `%include` statements. The callback currently gets passed the absolute
      path [1] to the config to read. That is created by joining the dirname
      of the file that contains the `%include` statement. For PyOxidizer
      support, I'm trying to reduce dependence on paths. This patch helps
      with that by passing the relative path found in the `%include`
      statement (but with username expansion, etc.) to the `include`
      callback. It also turns out that the existing callers can easily adapt
      to using the relative path. Coming patches will clean that up and then
      we'll remove the absolute path from the callback.
      
       [1] The "absolute path" bit is a bit of a lie -- it's going to be an
       absolute path if the path that was passed into `config.parse()` was
       absolute.
      
      Differential Revision: https://phab.mercurial-scm.org/D8790
      f7f142d74df3
  5. Jul 23, 2020
  6. Jul 22, 2020
  7. Jul 23, 2020
  8. Jul 06, 2020
    • Pierre-Yves David's avatar
      commitctx: extract _filecommit too · ce9ee81df9ff
      Pierre-Yves David authored
      This function is exclusively used in `commitctx`. So we should extract it too
      for consistency and to reduce the `localrepo` bloat.
      
      This is part of a larger refactoring/cleanup of the commitctx code to clarify
      and augment the logic gathering metadata useful for copy tracing. The current
      code is a tad too long and entangled to make such update easy.
      
      Differential Revision: https://phab.mercurial-scm.org/D8710
      ce9ee81df9ff
    • Pierre-Yves David's avatar
      commitctx: extract the function in a dedicated module · ae5c1a3bc339
      Pierre-Yves David authored
      the function have few callers (< 15) is quite long a mostly independent from the
      repository itself. It seems like a good candidate to reduce the bloatness of the
      localrepository class. Extracting it will help us cleaning the code up and
      splitting it into more reasonable-size function.
      
      We don't use a copy trick because the amount of code extract is quite small
      (<5%) and the de-indent means every single line change anyway. So this is not
      deemed valuable to do so.
      
      This is part of a larger refactoring/cleanup of the commitctx code to clarify
      and augment the logic gathering metadata useful for copy tracing. The current
      code is a tad too long and entangled to make such update easy.
      
      Differential Revision: https://phab.mercurial-scm.org/D8709
      ae5c1a3bc339
    • Pierre-Yves David's avatar
      commitctx: document a fast path in _filecommit · 31393ec06cef
      Pierre-Yves David authored
      This block cut off a lot of logic, documenting the why and how seems useful to
      future reader.
      
      This is part of a larger refactoring/cleanup of the commitctx code to clarify
      and augment the logic gathering metadata useful for copy tracing. The current
      code is a tad too long and entangled to make such update easy. We start with
      easy and small cleanup.
      
      Differential Revision: https://phab.mercurial-scm.org/D8700
      31393ec06cef
  9. Jul 21, 2020
  10. Jul 06, 2020
    • Pierre-Yves David's avatar
      commitctx: move a tiny else clause above the very long one · 55464c0b3a89
      Pierre-Yves David authored
      This is simple to have all the simple case unfold before the 100+ line one. Otherwise it is hard to relate the `else` to the initial conditionnal.
      
      This is part of a larger refactoring/cleanup of the commitctx code to clarify
      and augment the logic gathering metadata useful for copy tracing. The current
      code is a tad too long and entangled to make such update easy. We start with
      easy and small cleanup.
      
      Differential Revision: https://phab.mercurial-scm.org/D8708
      55464c0b3a89
    • Pierre-Yves David's avatar
      commitctx: consider removed as touched · c068e355cd71
      Pierre-Yves David authored
      This achieve the same result with clearer code.
      
      This is part of a larger refactoring/cleanup of the commitctx code to clarify
      and augment the logic gathering metadata useful for copy tracing. The current
      code is a tad too long and entangled to make such update easy. We start with
      easy and small cleanup.
      
      Differential Revision: https://phab.mercurial-scm.org/D8707
      c068e355cd71
    • Pierre-Yves David's avatar
      commitctx: rename "changed" to touched · 025ee25b5b23
      Pierre-Yves David authored
      The variable contains content that are both added and modified. "changed" could
      be confused with "modified" only, so we pick a less ambiguous naming that will
      help with more unification.
      
      For example, it would make sense to shove the "removed" item in there since
      this is how the variable is used.
      
      This is part of a larger refactoring/cleanup of the commitctx code to clarify
      and augment the logic gathering metadata useful for copy tracing. The current
      code is a tad too long and entangled to make such update easy. We start with
      easy and small cleanup.
      
      Differential Revision: https://phab.mercurial-scm.org/D8706
      025ee25b5b23
  11. Jul 07, 2020
  12. Jul 06, 2020
    • Pierre-Yves David's avatar
      commitctx: compute files added from _filecommit returns · e64c35dfc6cb
      Pierre-Yves David authored
      When possible, lets avoid recomputing the same information again.
      
      This is part of a larger refactoring/cleanup of the commitctx code to clarify
      and augment the logic gathering metadata useful for copy tracing. The current
      code is a tad too long and entangled to make such update easy. We start with
      easy and small cleanup.
      
      Differential Revision: https://phab.mercurial-scm.org/D8703
      e64c35dfc6cb
    • Pierre-Yves David's avatar
      commitctx: return "touched" status from _filecommit · 509f5b6c0b7e
      Pierre-Yves David authored
      Instead of mutating a list passed in argument, we simply return the information
      from the `_filecommit` function. This make for a cleaner API and allow for
      richer information to be returned. That richer information will be used in the
      next commit to avoid duplicated computation.
      
      This is part of a larger refactoring/cleanup of the commitctx code to clarify
      and augment the logic gathering metadata useful for copy tracing. The current
      code is a tad too long and entangled to make such update easy. We start with
      easy and small cleanup.
      
      Differential Revision: https://phab.mercurial-scm.org/D8702
      509f5b6c0b7e
  13. Jul 20, 2020
  14. Jul 22, 2020
  15. Apr 22, 2020
  16. Jul 20, 2020
  17. Jul 21, 2020
  18. Jul 20, 2020
  19. Jul 18, 2020
  20. Jul 19, 2020
Loading