This branch implements the command
mtn branch and consequently,
-b option from
mtn branch fiddles with
_MTN/options, adding a new option called
mtn commit picks up at commit time.
Info from the old wiki:
An attempt to remove the --branch option from "mtn commit" and replace the functionality by a new "mtn branch" command which explicitely sets the branch stanza in _MTN/options. This basically works, but is not thoroughly thought through for now, basically because we loose the old branch information after "mtn branch", so subsequent commands like "mtn update" which still rely on the old_revision and the recorded branch name fail badly unless the workspace is committed again. So, what still needs to be done is
- if mtn branch is triggered on an unmodified workspace, mtn commit should succeed and just add the new branch cert to old_revision
- if the branch is switched, the new branch name should be recorded as "new_branch" while keeping "branch" untouched unless commit happens, so "mtn update" and friends work properly
- mtn revert should remove any "new_branch" stanza from _MTN/options
- eventually "mtn branch" should be renamed to "mtn switch" and get some more functionality (i.e. if switched to a named, existing branch, update the workspace to the head of this branch)
Status: Stalled, decide what to do with all that.