hellomahesh

I have about ten folders containing 100s of objects in each of them... I want to tag specific objects and whenever I do Get I want to get the latest version of those tagged objects only. Could some one help me achieve this

thanks




Re: Team Foundation Server - Version Control how to get latest version of only specific objects

Tan Phan

I don't think there is anything built-in that does exactly what you want - tagging specific files and only doing get latest on them. It is probably just as easy to write a script to loop through the "would-be-tagged" file list and use tf.exe to get their latest version.

Hope this helps. -Tan





Re: Team Foundation Server - Version Control how to get latest version of only specific objects

hellomahesh

I guess you are right there is nothing build-in, but any tricks like using label, etc.

Supposing, if I label objects say "Iteration 1" after a week I want to label and get all the same objects for "Iteration 2" release but latest version of objects...

I just want to avoid manual/tedious work of labeling 100s of files located at different folders every week. Smile

thanks






Re: Team Foundation Server - Version Control how to get latest version of only specific objects

Richard Berg MSFT

Labels might help, but it's not a 1-step process. You'll have to workaround a few things:
1) labels point to specific versions. when you run Get you'll always retrieve the version that you labeled, not the latest versions
2) labels are exclusive. that means if you run Get on a label, it will remove items not in the label

It's possible to retrieve only the filenames from the label, then pass those filenames to Get along with a "latest" versionspec. You'll have to write some code though.




Re: Team Foundation Server - Version Control how to get latest version of only specific objects

Chris Sidi - MSFT

On the off chance that there's a filename pattern that matches exactly the files you want, you could do a recursive get:

tf.exe get /r *.cs *.jpg

tf.exe get /r *.foo.*

It sounds like perhaps your goal is to label the latest version of several files periodically. If you don't like scripting it, you could add a workspace specifically for this task. You can put individual files in your workspace mappings though the UI will only assist you to the folder level. You could set up mappings like this:

$/project/folder1/file01.txt : C:\workspaces\labelWorkspace\folder1\file01.txt

$/project/folder1/file02.cs : C:\workspaces\labelWorkspace\folder1\file02.cs

...

$/project/folder9/file98.txt : C:\workspaces\labelWorkspace\folder9\file98.txt

$/project/folder9/file99.cs : C:\workspaces\labelWorkspace\folder9\file99.cs

Then just sync that workspace and label the files in it each week.

A couple of warnings:

- If a file or folder gets renamed, these workspace mappings are not going to get automatically updated to the new path.

- If you currently only have one workspace: there are a few situations where tf.exe figures "hey you only have one workspace so that must be the one you want me to operate on." If you go up to two workspaces you may have to clarify which workspace your operations are for. Usually this can be determined by your current directory however.





Re: Team Foundation Server - Version Control how to get latest version of only specific objects

hellomahesh

Thanks Chris,

The first tip - filename pattern helped me to some extend.

On the second one - once I create the workspace and mapped the required files, how do I sync them Folder level sync is not an option, since I required only specific files from each of the folders.

In my delivery I have all these types of files: dtsx, rdl, jpg, sql, .cs, etc organised in different folders by business functions and projects/solutions.

thanks

Mahesh

PS: Can we suggest of having tagging feature in the product in future release Tagging would highly helpful for scoping purposes which will be indepedent of versioning. Though organising objects folderwise will help some extend, but not incase the folders are organized in some matrix of projects and business functions and delivery is required to be done to multiple teams to difference intervals.

please provide product suggeston link if available.






Re: Team Foundation Server - Version Control how to get latest version of only specific objects

Chris Sidi - MSFT

To sync the workspace in the example above, you would chdir to C:\workspaces\labelWorkspace\ and run simply "tf get". That will pull the down the latest version of every file in the workspace.

If you want to do this from Visual Studio instead: Go to Source Control Explorer, choose the appropriate workspace from the Workspace pull-down list. Then right click on the root node in the Folders pane (the server icon) and choose "Get Latest Version". (If all your files are within the same team project you can just sync the team project.) When you're done with your operations on these specific files, don't forget to change your workspace back!