264
269
self.assertIs(None, tree.get_shelf_manager().last_shelf())
265
270
self.assertFileEqual(LINES_AJ, 'tree/foo')
273
def shelve_all(tree, target_revision_id):
276
target = tree.branch.repository.revision_tree(target_revision_id)
277
shelver = shelf_ui.Shelver(tree, target, auto=True,
283
def test_shelve_old_root_deleted(self):
284
tree1 = self.make_branch_and_tree('tree1')
285
tree1.commit('add root')
286
tree2 = self.make_branch_and_tree('tree2')
287
rev2 = tree2.commit('add root')
288
tree1.merge_from_branch(tree2.branch,
289
from_revision=revision.NULL_REVISION)
290
tree1.commit('Replaced root entry')
291
# This is essentially assertNotRaises(InconsistentDelta)
292
self.expectFailure('Cannot shelve replacing a root entry',
293
self.assertRaises, AssertionError,
294
self.assertRaises, errors.InconsistentDelta,
295
self.shelve_all, tree1, rev2)
297
def test_shelve_split(self):
298
outer_tree = self.make_branch_and_tree('outer')
299
outer_tree.commit('Add root')
300
inner_tree = self.make_branch_and_tree('outer/inner')
301
rev2 = inner_tree.commit('Add root')
302
outer_tree.subsume(inner_tree)
303
# This is essentially assertNotRaises(ValueError).
304
# The ValueError is 'None is not a valid file id'.
305
self.expectFailure('Cannot shelve a join back to the inner tree.',
306
self.assertRaises, AssertionError,
307
self.assertRaises, ValueError, self.shelve_all,
268
311
class TestApplyReporter(TestShelver):