Patchwork [5,of,9] chgserver: use pre-imported modules for mtimehash

login
register
mail settings
Submitter Jun Wu
Date Nov. 13, 2016, 9:55 p.m.
Message ID <76abed25eed8358e6742.1479074149@x1c>
Download mbox | patch
Permalink /patch/17553/
State Changes Requested
Headers show

Comments

Jun Wu - Nov. 13, 2016, 9:55 p.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1479072548 0
#      Sun Nov 13 21:29:08 2016 +0000
# Node ID 76abed25eed8358e6742e20018ab612bd0ec7e99
# Parent  270794c62e902c47f3a62e195224bb02fafea0f3
chgserver: use pre-imported modules for mtimehash

Previously, chg server use loaded modules for mtimehash. With the new
change, uisetup runs per-request and extensions are pre-imported instead of
pre-loaded. So change the file paths for mtimehash to pre-imported
modules.
Jun Wu - Nov. 13, 2016, 11:24 p.m.
Excerpts from Jun Wu's message of 2016-11-13 21:55:49 +0000:
> # HG changeset patch
> # User Jun Wu <quark@fb.com>
> # Date 1479072548 0
> #      Sun Nov 13 21:29:08 2016 +0000
> # Node ID 76abed25eed8358e6742e20018ab612bd0ec7e99
> # Parent  270794c62e902c47f3a62e195224bb02fafea0f3
> chgserver: use pre-imported modules for mtimehash
> 
> Previously, chg server use loaded modules for mtimehash. With the new
> change, uisetup runs per-request and extensions are pre-imported instead of
> pre-loaded. So change the file paths for mtimehash to pre-imported
> modules.
> 
> diff --git a/mercurial/chgserver.py b/mercurial/chgserver.py
> --- a/mercurial/chgserver.py
> +++ b/mercurial/chgserver.py
> @@ -141,9 +141,9 @@ def _getmtimepaths(ui):
>  
>      The list will include:
> -    - extensions (will not cover all files for complex extensions)
> +    - pre-imported extensions (only cover __init__.py for complex extensions)
>      - mercurial/__version__.py
>      - python binary
>      """
> -    modules = [m for n, m in extensions.extensions(ui)]
> +    modules = list(_preimported.items())
                                   ^^^^^ this should be "values"

I probably want to send a V2 with some other future comments fixed.

>      try:
>          from . import __version__

Patch

diff --git a/mercurial/chgserver.py b/mercurial/chgserver.py
--- a/mercurial/chgserver.py
+++ b/mercurial/chgserver.py
@@ -141,9 +141,9 @@  def _getmtimepaths(ui):
 
     The list will include:
-    - extensions (will not cover all files for complex extensions)
+    - pre-imported extensions (only cover __init__.py for complex extensions)
     - mercurial/__version__.py
     - python binary
     """
-    modules = [m for n, m in extensions.extensions(ui)]
+    modules = list(_preimported.items())
     try:
         from . import __version__