~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_reconfigure.py

MergeĀ lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007 Canonical Ltd
 
1
# Copyright (C) 2007, 2008, 2009 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
44
44
        self.assertRaises(errors.NoWorkingTree, workingtree.WorkingTree.open,
45
45
                          'tree')
46
46
 
 
47
    def test_tree_with_pending_merge_to_branch(self):
 
48
        tree = self.make_branch_and_tree('tree')
 
49
        other_tree = tree.bzrdir.sprout('other').open_workingtree()
 
50
        self.build_tree(['other/file'])
 
51
        other_tree.add('file')
 
52
        other_tree.commit('file added')
 
53
        tree.merge_from_branch(other_tree.branch)
 
54
        reconfiguration = reconfigure.Reconfigure.to_branch(tree.bzrdir)
 
55
        self.assertRaises(errors.UncommittedChanges, reconfiguration.apply)
 
56
        reconfiguration.apply(force=True)
 
57
        self.assertRaises(errors.NoWorkingTree, workingtree.WorkingTree.open,
 
58
                          'tree')
 
59
 
47
60
    def test_branch_to_branch(self):
48
61
        branch = self.make_branch('branch')
49
62
        self.assertRaises(errors.AlreadyBranch,