~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): Vincent Ladeuil
  • Date: 2017-01-30 14:42:05 UTC
  • mfrom: (6620.1.1 trunk)
  • Revision ID: tarmac-20170130144205-r8fh2xpmiuxyozpv
Merge  2.7 into trunk including fix for bug #1657238 [r=vila]

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2006, 2007, 2009-2012, 2016 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
17
17
 
18
18
 
19
19
from bzrlib import tests
 
20
from bzrlib.revision import NULL_REVISION
20
21
from bzrlib.tests import per_workingtree
21
22
 
22
23
 
30
31
        tree_b = self.make_branch_and_tree('to')
31
32
        return tree, tree_b
32
33
 
 
34
    def test_pull_null(self):
 
35
        tree_a, tree_b = self.get_pullable_trees()
 
36
        root_id = tree_a.get_root_id()
 
37
        tree_a.pull(tree_b.branch, stop_revision=NULL_REVISION, overwrite=True)
 
38
        self.assertEqual(root_id, tree_a.get_root_id())
 
39
 
33
40
    def test_pull(self):
34
41
        tree_a, tree_b = self.get_pullable_trees()
35
42
        tree_b.pull(tree_a.branch)
39
46
    def test_pull_overwrites(self):
40
47
        tree_a, tree_b = self.get_pullable_trees()
41
48
        tree_b.commit('foo', rev_id='B')
42
 
        self.assertEqual(['B'], tree_b.branch.revision_history())
 
49
        self.assertEqual('B', tree_b.branch.last_revision())
43
50
        tree_b.pull(tree_a.branch, overwrite=True)
44
51
        self.assertTrue(tree_b.branch.repository.has_revision('A'))
45
52
        self.assertTrue(tree_b.branch.repository.has_revision('B'))
90
97
                    self.workingtree_format)
91
98
        trunk = self.make_branch_deleting_dir('trunk')
92
99
        work = trunk.bzrdir.sprout('work', revision_id='2').open_workingtree()
93
 
        work.branch.get_config().set_user_option(
 
100
        work.branch.get_config_stack().set(
94
101
            'bzr.transform.orphan_policy', 'move')
95
102
        # Add some unversioned files in dir
96
103
        self.build_tree(['work/dir/foo',