diff options
author | Richard Dale <richard.dale@codethink.co.uk> | 2013-06-25 09:26:28 +0100 |
---|---|---|
committer | Richard Dale <richard.dale@codethink.co.uk> | 2013-06-25 09:26:28 +0100 |
commit | e15e84e3cab086a8a2301c6c16e34e5a8e07c368 (patch) | |
tree | 99a2d9030d35b94a51ad4eda6c2eb7e147de2f5f /morphlib | |
parent | 155e5025278d106f3700fa8dffffb4c279dcded0 (diff) | |
download | morph-e15e84e3cab086a8a2301c6c16e34e5a8e07c368.tar.gz |
Don't show git config messages for 'morph branch' in verbose mode
Diffstat (limited to 'morphlib')
-rw-r--r-- | morphlib/app.py | 13 | ||||
-rw-r--r-- | morphlib/git.py | 2 | ||||
-rw-r--r-- | morphlib/plugins/branch_and_merge_plugin.py | 8 |
3 files changed, 15 insertions, 8 deletions
diff --git a/morphlib/app.py b/morphlib/app.py index f82eae33..b8f1eb1e 100644 --- a/morphlib/app.py +++ b/morphlib/app.py @@ -410,6 +410,12 @@ class Morph(cliapp.Application): if 'env' not in kwargs: kwargs['env'] = dict(os.environ) + if 'print_command' in kwargs: + print_command = kwargs['print_command'] + del kwargs['print_command'] + else: + print_command = True + # convert the command line arguments into a string commands = [argv] + list(args) for command in commands: @@ -419,9 +425,10 @@ class Morph(cliapp.Application): commands = [' '.join(command) for command in commands] # print the command line - self.status(msg='# %(cmdline)s', - cmdline=' | '.join(commands), - chatty=True) + if print_command: + self.status(msg='# %(cmdline)s', + cmdline=' | '.join(commands), + chatty=True) # Log the environment. prev = getattr(self, 'prev_env', {}) diff --git a/morphlib/git.py b/morphlib/git.py index 9cdd0a84..3b9c4240 100644 --- a/morphlib/git.py +++ b/morphlib/git.py @@ -214,7 +214,7 @@ def check_config_set(runcmd, keys, cwd='.'): found = {} for key in keys: try: - value = runcmd(['git', 'config', key], cwd=cwd).strip() + value = runcmd(['git', 'config', key], cwd=cwd, print_command=False).strip() found[key] = value except cliapp.AppException: missing.append(key) diff --git a/morphlib/plugins/branch_and_merge_plugin.py b/morphlib/plugins/branch_and_merge_plugin.py index 38e9ccc3..bad2e9de 100644 --- a/morphlib/plugins/branch_and_merge_plugin.py +++ b/morphlib/plugins/branch_and_merge_plugin.py @@ -180,18 +180,18 @@ class BranchAndMergePlugin(cliapp.Plugin): def set_branch_config(self, branch_dir, option, value): filename = os.path.join(branch_dir, '.morph-system-branch', 'config') - self.app.runcmd(['git', 'config', '-f', filename, option, value]) + self.app.runcmd(['git', 'config', '-f', filename, option, value], print_command=False) def get_branch_config(self, branch_dir, option): filename = os.path.join(branch_dir, '.morph-system-branch', 'config') - value = self.app.runcmd(['git', 'config', '-f', filename, option]) + value = self.app.runcmd(['git', 'config', '-f', filename, option], print_command=False) return value.strip() def set_repo_config(self, repo_dir, option, value): - self.app.runcmd(['git', 'config', option, value], cwd=repo_dir) + self.app.runcmd(['git', 'config', option, value], cwd=repo_dir, print_command=False) def get_repo_config(self, repo_dir, option): - value = self.app.runcmd(['git', 'config', option], cwd=repo_dir) + value = self.app.runcmd(['git', 'config', option], cwd=repo_dir, print_command=False) return value.strip() def get_head(self, repo_path): |