~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to tests/test_prepare_shelf.py

  • Committer: Aaron Bentley
  • Date: 2008-10-06 19:42:04 UTC
  • mto: (0.15.1 unshelve)
  • mto: This revision was merged to the branch mainline in revision 3820.
  • Revision ID: aaron@aaronbentley.com-20081006194204-gf49nf3ffb8lgy33
Use explicit target in ShelfCreator

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
        tree.add(['foo'], ['foo-id'])
29
29
        tree.commit('foo')
30
30
        tree.rename_one('foo', 'bar')
31
 
        creator = prepare_shelf.ShelfCreator(tree)
 
31
        creator = prepare_shelf.ShelfCreator(tree, tree.basis_tree())
32
32
        self.addCleanup(creator.finalize)
33
33
        self.assertEqual([('rename', 'foo-id', 'foo', 'bar')], list(creator))
34
34
        creator.shelve_rename('foo-id')
45
45
        tree.add(['foo', 'bar', 'foo/baz'], ['foo-id', 'bar-id', 'baz-id'])
46
46
        tree.commit('foo')
47
47
        tree.rename_one('foo/baz', 'bar/baz')
48
 
        creator = prepare_shelf.ShelfCreator(tree)
 
48
        creator = prepare_shelf.ShelfCreator(tree, tree.basis_tree())
49
49
        self.addCleanup(creator.finalize)
50
50
        self.assertEqual([('rename', 'baz-id', 'foo/baz', 'bar/baz')],
51
51
                         list(creator))
74
74
        tree.add('foo', 'foo-id')
75
75
        tree.commit('Committed foo')
76
76
        self.build_tree_contents([('foo', 'b\na\nc\n')])
77
 
        creator = prepare_shelf.ShelfCreator(tree)
 
77
        creator = prepare_shelf.ShelfCreator(tree, tree.basis_tree())
78
78
        self.addCleanup(creator.finalize)
79
79
        self.assertEqual([('modify text', 'foo-id')], list(creator))
80
80
        creator.shelve_text('foo-id', 'a\nc\n')
89
89
        tree.commit('Empty tree')
90
90
        self.build_tree_contents([('foo', 'a\n'), ('bar/',)])
91
91
        tree.add(['foo', 'bar'], ['foo-id', 'bar-id'])
92
 
        creator = prepare_shelf.ShelfCreator(tree)
 
92
        creator = prepare_shelf.ShelfCreator(tree, tree.basis_tree())
93
93
        self.addCleanup(creator.finalize)
94
94
        self.assertEqual([('add file', 'bar-id', 'directory'),
95
95
                          ('add file', 'foo-id', 'file')],
117
117
        tree.commit('Empty tree')
118
118
        os.symlink('bar', 'foo')
119
119
        tree.add('foo', 'foo-id')
120
 
        creator = prepare_shelf.ShelfCreator(tree)
 
120
        creator = prepare_shelf.ShelfCreator(tree, tree.basis_tree())
121
121
        self.addCleanup(creator.finalize)
122
122
        self.assertEqual([('add file', 'foo-id', 'symlink')], list(creator))
123
123
        creator.shelve_creation('foo-id', 'symlink')
131
131
        tree = self.make_branch_and_tree('tree')
132
132
        self.build_tree(['tree/foo'])
133
133
        tree.add('foo', 'foo-id')
134
 
        creator = prepare_shelf.ShelfCreator(tree)
 
134
        creator = prepare_shelf.ShelfCreator(tree, tree.basis_tree())
135
135
        list(creator)
136
136
        creator.shelve_creation('foo-id', 'file')
137
137
        filename = creator.write_shelf()