~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_update.py

  • Committer: Robert Collins
  • Date: 2006-03-05 02:20:07 UTC
  • mto: This revision was merged to the branch mainline in revision 1590.
  • Revision ID: robertc@robertcollins.net-20060305022007-53e5907d083453e8
Local commits appear to be working properly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
from bzrlib.tests import TestSkipped
23
23
from bzrlib.tests.blackbox import ExternalBase
 
24
from bzrlib.workingtree import WorkingTree
24
25
 
25
26
 
26
27
class TestUpdate(ExternalBase):
93
94
                         err.split('\n')[1:3])
94
95
        self.assertContainsRe(err, 'Text conflict in file\n')
95
96
        self.assertEqual('', out)
 
97
 
 
98
    def test_smoke_update_checkout_bound_branch_local_commits(self):
 
99
        # smoke test for doing an update of a checkout of a bound
 
100
        # branch with local commits.
 
101
        self.make_branch_and_tree('master')
 
102
        # make a bound branch
 
103
        self.run_bzr('get', '--bound', 'master', 'child')
 
104
        # check that out
 
105
        self.run_bzr('checkout', 'child', 'checkout')
 
106
        # change master
 
107
        a_file = file('master/file', 'wt')
 
108
        a_file.write('Foo')
 
109
        a_file.close()
 
110
        self.run_bzr('add', 'master')
 
111
        self.run_bzr('commit', '-m', 'add file', 'master')
 
112
        # change child
 
113
        a_file = file('child/file_b', 'wt')
 
114
        a_file.write('Foo')
 
115
        a_file.close()
 
116
        self.run_bzr('add', 'child')
 
117
        self.run_bzr('commit', '--local', '-m', 'add file_b', 'child')
 
118
        # check checkout
 
119
        a_file = file('checkout/file_c', 'wt')
 
120
        a_file.write('Foo')
 
121
        a_file.close()
 
122
        self.run_bzr('add', 'checkout')
 
123
 
 
124
        # now, update checkout ->
 
125
        # get all three files and a pending merge.
 
126
        self.run_bzr('update', 'checkout')
 
127
        wt = WorkingTree.open('checkout')
 
128
        self.assertNotEqual([], wt.pending_merges())
 
129
        self.failUnlessExists('checkout/file')
 
130
        self.failUnlessExists('checkout/file_b')
 
131
        self.failUnlessExists('checkout/file_c')
 
132
        self.assertTrue(wt.has_filename('file_c'))