Skip to content
Snippets Groups Projects
Commit d0b746cb authored by Seblu's avatar Seblu
Browse files

init repository must not use load_repositories

parent 4bbcd50b
No related branches found
No related tags found
No related merge requests found
......@@ -67,13 +67,17 @@ def c_init(parser, args):
'''
Create a empty repository
'''
repoman = load_repositories(args)
if len(repoman) == 0:
raise Exception("No repository selected")
elif len(repoman) > 1:
raise Exception("Please select only one repository")
Repository.create(repoman[0])
debug("Repository: %s" % repoman[0])
# we cannot use load_repositories because repo doesn't exists
if args.repo_path is not None:
# from command line
Repository.create(RepositoryConfig(None, path=args.repo_path))
else:
# from config
for repoconf in RepoConfigFile(args.repo_config).repos:
# filtering on repository name if present
if args.repo_filter is not None and repoconf.name != args.repo_filter:
continue
Repository.create(repoconf)
def c_add(parser, args):
'''
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment