~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/blackbox.py

merge up with HEAD and with test-fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
"""
28
28
 
29
29
import sys
 
30
import os
30
31
 
31
32
from bzrlib.selftest import TestCaseInTempDir, BzrTestBase
32
33
from bzrlib.branch import Branch
122
123
        assert file('.bzrignore', 'rb').read() == '*.blah\ngarh\n'
123
124
 
124
125
    def test_revert(self):
125
 
        import os
126
126
        self.runbzr('init')
127
127
 
128
128
        file('hello', 'wt').write('foo')
196
196
 
197
197
    def test_merge(self):
198
198
        from bzrlib.branch import Branch
199
 
        import os
200
199
        
201
200
        os.mkdir('a')
202
201
        os.chdir('a')
203
 
 
204
202
        self.example_branch()
205
203
        os.chdir('..')
206
204
        self.runbzr('branch a b')
219
217
        a = Branch('.')
220
218
        b = Branch('../b')
221
219
        a.get_revision_xml(b.last_patch())
222
 
 
223
220
        self.log('pending merges: %s', a.pending_merges())
224
221
        #        assert a.pending_merges() == [b.last_patch()], "Assertion %s %s" \
225
222
        #        % (a.pending_merges(), b.last_patch())
226
223
 
 
224
    def test_pull(self):
 
225
        """Pull changes from one branch to another."""
 
226
        os.mkdir('a')
 
227
        os.chdir('a')
 
228
 
 
229
        self.example_branch()
 
230
        os.chdir('..')
 
231
        self.runbzr('branch a b')
 
232
        os.chdir('b')
 
233
        self.runbzr('commit -m blah --unchanged')
 
234
        os.chdir('../a')
 
235
        a = Branch('.')
 
236
        b = Branch('../b')
 
237
        assert a.revision_history() == b.revision_history()[:-1]
 
238
        self.runbzr('pull ../b')
 
239
        assert a.revision_history() == b.revision_history()
 
240
        self.runbzr('commit -m blah2 --unchanged')
 
241
        os.chdir('../b')
 
242
        self.runbzr('commit -m blah3 --unchanged')
 
243
        self.runbzr('pull ../a', retcode=1)
 
244
        os.chdir('../a')
 
245
        self.runbzr('merge ../b')
 
246
        self.runbzr('commit -m blah4 --unchanged')
 
247
        os.chdir('../b')
 
248
        self.runbzr('pull ../a')
 
249
        assert a.revision_history()[-1] == b.revision_history()[-1]
 
250
        
227
251
 
228
252
    def test_add_reports(self):
229
253
        """add command prints the names of added files."""
252
276
    def test_bzr(self):
253
277
        from os import chdir, mkdir
254
278
        from os.path import exists
255
 
        import os
256
279
 
257
280
        runbzr = self.runbzr
258
281
        backtick = self.backtick