342
343
wt.set_last_revision('null:')
343
344
wt.commit('A', allow_pointless=True, rev_id='A')
344
345
self.assertEqual(['A'], wt.get_parent_ids())
345
# None is aways in the branch
346
# null: is aways in the branch
346
347
wt.set_last_revision('null:')
347
348
self.assertEqual([], wt.get_parent_ids())
348
349
# and now we can set it to 'A'
349
350
# because some formats mutate the branch to set it on the tree
350
351
# we need to alter the branch to let this pass.
352
self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)),
353
wt.branch.set_revision_history, ['A', 'B'])
354
except errors.NoSuchRevision, e:
355
self.assertEqual('B', e.revision)
352
if getattr(wt.branch, "_set_revision_history", None) is None:
356
353
raise TestSkipped("Branch format does not permit arbitrary"
355
wt.branch._set_revision_history(['A', 'B'])
358
356
wt.set_last_revision('A')
359
357
self.assertEqual(['A'], wt.get_parent_ids())
360
358
self.assertRaises(errors.ReservedId, wt.set_last_revision, 'A:')
719
717
tree.add(['bloo', 'blo'])
720
718
tree.commit("blah", allow_pointless=False)
721
719
base = tree.branch.repository.revision_tree(tree.last_revision())
722
bzrdir.BzrDir.open("mine").sprout("other")
720
controldir.ControlDir.open("mine").sprout("other")
723
721
with file('other/bloo', 'wb') as f: f.write('two')
724
722
othertree = WorkingTree.open('other')
725
723
othertree.commit('blah', allow_pointless=False)