~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/blackbox.py

  • Committer: Martin Pool
  • Date: 2005-09-12 01:29:49 UTC
  • mto: (1092.2.12) (974.1.76) (1185.8.2)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: mbp@sourcefrog.net-20050912012949-73a539d3f2542173
- patch from mpe to automatically add parent directories

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
"""
28
28
 
29
29
import sys
30
 
import os
31
30
 
32
31
from bzrlib.selftest import TestCaseInTempDir, BzrTestBase
33
32
from bzrlib.branch import Branch
123
122
        assert file('.bzrignore', 'rb').read() == '*.blah\ngarh\n'
124
123
 
125
124
    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
197
198
        
198
199
        os.mkdir('a')
199
200
        os.chdir('a')
221
222
        #        assert a.pending_merges() == [b.last_patch()], "Assertion %s %s" \
222
223
        #        % (a.pending_merges(), b.last_patch())
223
224
 
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
 
        self.runbzr('pull', retcode=1)
231
 
        self.runbzr('missing', retcode=1)
232
 
        self.runbzr('missing .')
233
 
        self.runbzr('missing')
234
 
        self.runbzr('pull')
235
 
        self.runbzr('pull /', retcode=1)
236
 
        self.runbzr('pull')
237
 
 
238
 
        os.chdir('..')
239
 
        self.runbzr('branch a b')
240
 
        os.chdir('b')
241
 
        self.runbzr('pull')
242
 
        self.runbzr('commit -m blah --unchanged')
243
 
        os.chdir('../a')
244
 
        a = Branch('.')
245
 
        b = Branch('../b')
246
 
        assert a.revision_history() == b.revision_history()[:-1]
247
 
        self.runbzr('pull ../b')
248
 
        assert a.revision_history() == b.revision_history()
249
 
        self.runbzr('commit -m blah2 --unchanged')
250
 
        os.chdir('../b')
251
 
        self.runbzr('commit -m blah3 --unchanged')
252
 
        self.runbzr('pull ../a', retcode=1)
253
 
        os.chdir('../a')
254
 
        self.runbzr('merge ../b')
255
 
        self.runbzr('commit -m blah4 --unchanged')
256
 
        os.chdir('../b')
257
 
        self.runbzr('pull ../a')
258
 
        assert a.revision_history()[-1] == b.revision_history()[-1]
259
 
        
260
225
 
261
226
    def test_add_reports(self):
262
227
        """add command prints the names of added files."""
285
250
    def test_bzr(self):
286
251
        from os import chdir, mkdir
287
252
        from os.path import exists
 
253
        import os
288
254
 
289
255
        runbzr = self.runbzr
290
256
        backtick = self.backtick