/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: Martin Pool
  • Date: 2010-10-08 04:38:25 UTC
  • mfrom: (5462 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5478.
  • Revision ID: mbp@sourcefrog.net-20101008043825-b181r8bo5r3qwb6j
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006 Canonical Ltd
 
1
# Copyright (C) 2006, 2007, 2009, 2010 Canonical Ltd
2
2
# Authors:  Robert Collins <robert.collins@canonical.com>
3
3
#
4
4
# This program is free software; you can redistribute it and/or modify
16
16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
18
from cStringIO import StringIO
19
 
import os
20
 
 
21
 
from bzrlib import errors
22
 
from bzrlib.errors import NotBranchError, NotVersionedError
23
 
from bzrlib.osutils import basename
24
 
from bzrlib.tests.per_workingtree import TestCaseWithWorkingTree
25
 
from bzrlib.trace import mutter
26
 
from bzrlib.transport import get_transport
27
 
 
28
 
 
29
 
class TestPull(TestCaseWithWorkingTree):
 
19
 
 
20
from bzrlib.tests import per_workingtree
 
21
 
 
22
 
 
23
class TestPull(per_workingtree.TestCaseWithWorkingTree):
30
24
 
31
25
    def get_pullable_trees(self):
32
26
        self.build_tree(['from/', 'from/file', 'to/'])
56
50
        tree_b.pull(tree_a.branch)
57
51
        self.assertFileEqual('contents of from/file\n', 'to/file')
58
52
 
 
53
    def test_pull_changes_root_id(self):
 
54
        tree = self.make_branch_and_tree('from')
 
55
        tree.set_root_id('first_root_id')
 
56
        self.build_tree(['from/file'])
 
57
        tree.add(['file'])
 
58
        tree.commit('first')
 
59
        to_tree = tree.bzrdir.sprout('to').open_workingtree()
 
60
        self.assertEqual('first_root_id', to_tree.get_root_id())
 
61
        tree.set_root_id('second_root_id')
 
62
        tree.commit('second')
 
63
        to_tree.pull(tree.branch)
 
64
        self.assertEqual('second_root_id', to_tree.get_root_id())