392
def bug_description(importp, lp_side_branch_path):
393
suite = icommon.make_suite(importp.release, importp.pocket)
392
def bug_description(distro, release, pocket, name, lp_side_branch_path):
393
suite = icommon.make_suite(release, pocket)
394
394
lp_path = "lp:" + lp_side_branch_path[lp_side_branch_path.index("~"):]
395
395
description = ("The package history in the archive and the history "
396
396
"in the bzr branch differ. As the archive is authoritative "
397
397
"the history of lp:%s/%s/%s now reflects that and the old "
398
398
"bzr branch has been pushed to %s. A merge should be performed "
399
"if necessary." % (importp.distro, suite, importp.name, lp_path))
399
"if necessary." % (distro, suite, name, lp_path))
400
400
return description
403
def file_bug(importp, lp_side_branch_path):
404
suite = icommon.make_suite(importp.release, importp.pocket)
405
description = bug_description(importp, lp_side_branch_path)
403
def file_bug(distro, release, pocket, name, lp_side_branch_path):
404
suite = icommon.make_suite(release, pocket)
405
description = bug_description(distro, release, pocket, name, lp_side_branch_path)
406
406
udd = icommon.lp_call(operator.getitem, lp.projects, 'udd')
407
407
new_bug = icommon.lp_call(lp.bugs.createBug, target=udd,
408
title="Collision for %s %s" % (importp.name, suite),
408
title="Collision for %s %s" % (name, suite),
409
409
description=description)
410
410
mutter("Bug filed: %s" % str(new_bug.id))
413
def file_mp(importp, bstore, lp_side_branch_path):
413
def file_mp(distro, release, pocket, name, bstore, lp_side_branch_path):
414
414
lp_url = icommon.SERVICE_ROOT \
415
415
+ lp_side_branch_path[lp_side_branch_path.index("~"):]
416
416
lp_branch = icommon.lp_call(lp.load, lp_url)
417
target_branch_url = bstore._branch_url(importp.distro, importp.release,
417
target_branch_url = bstore._branch_url(distro, release, pocket)
419
418
target_lp_branch = icommon.lp_call(lp.load, target_branch_url)
420
419
ubuntu_dev = icommon.lp_call(operator.getitem, lp.people, 'ubuntu-dev')
421
420
mp = icommon.lp_call(lp_branch.createMergeProposal,
422
421
target_branch=target_lp_branch,
423
initial_comment=bug_description(importp, lp_side_branch_path),
422
initial_comment=bug_description(distro, release, pocket, name,
423
lp_side_branch_path),
424
424
needs_review=True,
425
425
#reviewers=[ubuntu_dev.self_link],
467
467
tag._merge_tags_if_possible(updates_branch, lp_side_branch)
469
469
updates_branch.unlock()
470
if importp.distro == "debian":
471
file_bug(importp, lp_side_branch_path)
473
file_mp(importp, bstore, lp_side_branch_path)
470
f = open(updates_branch_path + ".collisions", "a")
472
f.write(lp_side_branch + "\n")
474
475
# Then we move it to one side and branch back the revision we want
475
476
side_dir = tempfile.mkdtemp(dir=temp_dir)
604
605
except HTTPError, e:
605
606
print e.content.decode("utf-8", "replace")
608
if os.path.exists(source_branch_path + ".collisions"):
609
mutter("sleeping to file merge proposal")
611
f = open(source_branch_path + ".collisions")
614
lp_side_branch_path = line.strip()
616
file_bug(d, known_release, known_pocket, package,
619
file_mp(d, known_release, known_pocket, package,
620
bstore, lp_side_branch_path)
608
624
push_lock.release()