Skip to content

Commit

Permalink
Document _Externals.status(). The original comment was apparently cop…
Browse files Browse the repository at this point in the history
…y-pasted from checkout().
  • Loading branch information
johnpaulalex committed Dec 21, 2022
1 parent 1d880e0 commit 09709e3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions manic/sourcetree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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))
Expand All @@ -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()
Expand Down

0 comments on commit 09709e3

Please sign in to comment.