/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/selftest/blackbox.py

  • Committer: Martin Pool
  • Date: 2005-08-01 20:25:24 UTC
  • Revision ID: mbp@sourcefrog.net-20050801202524-cc49f230ffa9c4e3
- correctly exclude root_directory from search for added files
  in compare_trees

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
 
50
50
 
51
51
 
52
 
class MvCommand(BzrTestBase):
53
 
    def runbzr(self):
54
 
        """Test two modes of operation for mv"""
55
 
        b = Branch('.', init=True)
56
 
        self.build_tree(['a', 'c', 'subdir/'])
57
 
        self.run_bzr('mv', 'a', 'b')
58
 
        self.run_bzr('mv', 'b', 'subdir')
59
 
        self.run_bzr('mv', 'subdir/b', 'a')
60
 
        self.run_bzr('mv', 'a', 'b', 'subdir')
61
 
        self.run_bzr('mv', 'subdir/a', 'subdir/newa')
62
 
 
63
 
 
64
 
 
65
52
class TestVersion(BzrTestBase):
66
53
    """Check output from version command and master option is reasonable"""
67
54
    def runTest(self):
354
341
 
355
342
 
356
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
 
357
426
class RevertCommand(ExternalBase):
358
427
    def runTest(self):
359
428
        self.runbzr('init')