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")
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")
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")
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" \
284
284
result2 = self.run_bzr("status", "--short", "-r", "0..")[0]
285
285
self.assertEquals(result2, result)
287
def assertStatusContains(self, pattern):
288
"""Run status, and assert it contains the given pattern"""
289
result = self.run_bzr("status", "--short")[0]
290
self.assertContainsRe(result, pattern)
292
def test_kind_change_short(self):
293
tree = self.make_branch_and_tree('.')
294
self.build_tree(['file'])
296
tree.commit('added file')
298
self.build_tree(['file/'])
299
self.assertStatusContains('K file => file/')
300
tree.rename_one('file', 'directory')
301
self.assertStatusContains('RK file => directory/')
303
self.assertStatusContains('RD file => directory')
288
306
class TestStatusEncodings(TestCaseWithTransport):