Skip to content

Commit

Permalink
If we're already in sync, do not show output from the checkout command
Browse files Browse the repository at this point in the history
However, specifying '--verbose --verbose' will still show output from
the checkout command even if we're already in sync.

This implementation feels like a bit of a hack. On the other hand, I can
convince myself that it makes sense as a general rule to decrease the
verbosity level of the checkout if we're in sync.
  • Loading branch information
billsacks committed Jan 18, 2018
1 parent 8067c59 commit 7c8638b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions manic/checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ def commandline_arguments(args=None):

parser.add_argument('-v', '--verbose', action='count', default=0,
help='Output additional information to '
'the screen and log file. For --status, this flag '
'can be used a second time, increasing the verbosity'
'level each time.')
'the screen and log file. This flag can be '
'used up to two times, increasing the '
'verbosity level each time.')

#
# developer options
Expand Down
9 changes: 8 additions & 1 deletion manic/sourcetree.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,15 @@ def checkout(self, verbosity, load_all):
self._stat.log_status_message(VERBOSITY_VERBOSE)

if self._repo:
if self._stat.sync_state == ExternalStatus.STATUS_OK:
# If we're already in sync, avoid showing verbose output
# from the checkout command, unless the verbosity level
# is 2 or more.
checkout_verbosity = verbosity - 1
else:
checkout_verbosity = verbosity
self._repo.checkout(self._base_dir_path,
self._repo_dir_name, verbosity)
self._repo_dir_name, checkout_verbosity)

def checkout_externals(self, verbosity, load_all):
"""Checkout the sub-externals for this object
Expand Down

0 comments on commit 7c8638b

Please sign in to comment.