~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Rory Yorke
  • Date: 2010-10-20 14:38:53 UTC
  • mto: This revision was merged to the branch mainline in revision 5519.
  • Revision ID: rory.yorke@gmail.com-20101020143853-9kfd2ldcjfroh8jw
Show missing files in bzr status (bug 134168).

"bzr status" will now show missing files, that is, those added with "bzr
add" and then removed by non bzr means (e.g., rm).

Blackbox tests were added for this case, and tests were also added to
test_delta, since the implementation change is in bzrlib.delta.

Might also affect bug 189709.

Show diffs side-by-side

added added

removed removed

Lines of Context:
203
203
        wt = self.make_branch_and_tree('.')
204
204
        b = wt.branch
205
205
 
206
 
        self.build_tree(['directory/','directory/hello.c', 'bye.c','test.c','dir2/'])
 
206
        self.build_tree(['directory/','directory/hello.c',
 
207
                         'bye.c','test.c','dir2/',
 
208
                         'missing.c'])
207
209
        wt.add('directory')
208
210
        wt.add('test.c')
209
211
        wt.commit('testing')
 
212
        wt.add('missing.c')
 
213
        unlink('missing.c')
210
214
 
211
215
        self.assertStatus([
 
216
                'missing:\n',
 
217
                '  missing.c\n',
212
218
                'unknown:\n',
213
219
                '  bye.c\n',
214
220
                '  dir2/\n',
219
225
        self.assertStatus([
220
226
                '?   bye.c\n',
221
227
                '?   dir2/\n',
 
228
                '+!  missing.c\n',
222
229
                '?   directory/hello.c\n'
223
230
                ],
224
231
                wt, short=True)
261
268
        tof.seek(0)
262
269
        self.assertEquals(tof.readlines(), ['+N  test.c\n'])
263
270
 
 
271
        tof = StringIO()
 
272
        show_tree_status(wt, specific_files=['missing.c'], to_file=tof)
 
273
        tof.seek(0)
 
274
        self.assertEquals(tof.readlines(),
 
275
                          ['missing:\n',
 
276
                           '  missing.c\n'])
 
277
 
 
278
        tof = StringIO()
 
279
        show_tree_status(wt, specific_files=['missing.c'], to_file=tof,
 
280
                         short=True)
 
281
        tof.seek(0)
 
282
        self.assertEquals(tof.readlines(),
 
283
                          ['+!  missing.c\n'])
 
284
 
264
285
    def test_specific_files_conflicts(self):
265
286
        tree = self.make_branch_and_tree('.')
266
287
        self.build_tree(['dir2/'])