~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to tests.py

  • Committer: Michael Ellerman
  • Date: 2006-03-12 14:12:00 UTC
  • mto: (325.1.2 bzrtools) (0.3.1 shelf-dev)
  • mto: This revision was merged to the branch mainline in revision 334.
  • Revision ID: michael@ellerman.id.au-20060312141200-0e20055c572dfc23
Add support for unshelving -p0 patches, for backward compatibility.

Show diffs side-by-side

added added

removed removed

Lines of Context:
341
341
 
342
342
        # Shelve should work now
343
343
        self.run_bzr('shelve', '--all', retcode=0)
 
344
 
 
345
    def test_shelf_p0_patch(self):
 
346
        tree = self.make_branch_and_tree('.')
 
347
 
 
348
        self.__create_and_add_test_file(tree)
 
349
 
 
350
        # Run a benign shelf command to setup .shelf for us
 
351
        self.run_bzr('shelf', 'ls', retcode=0)
 
352
 
 
353
        # Fake a -p0 shelved patch
 
354
        diff = self.DIFF_1
 
355
        diff = diff.replace('a/', '')
 
356
        diff = diff.replace('b/', '')
 
357
        open('.shelf/shelves/default/00', 'w').write(diff)
 
358
 
 
359
        # This should work
 
360
        self.run_bzr('unshelve', '--all', retcode=0)
 
361
 
 
362
        # Check the diff is right
 
363
        self.assertEqual(self.capture('diff', retcode=1),
 
364
            self.DIFF_HEADER + self.DIFF_1 + '\n')