1
# Copyright (C) 2008, 2009, 2010 Canonical Ltd
1
# Copyright (C) 2008 Canonical Ltd
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
108
108
creator.shelve_change(('rename', 'baz-id', 'foo/baz', 'bar/baz'))
109
109
self.check_shelve_move(creator, tree)
111
def test_shelve_changed_root_id(self):
112
tree = self.make_branch_and_tree('.')
113
self.build_tree(['foo'])
114
tree.set_root_id('first-root-id')
115
tree.add(['foo'], ['foo-id'])
117
tree.set_root_id('second-root-id')
118
tree.lock_tree_write()
119
self.addCleanup(tree.unlock)
120
creator = shelf.ShelfCreator(tree, tree.basis_tree())
121
self.addCleanup(creator.finalize)
122
self.expectFailure('shelf doesn\'t support shelving root changes yet',
124
('delete file', 'first-root-id', 'directory', ''),
125
('add file', 'second-root-id', 'directory', ''),
126
('rename', 'foo-id', u'foo', u'foo'),
127
], list(creator.iter_shelvable()))
129
self.assertEqual([('delete file', 'first-root-id', 'directory', ''),
130
('add file', 'second-root-id', 'directory', ''),
131
('rename', 'foo-id', u'foo', u'foo'),
132
], list(creator.iter_shelvable()))
134
111
def assertShelvedFileEqual(self, expected_content, creator, file_id):
135
112
s_trans_id = creator.shelf_transform.trans_id_file_id(file_id)
136
113
shelf_file = creator.shelf_transform._limbo_name(s_trans_id)