Comment 1 by Tony Cooper, Nov 27, 2010
Feedback from Stephen Leake: I think the best approach is to document what automate commands change the process working directory (checkout is apparently the only one so far), and add an explicit 'au change_workspace' command (see cmd_automate.cc:278:LUAEXT(change_workspace, )). Then we either need to make 'au change_workspace' process _MTN/options, or add another command to do that. For my current use of 'LUAEXT change_workspace', processing _MTN/options would be appropriate (not doing that hasn't been a problem yet, but it could be). Another approach would be to require au commands to restore the process working directory. But I think explicit workspace control will be more useful in the long run; it gives au the same power shell scripts that invoke mtn have. All of this is post 1.0.
Comment 2 by Thomas Keller, Nov 27, 2010
I'd even go a bit further and make no behind-the-scenes workspace changes at all - especially not through some dubious new change_workspace automate command. The reason why I think this is bad is because it adds another thing we need to track the state of during a long running process and this usually comes with lots of problems (concurrent access, hacky implementation, complex logic). What I'd rather vote for is a completly explicit --workspace-path option in monotone. Then whatever the inner implicit logic found to be the current workspace would be overridden by the given workspace path and the options for this would be processed afterwards.
Sign in to reply to this comment.
Reported by Tony Cooper, Nov 27, 2010