~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to tests.py

  • Committer: Michael Ellerman
  • Date: 2006-03-22 04:40:36 UTC
  • mto: (0.3.1 shelf-dev)
  • mto: This revision was merged to the branch mainline in revision 367.
  • Revision ID: michael@ellerman.id.au-20060322044036-fc9b997116cd6f52
Backup the shelved patch when we delete in "shelf delete".

Show diffs side-by-side

added added

removed removed

Lines of Context:
275
275
        self.run_bzr('shelve', '--all', 'test_file', retcode=0)
276
276
        self.run_bzr('shelve', '--all', 'test_file2', retcode=0)
277
277
 
 
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)
 
283
 
278
284
        # Delete 00
279
285
        self.run_bzr('shelf', 'delete', '00', retcode=0)
280
286
 
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'))
284
291
 
 
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)
 
297
 
285
298
        # Check ls works
286
299
        list = self.capture('shelf ls', retcode=0).split('\n')
287
300
        for line in list: