/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_workingtree/test_pull.py

  • Committer: Vincent Ladeuil
  • Date: 2011-08-16 13:12:40 UTC
  • mfrom: (6071 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6076.
  • Revision ID: v.ladeuil+lp@free.fr-20110816131240-gcyn9cik86dxwgz3
Merge into trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# along with this program; if not, write to the Free Software
16
16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
 
from cStringIO import StringIO
19
18
 
20
19
from bzrlib import tests
21
20
from bzrlib.tests import per_workingtree
34
33
    def test_pull(self):
35
34
        tree_a, tree_b = self.get_pullable_trees()
36
35
        tree_b.pull(tree_a.branch)
37
 
        self.failUnless(tree_b.branch.repository.has_revision('A'))
 
36
        self.assertTrue(tree_b.branch.repository.has_revision('A'))
38
37
        self.assertEqual(['A'], tree_b.get_parent_ids())
39
38
 
40
39
    def test_pull_overwrites(self):
42
41
        tree_b.commit('foo', rev_id='B')
43
42
        self.assertEqual(['B'], tree_b.branch.revision_history())
44
43
        tree_b.pull(tree_a.branch, overwrite=True)
45
 
        self.failUnless(tree_b.branch.repository.has_revision('A'))
46
 
        self.failUnless(tree_b.branch.repository.has_revision('B'))
 
44
        self.assertTrue(tree_b.branch.repository.has_revision('A'))
 
45
        self.assertTrue(tree_b.branch.repository.has_revision('B'))
47
46
        self.assertEqual(['A'], tree_b.get_parent_ids())
48
47
 
49
48
    def test_pull_merges_tree_content(self):
85
84
        return builder.get_branch()
86
85
 
87
86
    def test_pull_orphans(self):
88
 
        from bzrlib import workingtree
89
 
        if isinstance(self.workingtree_format, workingtree.WorkingTreeFormat2):
 
87
        if not self.workingtree_format.missing_parent_conflicts:
90
88
            raise tests.TestSkipped(
91
 
                'WorkingTreeFormat2 does not support missing parent conflicts')
 
89
                '%r does not support missing parent conflicts' %
 
90
                    self.workingtree_format)
92
91
        trunk = self.make_branch_deleting_dir('trunk')
93
92
        work = trunk.bzrdir.sprout('work', revision_id='2').open_workingtree()
94
93
        work.branch.get_config().set_user_option(
100
99
        work.pull(trunk)
101
100
        self.assertLength(0, work.conflicts())
102
101
        # The directory removal should succeed
103
 
        self.failIfExists('work/dir')
 
102
        self.assertPathDoesNotExist('work/dir')