~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_commit.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-05-12 23:48:49 UTC
  • mfrom: (1704.2.13 bzr.mbp.integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060512234849-259ff209fff58489
(mbp) various fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005 by Canonical Ltd
 
1
# Copyright (C) 2005, 2006 by Canonical Ltd
2
2
 
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')
393
393
        finally:
394
394
            master_branch.unlock()
 
395
 
 
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)
 
402
 
 
403
        self.build_tree_contents([('bound/content_file', 'initial contents\n')])
 
404
        bound_tree.add(['content_file'])
 
405
        bound_tree.commit(message='woo!')
 
406
 
 
407
        other_bzrdir = master_branch.bzrdir.sprout('other')
 
408
        other_tree = other_bzrdir.open_workingtree()
 
409
 
 
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')
 
415
 
 
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')])
 
421
 
 
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')