RollbackAndAnythingDoc.tioga
Spreitzer, May 24, 1985 1:51:20 pm PDT
RollbackAndAnything
CEDAR 6.0 — FOR INTERNAL XEROX USE ONLY
RollbackAndAnything
Mike Spreitzer
© Copyright 1985 Xerox Corporation. All rights reserved.
Abstract: RollbackAndAnything provides a way to have commands automatically executed after a rollback.
Created by: Mike Spreitzer
Maintained by: Mike Spreitzer <Spreitzer.pa>
Keywords: Rollback, Checkpoint, Command
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

For Internal Xerox Use Only
1. RollbackAndAnything
The command
% RollbackAnd foo bar gronk
will save "foo bar gronk" in a file (named something like ///Users/username/ToDoWhenRollback), and then invoke a Rollback, hoping that RollbackAndAnything will be there to use it.
If RollbackAndAnything is in the checkpoint, it will automatically wake up on rollback.
Another way to get RollbackAndAnything going is to invoke the DoRollbackStuff command (e.g., have it among your LoginCommands.PerLogin commands).
In either case, RollbackAndAnything will look for the file containing the saved commands, read them, rename the file (to something like ///Users/username/DidWhenRollbacked), and then stuff the commands into a command tool.
RollbackAnd gets registered as uninterpreted, so you don't have to worry about the CommandTool messing around with the rest of the command line. Of course, remember the misfeature concerning unregistered uninterpreted commands. As a workaround, RollbackAndAnything exports RollbackAndAnything.Load, but there is no command named RollbackAndAnything.