~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/blackbox.py

- merge improved merge base selection from aaron
aaron.bentley@utoronto.ca-20050912025534-43d7275dd948e4ad

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')
194
194
 
195
195
    def test_merge(self):
196
196
        from bzrlib.branch import Branch
197
 
        import os
198
197
        
199
198
        os.mkdir('a')
200
199
        os.chdir('a')
222
221
        #        assert a.pending_merges() == [b.last_patch()], "Assertion %s %s" \
223
222
        #        % (a.pending_merges(), b.last_patch())
224
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
        
225
251
 
226
252
    def test_add_reports(self):
227
253
        """add command prints the names of added files."""
250
276
    def test_bzr(self):
251
277
        from os import chdir, mkdir
252
278
        from os.path import exists
253
 
        import os
254
279
 
255
280
        runbzr = self.runbzr
256
281
        backtick = self.backtick