summaryrefslogtreecommitdiff
path: root/git/objects/submodule/root.py
diff options
context:
space:
mode:
authorYobmod <yobmod@gmail.com>2021-07-06 15:50:37 +0100
committerYobmod <yobmod@gmail.com>2021-07-06 15:50:37 +0100
commiteecf1486cf445e2f23585b1bb65097dfebbc9545 (patch)
treeb5ad2c3b070ae2158395672fb99a08fe17dae36a /git/objects/submodule/root.py
parented58e2f840749bb4dabd384b812ecb259dc60304 (diff)
downloadgitpython-eecf1486cf445e2f23585b1bb65097dfebbc9545.tar.gz
Rmv root.py types
Diffstat (limited to 'git/objects/submodule/root.py')
-rw-r--r--git/objects/submodule/root.py34
1 files changed, 10 insertions, 24 deletions
diff --git a/git/objects/submodule/root.py b/git/objects/submodule/root.py
index bcac5419..0af48710 100644
--- a/git/objects/submodule/root.py
+++ b/git/objects/submodule/root.py
@@ -10,18 +10,6 @@ import git
import logging
-# typing -------------------------------------------------------------------
-
-from typing import TYPE_CHECKING, Union
-
-from git.types import Commit_ish
-
-if TYPE_CHECKING:
- from git.repo import Repo
- from git.util import IterableList
-
-# ----------------------------------------------------------------------------
-
__all__ = ["RootModule", "RootUpdateProgress"]
log = logging.getLogger('git.objects.submodule.root')
@@ -54,7 +42,7 @@ class RootModule(Submodule):
k_root_name = '__ROOT__'
- def __init__(self, repo: 'Repo'):
+ def __init__(self, repo):
# repo, binsha, mode=None, path=None, name = None, parent_commit=None, url=None, ref=None)
super(RootModule, self).__init__(
repo,
@@ -67,17 +55,15 @@ class RootModule(Submodule):
branch_path=git.Head.to_full_path(self.k_head_default)
)
- def _clear_cache(self) -> None:
+ def _clear_cache(self):
"""May not do anything"""
pass
#{ Interface
- def update(self, previous_commit: Union[Commit_ish, None] = None, # type: ignore[override]
- recursive: bool = True, force_remove: bool = False, init: bool = True,
- to_latest_revision: bool = False, progress: Union[None, 'RootUpdateProgress'] = None,
- dry_run: bool = False, force_reset: bool = False, keep_going: bool = False
- ) -> 'RootModule':
+ def update(self, previous_commit=None, recursive=True, force_remove=False, init=True,
+ to_latest_revision=False, progress=None, dry_run=False, force_reset=False,
+ keep_going=False):
"""Update the submodules of this repository to the current HEAD commit.
This method behaves smartly by determining changes of the path of a submodules
repository, next to changes to the to-be-checked-out commit or the branch to be
@@ -142,8 +128,8 @@ class RootModule(Submodule):
previous_commit = repo.commit(previous_commit) # obtain commit object
# END handle previous commit
- psms: 'IterableList[Submodule]' = self.list_items(repo, parent_commit=previous_commit)
- sms: 'IterableList[Submodule]' = self.list_items(repo)
+ psms = self.list_items(repo, parent_commit=previous_commit)
+ sms = self.list_items(repo)
spsms = set(psms)
ssms = set(sms)
@@ -176,8 +162,8 @@ class RootModule(Submodule):
csms = (spsms & ssms)
len_csms = len(csms)
for i, csm in enumerate(csms):
- psm: 'Submodule' = psms[csm.name]
- sm: 'Submodule' = sms[csm.name]
+ psm = psms[csm.name]
+ sm = sms[csm.name]
# PATH CHANGES
##############
@@ -357,7 +343,7 @@ class RootModule(Submodule):
return self
- def module(self) -> 'Repo':
+ def module(self):
""":return: the actual repository containing the submodules"""
return self.repo
#} END interface