Skip to content

Commit 7c8638b

Browse files
committed
If we're already in sync, do not show output from the checkout command
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.
1 parent 8067c59 commit 7c8638b

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

manic/checkout.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ def commandline_arguments(args=None):
218218

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

225225
#
226226
# developer options

manic/sourcetree.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,15 @@ def checkout(self, verbosity, load_all):
173173
self._stat.log_status_message(VERBOSITY_VERBOSE)
174174

175175
if self._repo:
176+
if self._stat.sync_state == ExternalStatus.STATUS_OK:
177+
# If we're already in sync, avoid showing verbose output
178+
# from the checkout command, unless the verbosity level
179+
# is 2 or more.
180+
checkout_verbosity = verbosity - 1
181+
else:
182+
checkout_verbosity = verbosity
176183
self._repo.checkout(self._base_dir_path,
177-
self._repo_dir_name, verbosity)
184+
self._repo_dir_name, checkout_verbosity)
178185

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

0 commit comments

Comments
 (0)