Don't merge post-merge items

In all cases, the launcher-merger updates the repos involved in a
job before running it.  If there are pre-merge changes, it then
merges those changes into the repos.  If the job does not involve
pre-merge changes, then nothing further needs to happen.  Avoid
attempting to merge changes which are already merged in this case.

Change-Id: Ie0c0d258b4edad4afc3b569f8ea222523bc769c1
This commit is contained in:
James E. Blair 2016-11-30 10:03:27 -08:00
parent c5e4f1d262
commit 0c9e4f3e99
1 changed files with 5 additions and 1 deletions

View File

@ -361,7 +361,11 @@ class LaunchServer(object):
task.wait()
self.log.debug("Job %s: git updates complete" % (job.unique,))
merger = self._getMerger(jobdir.git_root)
commit = merger.mergeChanges(args['items']) # noqa
merge_items = [i for i in args['items'] if i.get('refspec')]
if merge_items:
commit = merger.mergeChanges(merge_items) # noqa
else:
commit = args['items'][-1]['newrev'] # noqa
# TODOv3: Ansible the ansible thing here.
self.prepareAnsibleFiles(jobdir, args)