1
# Copyright (C) 2005 by Canonical Ltd
1
# Copyright (C) 2005, 2006 by Canonical Ltd
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
392
392
self.assertRaises(LockContention, wt.commit, 'silly')
394
394
master_branch.unlock()
396
def test_commit_bound_merge(self):
397
# see bug #43959; commit of a merge in a bound branch fails to push
398
# the new commit into the master
399
master_branch = self.make_branch('master')
400
bound_tree = self.make_branch_and_tree('bound')
401
bound_tree.branch.bind(master_branch)
403
self.build_tree_contents([('bound/content_file', 'initial contents\n')])
404
bound_tree.add(['content_file'])
405
bound_tree.commit(message='woo!')
407
other_bzrdir = master_branch.bzrdir.sprout('other')
408
other_tree = other_bzrdir.open_workingtree()
410
# do a commit to the the other branch changing the content file so
411
# that our commit after merging will have a merged revision in the
412
# content file history.
413
self.build_tree_contents([('other/content_file', 'change in other\n')])
414
other_tree.commit('change in other')
416
# do a merge into the bound branch from other, and then change the
417
# content file locally to force a new revision (rather than using the
418
# revision from other). This forces extra processing in commit.
419
self.merge(other_tree.branch, bound_tree)
420
self.build_tree_contents([('bound/content_file', 'change in bound\n')])
422
# before #34959 was fixed, this failed with 'revision not present in
423
# weave' when trying to implicitly push from the bound branch to the master
424
bound_tree.commit(message='commit of merge in bound tree')