Skip to content

Commit

Permalink
Merge pull request ESCOMP#169 from johnpaulalex/docfix_branch
Browse files Browse the repository at this point in the history
Document _Externals.status().


Document _Externals.status().

User interface changes?: No

Fixes: First step toward issue 155 (checkout externals without -o fails to update existing optionals), as we will need to reuse this status code to determine which optional packages to update.

Testing: None - doc-only change.
test removed:
unit tests:
system tests:
manual testing:
  • Loading branch information
jedwards4b authored Dec 21, 2022
2 parents 1d880e0 + 09709e3 commit 975d7fd
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 975d7fd

Please sign in to comment.