~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_shelf.py

  • Committer: Aaron Bentley
  • Date: 2008-10-17 03:33:08 UTC
  • mfrom: (0.12.68 shelf-manager)
  • mto: This revision was merged to the branch mainline in revision 3823.
  • Revision ID: aaron@aaronbentley.com-20081017033308-dnke9bvbvb5vrys5
Merge shelf-manager into shelf-ui

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
import os
18
18
 
19
 
from bzrlib import pack, shelf, tests, transform
 
19
from bzrlib import errors, pack, shelf, tests, transform
20
20
 
21
21
 
22
22
class TestPrepareShelf(tests.TestCaseWithTransport):
246
246
 
247
247
class TestUnshelver(tests.TestCaseWithTransport):
248
248
 
249
 
    def test_unshelve(self):
 
249
    def test_make_merger(self):
250
250
        tree = self.make_branch_and_tree('tree')
251
251
        tree.commit('first commit')
252
252
        self.build_tree_contents([('tree/foo', 'bar')])
263
263
            creator.transform()
264
264
            shelf_file.seek(0)
265
265
            unshelver = shelf.Unshelver.from_tree_and_shelf(tree, shelf_file)
266
 
            unshelver.unshelve()
 
266
            unshelver.make_merger().do_merge()
267
267
            self.assertFileEqual('bar', 'tree/foo')
268
268
        finally:
269
269
            shelf_file.close()
287
287
        self.build_tree_contents([('tree/foo', 'z\na\nb\nc\n')])
288
288
        shelf_file.seek(0)
289
289
        unshelver = shelf.Unshelver.from_tree_and_shelf(tree, shelf_file)
290
 
        unshelver.unshelve()
 
290
        unshelver.make_merger().do_merge()
291
291
        self.assertFileEqual('z\na\nb\nd\n', 'tree/foo')
292
292
 
293
293
    def test_unshelve_base(self):
382
382
 
383
383
    def test_read_non_existant(self):
384
384
        manager = self.get_manager()
385
 
        e = self.assertRaises(shelf.NoSuchShelfId, manager.read_shelf, 1)
 
385
        e = self.assertRaises(errors.NoSuchShelfId, manager.read_shelf, 1)
386
386
        self.assertEqual('No changes are shelved with id "1".', str(e))
387
387
 
388
388
    def test_shelve_changes(self):
401
401
        shelf_id = shelf_manager.shelve_changes(creator)
402
402
        self.failIfExists('tree/foo')
403
403
        unshelver = shelf_manager.get_unshelver(shelf_id)
404
 
        unshelver.unshelve()
 
404
        unshelver.make_merger().do_merge()
405
405
        self.assertFileEqual('bar', 'tree/foo')