params.append("--verbose")
if not args.no_pristine_tar and os.path.exists("/usr/bin/pristine-tar"):
params.append("--pristine-tar")
+ if args.filter:
+ params += [('--filter=%s' % f) for f in args.filter]
if path.endswith('.src.rpm') or path.endswith('.spec'):
+ if args.allow_same_version:
+ params.append("--allow-same-version")
+ if args.native:
+ params.append("--native")
+ if args.no_patch_import:
+ params.append("--no-patch-import")
ret = gbp_import_srpm(params)
if ret == 2:
log.warning("Importing of patches into packaging branch failed! "
elif ret:
raise GbsError("Failed to import %s" % path)
else:
+ if args.upstream_vcs_tag:
+ params.append('--upstream-vcs-tag=%s' % args.upstream_vcs_tag)
if args.merge:
params.append('--merge')
else:
@with_data("ail-0.2.29-2.3.src.rpm")
def test_specify_upstream(self, srcrpm):
"""Test --upstream command line option."""
- eq_(GBS(argv=["gbs", "import", "--upstream=upstream",
+ eq_(GBS(argv=["gbs", "import", "--upstream-branch=upstream",
srcrpm]), None)
repo = GitRepository("./ail")
eq_(repo.get_local_branches(), ['master', 'pristine-tar', 'upstream'])
parser.add_argument('--author-name', help='author name of git commit')
parser.add_argument('--author-email', help='author email of git commit')
- parser.add_argument('--upstream_branch', default='upstream',
+ parser.add_argument('--upstream-branch', default='upstream',
help='specify upstream branch for new package version')
- parser.add_argument('--merge', action='store_true',
- help='merge new upstream branch to master')
parser.add_argument('--packaging-dir',
help='directory containing packaging files')
parser.add_argument('--no-pristine-tar', action='store_true',
'pristine-tar only support import *tar.{gz,bz2,xz} '
'sources, this option can be specified to import '
'other format sources')
+ parser.add_argument('--filter', action="append",
+ help='files to filter out during import(can be given '
+ 'multiple times)')
+ group = parser.add_argument_group('only for importing srpms and spec file '
+ 'options')
+ group.add_argument('--allow-same-version', action='store_true',
+ help='allow to import already imported version')
+ group.add_argument('--native', action='store_true',
+ help='this is a dist native package, no separate '
+ 'upstream')
+ group.add_argument('--no-patch-import', action='store_true',
+ help='don\'t import patches automatically')
+ group = parser.add_argument_group('only for importing upstream tar ball '
+ 'options')
+ group.add_argument('--merge', action='store_true',
+ help='merge new upstream branch to master')
+ group.add_argument('--upstream-vcs-tag',
+ help='upstream VCS tag add to the merge commit')
parser.set_defaults(alias="im")
return parser