343
343
wt.set_last_revision('null:')
344
344
wt.commit('A', allow_pointless=True, rev_id='A')
345
345
self.assertEqual(['A'], wt.get_parent_ids())
346
# None is aways in the branch
346
# null: is aways in the branch
347
347
wt.set_last_revision('null:')
348
348
self.assertEqual([], wt.get_parent_ids())
349
349
# and now we can set it to 'A'
350
350
# because some formats mutate the branch to set it on the tree
351
351
# we need to alter the branch to let this pass.
353
self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)),
354
wt.branch.set_revision_history, ['A', 'B'])
355
except errors.NoSuchRevision, e:
356
self.assertEqual('B', e.revision)
352
if getattr(wt.branch, "_set_revision_history", None) is None:
357
353
raise TestSkipped("Branch format does not permit arbitrary"
355
wt.branch._set_revision_history(['A', 'B'])
359
356
wt.set_last_revision('A')
360
357
self.assertEqual(['A'], wt.get_parent_ids())
361
358
self.assertRaises(errors.ReservedId, wt.set_last_revision, 'A:')