mercurial/unionrepo.py
changeset 51874 1b17309cdaab
parent 51863 f4733654f144
child 51875 8315175f678d
--- a/mercurial/unionrepo.py	Wed Sep 18 21:00:20 2024 -0400
+++ b/mercurial/unionrepo.py	Thu Sep 19 16:19:29 2024 -0400
@@ -14,7 +14,7 @@
 from __future__ import annotations
 
 import contextlib
-
+import typing
 
 from .i18n import _
 
@@ -247,13 +247,20 @@
         return False
 
 
-class unionrepository:
+_union_repo_baseclass = object
+
+if typing.TYPE_CHECKING:
+    _union_repo_baseclass = localrepo.localrepository
+
+
+class unionrepository(_union_repo_baseclass):
     """Represents the union of data in 2 repositories.
 
     Instances are not usable if constructed directly. Use ``instance()``
     or ``makeunionrepository()`` to create a usable instance.
     """
 
+    # noinspection PyMissingConstructor
     def __init__(self, repo2, url):
         self.repo2 = repo2
         self._url = url