~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

(mbp) status shows missing newly-added files (Rory Yorke)

Show diffs side-by-side

added added

removed removed

Lines of Context:
211
211
        wt = self.make_branch_and_tree('.')
212
212
        b = wt.branch
213
213
 
214
 
        self.build_tree(['directory/','directory/hello.c', 'bye.c','test.c','dir2/'])
 
214
        self.build_tree(['directory/','directory/hello.c',
 
215
                         'bye.c','test.c','dir2/',
 
216
                         'missing.c'])
215
217
        wt.add('directory')
216
218
        wt.add('test.c')
217
219
        wt.commit('testing')
 
220
        wt.add('missing.c')
 
221
        unlink('missing.c')
218
222
 
219
223
        self.assertStatus([
 
224
                'missing:\n',
 
225
                '  missing.c\n',
220
226
                'unknown:\n',
221
227
                '  bye.c\n',
222
228
                '  dir2/\n',
227
233
        self.assertStatus([
228
234
                '?   bye.c\n',
229
235
                '?   dir2/\n',
 
236
                '+!  missing.c\n',
230
237
                '?   directory/hello.c\n'
231
238
                ],
232
239
                wt, short=True)
269
276
        tof.seek(0)
270
277
        self.assertEquals(tof.readlines(), ['+N  test.c\n'])
271
278
 
 
279
        tof = StringIO()
 
280
        show_tree_status(wt, specific_files=['missing.c'], to_file=tof)
 
281
        tof.seek(0)
 
282
        self.assertEquals(tof.readlines(),
 
283
                          ['missing:\n',
 
284
                           '  missing.c\n'])
 
285
 
 
286
        tof = StringIO()
 
287
        show_tree_status(wt, specific_files=['missing.c'], to_file=tof,
 
288
                         short=True)
 
289
        tof.seek(0)
 
290
        self.assertEquals(tof.readlines(),
 
291
                          ['+!  missing.c\n'])
 
292
 
272
293
    def test_specific_files_conflicts(self):
273
294
        tree = self.make_branch_and_tree('.')
274
295
        self.build_tree(['dir2/'])