NB that you probably can't implement this in a fully correct way in
Lua, because you need to move any pending adds/drops/renames so that
they apply to the new base revision; just changing the base_revision
field won't do that. If all you have are file edits, then things may
be fine; otherwise there's a chance of your workspace becoming
inconsistent, and subsequent mtn commands will notice this and refuse
to work.
It would be quite easy to implement in mtn itself, though, because it
has all the high-level code for handling file trees already. Just do
something like (untested):