How can I update a reftree or wspace to a specified transaction level?
How can I update a reference tree or wspace to a specified transaction level?
You can use update with the -t option to go forward in transaction number. For example, if your reference tree (or wspace) is updated to transaction 10 and you want to update it to transaction 20, running the command accurev update -r <reftree name> -t 20 will update all files for which new versions were promoted to a stream in the backing chain from transaction 11 to transaction 20. To update a wspace <accurev update -t 20>.
Sometimes, you would like to get the versions of files that were in a stream at an earlier transaction level. You cannot use update -t to set the transaction level to an earlier transaction level.
If you would like to go backwards, i.e. roll back to a specific transaction number that is before your current transaction number, you should make an intermediate time-based stream for this purpose. If your current set up is
Stream -> ref/wspace
Create a reference tree off of the time-based stream instead so that the new structure is (you can reparent a wspace or create a new wspace off the time-based stream):
Stream-> time-based stream -> ref/wspace
(you can use the command accurev mkstream -s <time-based stream name> -b <backing stream name> to create the new stream from the cli)
One drawback of this method is that you cannot currently move a reference tree to a new backing stream. Because of this, you will have to make a new reference tree off of the time-based stream and remove the original reference tree. Keep in mind here that you cannot reuse the name of a reference tree, so the new reference tree must have a different name.
To be sure that no one else accidentally promotes changes to the time-based stream, you should lock it down. You can do this through the CLI with the command accurev lock <time-based stream name> The lock will prevent promotes to the stream and from the stream. It will also prevent setting include/exclude rules on the stream. This will insure that the time-based stream sees exactly what its parent stream sees. Then, you can use the command accurev chstream <time-based stream name> -t transaction # to change the transaction level of the time-based stream. Once you change the time-basis on the stream, you can run the update command (without any transaction number) to update the reference tree, i.e. accurev update -r <reftree name>.
Using a time-based stream is in a lot of ways easier than update -t since you can move the transaction level forward or backward at will at the stream level and not have to worry about the current transaction level of the reference tree.
For more information contact AccuRev Support.