~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_add.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-03-07 10:45:44 UTC
  • mfrom: (2321.1.2 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20070307104544-59e3e6358e4bdb29
(robertc) Merge dirstate and subtrees. (Robert Collins, Martin Pool, Aaaron Bentley, John A Meinel, James Westby)

Show diffs side-by-side

added added

removed removed

Lines of Context:
111
111
        
112
112
        self.build_tree(['src/foo.c'])
113
113
        
 
114
        # add with no arguments in a subdirectory gets only files below that
 
115
        # subdirectory
114
116
        chdir('src')
115
117
        self.run_bzr('add')
116
 
        
117
118
        self.assertEquals(self.capture('unknowns'), 'README\n')
118
 
        eq(len(t.read_working_inventory()), 3)
 
119
        # reopen to see the new changes
 
120
        t = t.bzrdir.open_workingtree()
 
121
        versioned = [path for path, entry in t.iter_entries_by_dir()]
 
122
        self.assertEquals(versioned,
 
123
            ['', 'src', 'src/foo.c'])
119
124
                
 
125
        # add from the parent directory should pick up all file names
120
126
        chdir('..')
121
127
        self.run_bzr('add')
122
128
        self.assertEquals(self.capture('unknowns'), '')
143
149
                             'added b w/ file id from b\n'
144
150
                             'added b/c w/ file id from b/c\n',
145
151
                             out)
146
 
 
147
 
        new_tree.read_working_inventory()
 
152
        new_tree = new_tree.bzrdir.open_workingtree()
148
153
        self.assertEqual(base_tree.path2id('a'), new_tree.path2id('a'))
149
154
        self.assertEqual(base_tree.path2id('b'), new_tree.path2id('b'))
150
155
        self.assertEqual(base_tree.path2id('b/c'), new_tree.path2id('b/c'))
165
170
                             'added d w/ file id from b/d\n',
166
171
                             out)
167
172
 
168
 
        new_tree.read_working_inventory()
 
173
        new_tree = new_tree.bzrdir.open_workingtree()
169
174
        self.assertEqual(base_tree.path2id('b/c'), new_tree.path2id('c'))
170
175
        self.assertEqual(base_tree.path2id('b/d'), new_tree.path2id('d'))
171
176