commit:     83419e5421f5e892fc0964bd5825f3454e6a04df
Author:     Brian Harring <ferringb <AT> gmail <DOT> com>
AuthorDate: Tue Jan 17 06:13:25 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sun Feb  5 18:08:21 2023 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=83419e54

refactor(config): remove indirection of multiplex.config_tree for multiplex.tree

config_tree was added before config hints were a thing; instead just annotate 
the
class directly.

Signed-off-by: Brian Harring <ferringb <AT> gmail.com>
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 src/pkgcore/ebuild/portage_conf.py  | 2 +-
 src/pkgcore/repository/multiplex.py | 9 +++------
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/pkgcore/ebuild/portage_conf.py 
b/src/pkgcore/ebuild/portage_conf.py
index ef25baab3..d33d2e37d 100644
--- a/src/pkgcore/ebuild/portage_conf.py
+++ b/src/pkgcore/ebuild/portage_conf.py
@@ -216,7 +216,7 @@ class PortageConfig(DictMixin):
             self["repo-stack"] = basics.FakeIncrementalDictConfigSection(
                 my_convert_hybrid,
                 {
-                    "class": "pkgcore.repository.multiplex.config_tree",
+                    "class": "pkgcore.repository.multiplex.tree",
                     "repos": tuple(repos),
                 },
             )

diff --git a/src/pkgcore/repository/multiplex.py 
b/src/pkgcore/repository/multiplex.py
index d4dcf206a..e46799939 100644
--- a/src/pkgcore/repository/multiplex.py
+++ b/src/pkgcore/repository/multiplex.py
@@ -14,7 +14,7 @@ from snakeoil.compatibility import sorted_cmp
 from snakeoil.currying import post_curry
 from snakeoil.iterables import iter_sort
 
-from ..config.hint import configurable
+from ..config.hint import ConfigHint
 from ..operations import repo as repo_interface
 from . import errors, prototype
 
@@ -62,11 +62,6 @@ class operations(repo_interface.operations_proxy):
         return ret
 
 
-@configurable(types={"repos": "refs:repo"}, typename="repo")
-def config_tree(repos):
-    return tree(*repos)
-
-
 class tree(prototype.tree):
     """Repository combining multiple repos together.
 
@@ -84,6 +79,8 @@ class tree(prototype.tree):
     frozen_settable = False
     operations_kls = operations
 
+    pkgcore_config_type = ConfigHint(types={"repos": "refs:repo"}, 
typename="repo")
+
     def __init__(self, *trees):
         super().__init__()
         for x in trees:

Reply via email to