~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_shelf.py

  • Committer: Vincent Ladeuil
  • Date: 2010-10-08 10:50:51 UTC
  • mfrom: (5050.17.31 2.2.2-dev)
  • mto: This revision was merged to the branch mainline in revision 5474.
  • Revision ID: v.ladeuil+lp@free.fr-20101008105051-xd4knkrohzclffic
Merge 2.2 into trunk including fixes for bug #651706 and bug #646133

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008-2011 Canonical Ltd
 
1
# Copyright (C) 2008, 2009, 2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
623
623
                              shelf_file)
624
624
        self.assertEqual('Shelf corrupt.', str(e))
625
625
 
626
 
    def test_unshelve_subdir_in_now_removed_dir(self):
627
 
        tree = self.make_branch_and_tree('.')
628
 
        self.addCleanup(tree.lock_write().unlock)
629
 
        self.build_tree(['dir/', 'dir/subdir/', 'dir/subdir/foo'])
630
 
        tree.add(['dir'], ['dir-id'])
631
 
        tree.commit('versioned dir')
632
 
        tree.add(['dir/subdir', 'dir/subdir/foo'], ['subdir-id', 'foo-id'])
633
 
        creator = shelf.ShelfCreator(tree, tree.basis_tree())
634
 
        self.addCleanup(creator.finalize)
635
 
        for change in creator.iter_shelvable():
636
 
            creator.shelve_change(change)
637
 
        shelf_manager = tree.get_shelf_manager()
638
 
        shelf_id = shelf_manager.shelve_changes(creator)
639
 
        self.failIfExists('dir/subdir')
640
 
        tree.remove(['dir'])
641
 
        unshelver = shelf_manager.get_unshelver(shelf_id)
642
 
        self.addCleanup(unshelver.finalize)
643
 
        unshelver.make_merger().do_merge()
644
 
        self.failUnlessExists('dir/subdir/foo')
645
 
        self.assertEqual('dir-id', tree.path2id('dir'))
646
 
        self.assertEqual('subdir-id', tree.path2id('dir/subdir'))
647
 
        self.assertEqual('foo-id', tree.path2id('dir/subdir/foo'))
648
 
 
649
626
 
650
627
class TestShelfManager(tests.TestCaseWithTransport):
651
628