275
275
self.run_bzr('shelve', '--all', 'test_file', retcode=0)
276
276
self.run_bzr('shelve', '--all', 'test_file2', retcode=0)
278
# Check the shelf is right
279
shelf = open(os.path.join(tree.branch.base,
280
'.shelf/shelves/default/00')).read()
281
shelf = shelf[shelf.index('\n') + 1:] # skip the message
282
self.assertEqual(shelf, self.DIFF_1)
279
285
self.run_bzr('shelf', 'delete', '00', retcode=0)
281
# We should now have 01 but not 00
287
# We should now have 01 but not 00, but we should have 00~
282
288
self.assertFalse(os.path.exists('.shelf/shelves/default/00'))
289
self.assertTrue(os.path.exists('.shelf/shelves/default/00~'))
283
290
self.assertTrue(os.path.exists('.shelf/shelves/default/01'))
292
# Check the backup is right
293
shelf = open(os.path.join(tree.branch.base,
294
'.shelf/shelves/default/00~')).read()
295
shelf = shelf[shelf.index('\n') + 1:] # skip the message
296
self.assertEqual(shelf, self.DIFF_1)
286
299
list = self.capture('shelf ls', retcode=0).split('\n')
287
300
for line in list: