~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/blackbox.py

  • Committer: Martin Pool
  • Date: 2005-08-01 20:39:59 UTC
  • Revision ID: mbp@sourcefrog.net-20050801203959-27199956eab14ba6
- remove old and largely recreated blackbox tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
341
341
 
342
342
 
343
343
 
344
 
        chdir('..')
345
 
        chdir('..')
346
 
        progress('branch')
347
 
        assert os.path.exists('branch1')
348
 
        assert not os.path.exists('branch2')
349
 
        # Can't create a branch if it already exists
350
 
        runbzr('branch branch1', retcode=1)
351
 
        # Can't create a branch if its parent doesn't exist
352
 
        runbzr('branch /unlikely/to/exist', retcode=1)
353
 
        runbzr('branch branch1 branch2')
354
 
        assert exists('branch2')
355
 
        assert exists('branch2/sub1')
356
 
        assert exists('branch2/sub1/hello.txt')
357
 
        
358
 
        runbzr('branch --revision 0 branch1 branch3')
359
 
        assert not exists('branch3/sub1/hello.txt')
360
 
        runbzr('branch --revision 0..3 branch1 branch4', retcode=1)
361
 
 
362
 
        progress("pull")
363
 
        chdir('branch1')
364
 
        runbzr('pull', retcode=1)
365
 
        runbzr('pull ../branch2')
366
 
        chdir('.bzr')
367
 
        runbzr('pull')
368
 
        runbzr('commit --unchanged -m empty')
369
 
        runbzr('pull')
370
 
        chdir('../../branch2')
371
 
        runbzr('pull')
372
 
        runbzr('commit --unchanged -m empty')
373
 
        chdir('../branch1')
374
 
        runbzr('commit --unchanged -m empty')
375
 
        runbzr('pull', retcode=1)
376
 
        chdir ('..')
377
 
 
378
 
        progress('status after remove')
379
 
        mkdir('status-after-remove')
380
 
        # see mail from William Dodé, 2005-05-25
381
 
        # $ bzr init; touch a; bzr add a; bzr commit -m "add a"
382
 
        #     * looking for changes...
383
 
        #     added a
384
 
        #     * commited r1
385
 
        #     $ bzr remove a
386
 
        #     $ bzr status
387
 
        #     bzr: local variable 'kind' referenced before assignment
388
 
        #     at /vrac/python/bazaar-ng/bzrlib/diff.py:286 in compare_trees()
389
 
        #     see ~/.bzr.log for debug information
390
 
        chdir('status-after-remove')
391
 
        runbzr('init')
392
 
        file('a', 'w').write('foo')
393
 
        runbzr('add a')
394
 
        runbzr(['commit', '-m', 'add a'])
395
 
        runbzr('remove a')
396
 
        runbzr('status')
397
 
 
398
 
        chdir('..')
399
 
 
400
 
 
401
 
 
402
 
        progress("recursive and non-recursive add")
403
 
        mkdir('no-recurse')
404
 
        chdir('no-recurse')
405
 
        runbzr('init')
406
 
        mkdir('foo')
407
 
        fp = os.path.join('foo', 'test.txt')
408
 
        f = file(fp, 'w')
409
 
        f.write('hello!\n')
410
 
        f.close()
411
 
        runbzr('add --no-recurse foo')
412
 
        runbzr('file-id foo')
413
 
        runbzr('file-id ' + fp, 1)      # not versioned yet
414
 
        runbzr('commit -m add-dir-only')
415
 
 
416
 
        self.runbzr('file-id ' + fp, 1)      # still not versioned 
417
 
 
418
 
        self.runbzr('add foo')
419
 
        self.runbzr('file-id ' + fp)
420
 
        self.runbzr('commit -m add-sub-file')
421
 
 
422
 
        chdir('..')
423
 
 
424
 
 
425
 
 
426
344
class RevertCommand(ExternalBase):
427
345
    def runTest(self):
428
346
        self.runbzr('init')