/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/versioning.py

  • Committer: Martin Pool
  • Date: 2005-07-25 18:49:38 UTC
  • Revision ID: mbp@sourcefrog.net-20050725184938-108b666ca4ea87c4
- refactor SubdirAdd tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
        
68
68
class SubdirCommit(InTempDir):
69
69
    def runTest(self):
70
 
        """Various commits from a subdirectory"""
 
70
        pass
 
71
        
 
72
        
 
73
class SubdirAdd(InTempDir):
 
74
    def runTest(self):
 
75
        """Add in subdirectory should add only things from there down"""
71
76
        
72
77
        from bzrlib.branch import Branch
73
78
        from bzrlib.commands import run_bzr
78
83
        chdir = os.chdir
79
84
        
80
85
        b = Branch('.', init=True)
81
 
        self.build_tree(['src/', 'src/foo.c', 'README'])
 
86
        self.build_tree(['src/', 'README'])
82
87
        
83
88
        eq(sorted(b.unknowns()),
84
 
                         ['README', 'src'])
85
 
        
86
 
        eq(run_bzr(['version']), 0)
87
 
        
88
 
        eq(run_bzr(['add']), 0)
89
 
        
90
 
        eq(run_bzr(['commit', '-m', 'initial tree']), 0)
91
 
        
92
 
        inv = b.get_revision_inventory(b.lookup_revision(1))
93
 
        
94
 
        eq(len(inv), 4)   # including root
95
 
 
96
 
        file('toplevel', 'w').write('top level file')
 
89
           ['README', 'src'])
 
90
        
 
91
        eq(run_bzr(['add', 'src']), 0)
 
92
        
 
93
        self.build_tree(['src/foo.c'])
 
94
        
97
95
        chdir('src')
98
 
        file('more.c', 'w').write('more content')
99
96
        eq(run_bzr(['add']), 0)
100
97
        
101
 
        ass(b.inventory.path2id('src/more.c'))
102
 
        eq(list(b.unknowns()), ['toplevel'])
 
98
        eq(sorted(b.unknowns()), 
 
99
           ['README'])
 
100
        eq(len(b.inventory), 3)
 
101
                
 
102
        chdir('..')
 
103
        eq(run_bzr(['add']), 0)
 
104
        eq(list(b.unknowns()), [])
 
105
           
103
106
 
104
107
 
105
108
TEST_CLASSES = [