rollback to a label?
Hi All
How can I rollback to a Label?
I see that tfpt.exe just lets you rollback a changeset. Also, It just lets me select 1 changeset at 1 time. What if, I wanna rollback 3 changesets at 1 time?
We are used to labeling a release. The tech leads may ask me to rollback to a specific label if something screws up in a branch. How can I get around with this?
Thanks.
[385 byte] By [
GS] at [2007-12-24]
1)By the scond step u mean....
Check out the file and check back in. Is it Right?
2)So u mean to say that I have to go thru the above steps for all the 50-60 or more files if i were needed a previous label code for that branch?
This doesn't sound fun at all.
GS at 2007-10-8 >

The best way to do Step 2 is with a script. To enumerate the items you need to checkout, either parse the output of Step 1 or use
tf labels /f:detailed. Then pass those items to
tf checkout.
(edit) If this is too cumbersome for your situation, you could simply checkout everything (tf checkout $/path/to/parent/folder /recursive). During Step 3, TFS will detect which files did not change and automatically undo them.
Thats a good idea to check-out the whole branch and then move from there.
But now what irritates is that i have to resolve conflicts on 50 files one by one. UI doesn't give me an option to discard the server changes all at once. This is not comfortable. or maybe i am asking too much :). I guess i can live with it. These kinda rollbacks are not often.
But I'm still curious about the script syntax u talked about. I'd appreciate if u give li'l more detail about it.
Thanks.
GS at 2007-10-8 >

After you get the list of files, you'd write out a new file called "BulkCheckout.tfc" that looked like:
checkout file1.txt
checkout folder\file2.txt
checkout folder333\file333.txt
etc.
Then runtf @BulkCheckout.tfc to quickly check out all of them. Full documentation of tf.exe scripts: http://msdn2.microsoft.com/en-us/library/1az5ay5c.aspx
You should be able to select-all in the Resolve dialog and choose "discard server changes". Does it not work? I know there were some bugs in that dialog but I thought this scenario would be ok. Anyway, if it fails, you can use the cmdline:tf resolve * /r /auto:acceptyours
Richard
Thanks for quick replies.
u r right, we can select all the files and 'discard server changes' all at once......my bad.
Right now, I just need to figure out things in TFS and see if there is anything that doesn't suit out IT process. Rollback to a label works for me using the UI.
I appreciate u forwarding the link and suggestion for the command line syntax......maybe it will help others who check this thread.
GS at 2007-10-8 >
