From 09709e36d1c3f0a295be36bf7ff178e721581a51 Mon Sep 17 00:00:00 2001 From: John Alex Date: Wed, 21 Dec 2022 16:25:59 +0000 Subject: [PATCH] Document _Externals.status(). The original comment was apparently copy-pasted from checkout(). --- manic/sourcetree.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/manic/sourcetree.py b/manic/sourcetree.py index 54de763c30..04c2131e62 100644 --- a/manic/sourcetree.py +++ b/manic/sourcetree.py @@ -90,11 +90,11 @@ def get_local_path(self): def status(self): """ - If the repo destination directory exists, ensure it is correct (from - correct URL, correct branch or tag), and possibly update the external. - If the repo destination directory does not exist, checkout the correce - branch or tag. - If load_all is True, also load all of the the externals sub-externals. + Returns status of all components (if available). + + Also returns, if available: + * Is this external optional/required + * Is local repository clean/dirty """ self._stat.path = self.get_local_path() @@ -112,6 +112,7 @@ def status(self): ext_stats = {} if not os.path.exists(self._repo_dir_path): + # No local repository. self._stat.sync_state = ExternalStatus.EMPTY msg = ('status check: repository directory for "{0}" does not ' 'exist.'.format(self._name)) @@ -126,9 +127,11 @@ def status(self): else: self._stat.expected_version = self._repo.tag() + self._repo.branch() else: + # Local repository state (e.g. clean/dirty) if self._repo: self._repo.status(self._stat, self._repo_dir_path) + # Status of the entire source tree. if self._externals and self._externals_sourcetree: # we expect externals and they exist cwd = os.getcwd()