repo = RpmGitRepository(workdir)
if repo.get_branch() is None:
msger.error('currently not on a branch')
+ if opts.commit:
+ repo.rev_parse(opts.commit)
except GitRepositoryError, err:
msger.error(str(err))
if spec.orig_file:
with utils.Workdir(workdir):
relative_spec = specfile.replace('%s/' % workdir, '')
+ commit = opts.commit or 'HEAD'
msger.info('export tar ball and packaging files ... ')
try:
if gbp_build(["argv[0] placeholder", "--git-export-only",
"--git-export-dir=%s" % export_dir,
"--git-packaging-dir=packaging",
"--git-specfile=%s" % relative_spec,
- "--git-export=%s" % 'HEAD']):
+ "--git-export=%s" % commit]):
msger.error("Failed to get packaging info from git tree")
except GitRepositoryError, excobj:
msger.error("Repository error: %s" % excobj)
repo = RpmGitRepository(workdir)
if repo.get_branch() is None:
msger.error('currently not on a branch')
+ if opts.commit:
+ repo.rev_parse(opts.commit)
except GitRepositoryError, err:
msger.error(str(err))
msger.info('generate tar ball: %s' % tarball)
with utils.Workdir(workdir):
+ commit = opts.commit or 'HEAD'
relative_spec = specfile.replace('%s/' % workdir, '')
try:
if gbp_build(["argv[0] placeholder", "--git-export-only",
"--git-export-dir=%s" % outdir,
"--git-packaging-dir=packaging",
"--git-specfile=%s" % relative_spec,
- "--git-export=%s" % 'HEAD']):
+ "--git-export=%s" % commit]):
msger.error("Failed to get packaging info from git tree")
except GitRepositoryError, excobj:
msger.error("Repository error: %s" % excobj)
repo = repository.GitRepository(workdir)
if repo.get_branch() is None:
msger.error('currently not on a branch')
+ if opts.commit:
+ repo.rev_parse(opts.commit)
except repository.GitRepositoryError, err:
msger.error(str(err))
default=None,
dest='spec',
help='Specify a spec file to use')
+ @cmdln.option('-c', '--commit',
+ default=None,
+ dest='commit',
+ help='Specify a commit ID to export')
def do_export(self, _subcmd, opts, *args):
"""${cmd_name}: export files and prepare for build
help='Do incremental build, which needs support of spec file,'
' and tar ball unpack stage should be enabled with the '
'condition of RPM macro RSYNCDONE')
+ @cmdln.option('-c', '--commit',
+ default=None,
+ dest='commit',
+ help='Specify a commit ID to build')
@cmdln.option('--spec',
default=None,
dest='spec',