/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/tests/blackbox/test_status.py

Use new-style output for status

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
            ],
77
77
            wt)
78
78
        self.assertStatus([
79
 
                '?  bye.c\n',
80
 
                '?  hello.c\n',
 
79
                '?   bye.c\n',
 
80
                '?   hello.c\n',
81
81
            ],
82
82
            wt, short=True)
83
83
 
94
94
            ],
95
95
            wt)
96
96
        self.assertStatus([
97
 
                '?  bye.c\n',
98
 
                '?  hello.c\n',
99
 
                'P  pending@pending-0-0\n',
 
97
                '?   bye.c\n',
 
98
                '?   hello.c\n',
 
99
                'P   pending@pending-0-0\n',
100
100
            ],
101
101
            wt, short=True)
102
102
 
174
174
                wt)
175
175
 
176
176
        self.assertStatus([
177
 
                '?  bye.c\n',
178
 
                '?  dir2\n',
179
 
                '?  directory/hello.c\n'
 
177
                '?   bye.c\n',
 
178
                '?   dir2\n',
 
179
                '?   directory/hello.c\n'
180
180
                ],
181
181
                wt, short=True)
182
182
 
197
197
        show_tree_status(wt, specific_files=['directory'], to_file=tof,
198
198
                         short=True)
199
199
        tof.seek(0)
200
 
        self.assertEquals(tof.readlines(), ['?  directory/hello.c\n'])
 
200
        self.assertEquals(tof.readlines(), ['?   directory/hello.c\n'])
201
201
 
202
202
        tof = StringIO()
203
203
        show_tree_status(wt, specific_files=['dir2'], to_file=tof)
209
209
        tof = StringIO()
210
210
        show_tree_status(wt, specific_files=['dir2'], to_file=tof, short=True)
211
211
        tof.seek(0)
212
 
        self.assertEquals(tof.readlines(), ['?  dir2\n'])
 
212
        self.assertEquals(tof.readlines(), ['?   dir2\n'])
213
213
 
214
214
    def test_status_nonexistent_file(self):
215
215
        # files that don't exist in either the basis tree or working tree
258
258
        result = self.run_bzr("status")[0]
259
259
        self.assert_("unknown:\n  hello.txt\n" in result, result)
260
260
        result = self.run_bzr("status","--short")[0]
261
 
        self.assert_("?  hello.txt\n" in result, result)
 
261
        self.assertContainsRe(result, "[?]   hello.txt\n")
262
262
 
263
263
        self.run_bzr("add", "hello.txt")
264
264
        result = self.run_bzr("status")[0]
265
 
        self.assert_("added:\n  hello.txt\n" in result, result)
 
265
        self.assertContainsRe(result, "added:\n  hello.txt\n")
266
266
        result = self.run_bzr("status","--short")[0]
267
 
        self.assert_("A  hello.txt\n" in result, result)
 
267
        self.assertContainsRe(result, "[+]N  hello.txt\n")
268
268
 
269
269
        self.run_bzr("commit", "-m", "added")
270
270
        result = self.run_bzr("status", "-r", "0..1")[0]
271
 
        self.assert_("added:\n  hello.txt\n" in result, result)
 
271
        self.assertContainsRe(result, "added:\n  hello.txt\n")
272
272
        result = self.run_bzr("status", "--short", "-r", "0..1")[0]
273
 
        self.assert_("A  hello.txt\n" in result, result)
 
273
        self.assertContainsRe(result, "[+]N  hello.txt\n")
274
274
 
275
275
        self.build_tree(['world.txt'])
276
276
        result = self.run_bzr("status", "-r", "0")[0]
277
 
        self.assert_("added:\n  hello.txt\n" \
278
 
                     "unknown:\n  world.txt\n" in result, result)
 
277
        self.assertContainsRe(result, "added:\n  hello.txt\n" \
 
278
                                      "unknown:\n  world.txt\n")
279
279
        result2 = self.run_bzr("status", "-r", "0..")[0]
280
280
        self.assertEquals(result2, result)
281
281
        result = self.run_bzr("status", "--short", "-r", "0")[0]
282
 
        self.assert_("A  hello.txt\n" \
283
 
                     "?  world.txt\n" in result, result)
 
282
        self.assertContainsRe(result, "[+]N  hello.txt\n" \
 
283
                                      "[?]   world.txt\n")
284
284
        result2 = self.run_bzr("status", "--short", "-r", "0..")[0]
285
285
        self.assertEquals(result2, result)
286
286