330
330
Option('merge-what-can-be',
331
331
help="Allows not to stop at the first detected conflicts in a branch. "
332
332
"It stores the result in a report, revert the conflicts and merges the next one."),
333
Option('html-report',
334
help="Save as html page the generated report in working dir."),
335
337
def _get_prepared_branch_from_recipe(self, recipe_file,
361
363
return 0, base_branch
362
364
return None, base_branch
364
def generate_build_report(self, base_branch, recipe_file):
370
Build report for branch %s from recipe %s
372
''' % (base_branch.url, recipe_file)
373
for branch_report in GLOBAL_REPORT.itervalues():
374
self.report += '\n * %s' % str(branch_report)
375
for file, developers in branch_report.conflicts :
376
self.report += "\t%s - (modifications from %s)\n" % (file, ', '.join(developers))
378
366
def run(self, recipe_file, working_directory, manifest=None,
379
if_changed_from=None, merge_what_can_be=False):
367
if_changed_from=None, merge_what_can_be=False, html_report=False):
380
368
result, base_branch = self._get_prepared_branch_from_recipe(recipe_file,
381
369
if_changed_from=if_changed_from, merge_what_can_be=merge_what_can_be)
382
370
if result is not None:
384
372
manifest_path = manifest or os.path.join(working_directory,
385
373
"bzr-builder.manifest")
376
self.report = GlobalReport(base_branch, recipe_file)
387
379
build_tree(base_branch, working_directory, ignore_on_failure=merge_what_can_be)
388
except (ConflictsFromMerge, UnresolvedConflicts), e:
391
self.generate_build_report(base_branch, recipe_file)
380
except ConflictsFromMerge, e:
392
381
trace.note(self.report)
384
# The unresolvedConflicts exception has to stop the build execution. No report is to be
385
except UnresolvedConflicts, e:
388
trace.note(self.report)
393
390
write_manifest_to_path(manifest_path, base_branch)
396
392
class cmd_dailydeb(cmd_build):
397
393
"""Build a deb based on a 'recipe'.