From 5aded248a5c8c46c015aac89db36eb946a9dbd28 Mon Sep 17 00:00:00 2001 From: Andreas Baumbach Date: Wed, 29 Aug 2018 19:10:55 +0200 Subject: [PATCH] spack view suggests -I option for merge conflict (#9035) --- lib/spack/spack/cmd/view.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/spack/spack/cmd/view.py b/lib/spack/spack/cmd/view.py index b847e89240..153168cf71 100644 --- a/lib/spack/spack/cmd/view.py +++ b/lib/spack/spack/cmd/view.py @@ -55,12 +55,12 @@ import os import llnl.util.tty as tty +from llnl.util.link_tree import MergeConflictError import spack.cmd import spack.store from spack.filesystem_view import YamlFilesystemView - description = "produce a single-rooted directory view of packages" section = "environment" level = "short" @@ -208,9 +208,15 @@ def view(parser, args): # Map action to corresponding functionality if args.action in actions_link: - view.add_specs(*specs, - with_dependencies=with_dependencies, - exclude=args.exclude) + try: + view.add_specs(*specs, + with_dependencies=with_dependencies, + exclude=args.exclude) + except MergeConflictError: + tty.info("Some file blocked the merge, adding the '-i' flag will " + "ignore this conflict. For more information see e.g. " + "https://github.com/spack/spack/issues/9029") + raise elif args.action in actions_remove: view.remove_specs(*specs,