diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-05-28 16:28:28 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-05-28 16:28:28 +0000 |
commit | d5d9b7253f968b67e9c9a3e6d260a6adf1dee8f9 (patch) | |
tree | aa33f3b250505f2f55e870ea9a48337853fe3e86 /morphlib/plugins/branch_and_merge_plugin.py | |
parent | 57d2fc906005e073ba942ce5b89fde3ec1eefece (diff) | |
parent | 6375554363c111fda70b7540c3c56a0e9cf1497b (diff) | |
download | morph-d5d9b7253f968b67e9c9a3e6d260a6adf1dee8f9.tar.gz |
Merge branch 'liw/kill-bare-except'
Reviewed-by: Richard Maw
I, Lars, note that we have an old version of CoverageTestRunner
in Baserock. The new version hides the spurious logging messages.
Diffstat (limited to 'morphlib/plugins/branch_and_merge_plugin.py')
-rw-r--r-- | morphlib/plugins/branch_and_merge_plugin.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/morphlib/plugins/branch_and_merge_plugin.py b/morphlib/plugins/branch_and_merge_plugin.py index 99451f4c..215ac6c8 100644 --- a/morphlib/plugins/branch_and_merge_plugin.py +++ b/morphlib/plugins/branch_and_merge_plugin.py @@ -231,7 +231,9 @@ class BranchAndMergePlugin(cliapp.Plugin): try: return self.app.runcmd(['git', 'rev-parse', '--verify', ref], cwd=repodir)[0:40] - except: + except cliapp.AppException, e: + logging.info( + 'Ignoring error executing git rev-parse: %s' % str(e)) return None def resolve_reponame(self, reponame): @@ -558,11 +560,7 @@ class BranchAndMergePlugin(cliapp.Plugin): 'directory as a workspace: %s' % dirname) else: - try: - os.makedirs(dirname) - except: - raise cliapp.AppException('failed to create workspace: %s' % - dirname) + os.makedirs(dirname) os.mkdir(os.path.join(dirname, '.morph')) self.app.status(msg='Initialized morph workspace', chatty=True) @@ -600,7 +598,9 @@ class BranchAndMergePlugin(cliapp.Plugin): original_ref], cwd=repo_dir) return branch_dir - except: + except BaseException, e: + logging.error('Caught exception: %s' % str(e)) + logging.info('Removing half-finished branch %s' % branch_name) self.remove_branch_dir_safe(workspace, branch_name) raise @@ -1513,7 +1513,9 @@ class BranchAndMergePlugin(cliapp.Plugin): "case, and then repeat the 'morph merge' operation." % from_branch) self.app.status(msg="Merge successful") - except: + except BaseException, e: + logging.error('Caught exception: %s' % str(e)) + logging.info('Resetting half-finished merge') for repo_dir, sha1 in merged_repos.itervalues(): self.reset_work_tree_safe(repo_dir) raise |