Posts Tagged ‘labeling’

AccuRev TimeSafe makes retrieving code from "anywhen" easy

October 24th, 2007

One of the problems frequently faced in traditional branch-and-label version control systems is how to retrieve a particular configuration of code from the past if it wasn’t tagged or labeled at the time. You forgot to label the release-candidate-6 branch from last month before building it, and now you have no way to accurately pull the correct files.

AccuRev, through a combination of its TimeSafe architecture and the power of its streams, makes this easy. Say you have a development process where code follows a promotion model from individual contributors to an Integration area, to a QA area, to Production. The release candidates are based on the QA stream. The QA team built and released RC5 on Friday, June 7th at 11:00 pm, but unfortunately neglected to snapshot it. In the following weeks, additional changes were promoted to the QA stream.

To get guaranteed access to the code configuration as it existed for RC5, you could do the following:
* create a stream off of QA and assign it a time basis of June 7th, 11:00 pm
* run “accurev pop” to retrieve the contents to disk

anywhen_stream.jpg

It’s as easy as that! Furthermore, if you want to automate this process, how about creating a stream for all your source pulls, call it something like <depot>_source_pull (or equivalent, doesn’t really matter). Then, whenever you need source files, use the “accurev chstream” command to first move it to whatever parent stream you want the files from and second to change the time-basis on it to the correct time or transaction. Lastly, you pop from that time-basis stream to place the files in whatever location you want:

“accurev chstream -s <depot>_source_pull -b <depot>_target_stream”
“accurev chstream -s <depot>_source_pull -t 356″
“accurev pop -R -O -v <depot>_source_pull -L c:\build_dir .”

There are other ways to skin this cat in AccuRev, as there usually are, but this is a quick way to get guaranteed results.