November 20, 2009
Works with Surround SCM 2010 and later
Will not work with Surround SCM 2009 and earlierRollbackChangelist is a tool that allows the user to rollback files committed via a changelist. The tool goes file by file and rolls it back to the version previous to the one created by the changelist. Unlike the changelist, this rollback is not atomic. This tool does the equivalent of the user going to each file's history and rolling back the file, one by one. The tool simply does this in batch mode, which is easier for the user, especially for changelists that might contain several files. To keep things simple, at this time the tool only rolls back check in actions.
App FlowWhen Rollback Changelist launches, it uses information gathered from the environment variables made available by the plugin architecture to know the branch and repository that are currently selected, as well as the user currently logged in to the Surround SCM client. Based on this information, Rollback Changelist uses the Surround SCM API to get a list of committed changelists for the current user in Surround SCM. Note that this user may be different than the one used by Rollback Changelist to connect to the Surround SCM server. Rollback Changelists builds two tables:
- Changelist Table - Contains a list of changelists committed by the user, along with the timestamp of the changelists and if Rollback Changelists detects if it has rolled back this changelist allready.
- File Table -Contains a list of all files that were part of the changelists whose action was a check in. It also includes the version created by the changelist and the current version of the file.
Determining previous rollbackWhen Rollback Changelist rolls back a file, it enters a comment using the changelist name that it is reversing. Rollback Changelist will go through all rollback events for all files and search for the changelist name. If it finds any instances of this, it assumes that it has already rolled back that changelist.
Access from Surround SCM clientPlease refer to the Surround SCM Custom Client Menus article for help on creating a custom menu option to access Rollback Changelist. The tool is meant to be used as a plugin and will not work otherwise. While the tool maybe accessed from anywhere, remember that it will need a branch to be selected, so it makes sense to make it available from the branch context menu.
Configuration FileRollback Changelist reads the information needed to connect to the Surround SCM server from a configuration file called "CMConfig.xml". This file must reside on the same directory as the Rollback Changelist.exe file. A sample file is provided with the Download. The file must have the following information:
- UserName - User name to connect to Surround SCM
- Password - Password for the above user
- SCMServerAddress - Surround SCM IP address or host name
- SCMServerPort - Port of the above server
<CMData> <UserName></UserName> <Password></Password> <SCMServerAddress></SCMServerAddress> <SCMServerPort></SCMServerPort> </CMData>