Skip to content

Commit

Permalink
test_sys_checkout: less confusing handling of return values from chec…
Browse files Browse the repository at this point in the history
…kout_externals. Specifically, when doing a checkout, don't return tree_status from _before_ the checkout. Make a new wrapper to call checkout_externals a second time, to calculate the new status after a checkout (very frequent pattern).

Also, stop having every caller check overall_status == 0, just do it once in the helper method that calls checkout_externals.

No-op.
  • Loading branch information
johnpaulalex committed Jan 26, 2023
1 parent 2328681 commit e01cfe2
Show file tree
Hide file tree
Showing 2 changed files with 194 additions and 359 deletions.
6 changes: 4 additions & 2 deletions manic/checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,8 @@ def main(args):
Returns a tuple (overall_status, tree_status). overall_status is 0
on success, non-zero on failure. tree_status gives the full status
*before* executing the checkout command - i.e., the status that it
used to determine if it's safe to proceed with the checkout.
if no checkout is happening. If checkout is happening, tree_status
is None.
"""
if args.do_logging:
logging.basicConfig(filename=LOG_FILE_NAME,
Expand Down Expand Up @@ -438,6 +438,8 @@ def main(args):
for comp in args.components:
source_tree.checkout(args.verbose, load_all, load_comp=comp)
printlog('')
# New tree status is unknown, don't return anything.
tree_status = None

logging.info('%s completed without exceptions.', program_name)
# NOTE(bja, 2017-11) tree status is used by the systems tests
Expand Down
Loading

0 comments on commit e01cfe2

Please sign in to comment.