--- a/migrate-3rdparty/allura_import.py
+++ b/migrate-3rdparty/allura_import.py
@@ -18,6 +18,7 @@
optparser.add_option('-p', '--project', dest='project', help='Project to import to')
optparser.add_option('-t', '--tracker', dest='tracker', help='Tracker to import to')
optparser.add_option('-u', '--base-url', dest='base_url', default='https://sourceforge.net', help='Base Allura URL (%default)')
+ optparser.add_option('-o', dest='import_opts', default=[], action='append', help='Specify import option(s)', metavar='opt=val')
optparser.add_option('--validate', dest='validate', action='store_true', help='Validate import data')
optparser.add_option('-v', '--verbose', dest='verbose', action='store_true', help='Verbose operation')
options, args = optparser.parse_args()
@@ -67,5 +68,12 @@
else:
url += '/perform_import'
+ import_options = {}
+ for s in options.import_opts:
+ k, v = s.split('=', 1)
+ if v == 'false':
+ v = False
+ import_options['option_' + k] = v
+
cli = AlluraRestClient(options.base_url, options.api_key, options.secret_key)
- print cli.call(url, doc=open(args[0]).read())
+ print cli.call(url, doc=open(args[0]).read(), **import_options)