diff --git a/osc/commandline.py b/osc/commandline.py index abb757de..73dd5e90 100755 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -1239,7 +1239,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. args = parseargs(args) arg_list = args[:] for arg in arg_list: - if is_project_dir(arg): + if is_project_dir(arg) and conf.config['do_package_tracking']: prj = Project(arg, False) for pac in prj.pacs_unvers: pac_dir = getTransActPath(os.path.join(prj.dir, pac)) @@ -1257,6 +1257,10 @@ Please submit there instead, or use --nodevelproject to force direct submission. args.append(pac_dir) args.remove(arg) prj.write_packages() + elif is_project_dir(arg): + print >>sys.stderr, 'osc: addremove is not supported in a project dir unless ' \ + '\'do_package_tracking\' is enabled in the configuration file' + sys.exit(1) pacs = findpacs(args) for p in pacs: diff --git a/osc/core.py b/osc/core.py index 2748a427..b5365e5e 100755 --- a/osc/core.py +++ b/osc/core.py @@ -3439,10 +3439,13 @@ def addFiles(filenames, prj_obj = None): os.chdir(filename) init_package_dir(prj_apiurl, prj_name, pac_dir, pac_dir, files=False) os.chdir(old_dir) - elif is_package_dir(filename) and conf.config['do_package_tracking']: print >>sys.stderr, 'osc: warning: \'%s\' is already under version control' % filename return 1 + elif os.path.isdir(filename) and is_project_dir(prj_dir): + print >>sys.stderr, 'osc: cannot add a directory to a project unless ' \ + '\'do_package_tracking\' is enabled in the configuration file' + return 1 pacs = findpacs(filenames)