~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_shelve.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-01-29 05:07:43 UTC
  • mfrom: (3964.2.1 shelve-test-warnings)
  • Revision ID: pqm@pqm.ubuntu.com-20090129050743-a1sxceuybyrjfv8k
Fix "LockableFiles ... was gc'd while unlocked" warning in
        blackbox.test_shelve. (Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
        err = self.run_bzr('shelve --list')[1]
27
27
        self.assertEqual('No shelved changes.\n', err)
28
28
 
 
29
    def make_creator(self, tree):
 
30
        creator = shelf.ShelfCreator(tree, tree.basis_tree(), [])
 
31
        self.addCleanup(creator.finalize)
 
32
        return creator
 
33
 
29
34
    def test_shelve_one(self):
30
35
        tree = self.make_branch_and_tree('.')
31
 
        creator = shelf.ShelfCreator(tree, tree.basis_tree(), [])
 
36
        creator = self.make_creator(tree)
32
37
        shelf_id = tree.get_shelf_manager().shelve_changes(creator, 'Foo')
33
38
        out, err = self.run_bzr('shelve --list', retcode=1)
34
39
        self.assertEqual('', err)
36
41
 
37
42
    def test_shelve_no_message(self):
38
43
        tree = self.make_branch_and_tree('.')
39
 
        creator = shelf.ShelfCreator(tree, tree.basis_tree(), [])
 
44
        creator = self.make_creator(tree)
40
45
        shelf_id = tree.get_shelf_manager().shelve_changes(creator)
41
46
        out, err = self.run_bzr('shelve --list', retcode=1)
42
47
        self.assertEqual('', err)
44
49
 
45
50
    def test_shelf_order(self):
46
51
        tree = self.make_branch_and_tree('.')
47
 
        creator = shelf.ShelfCreator(tree, tree.basis_tree(), [])
 
52
        creator = self.make_creator(tree)
48
53
        tree.get_shelf_manager().shelve_changes(creator, 'Foo')
49
 
        creator = shelf.ShelfCreator(tree, tree.basis_tree(), [])
 
54
        creator = self.make_creator(tree)
50
55
        tree.get_shelf_manager().shelve_changes(creator, 'Bar')
51
56
        out, err = self.run_bzr('shelve --list', retcode=1)
52
57
        self.assertEqual('', err)