开发者

When did I last 'Get Latest' from TFS?

开发者 https://www.devze.com 2022-12-08 17:55 出处:网络
I have some version of code on my machine.I want to set up a second machine with the same version of code so I can pull down a shelveset based off this version.However, I didn\'t write down the day/ti

I have some version of code on my machine. I want to set up a second machine with the same version of code so I can pull down a shelveset based off this version. However, I didn't write down the day/time I last did get latest on my machine.

To get the right ve开发者_如何转开发rsion, I need to know when exactly I last did 'get latest' on my machine. I'm sure there must be some way to do this, maybe on the command line. Does anyone know?


Run this from inside the workspace in question:

tf history $/ -r -version:W -stopafter:1

This will tell you the highest changeset # that has been downloaded to your workspace. So long as your most recent Get operation was a full "Get Latest" (no path scope, no complex versionspec), that's all the info you need. Simply run tf get -version:1234 (replacing the version # with the changeset number TFS provides) in the new workspace to bring them in sync. Of course, you need to ensure the workspace mappings are comparable, etc...

If the assumption above don't hold and your workspace is in a more complicated state, the easiest way to replicate it is with labels:

# run in old workspace
tf label MyWorkspaceVersion $/ -r -version:W

# run in new workspace
tf get -version:LMyWorkspaceVersion


When you pull down a shelveset it will set the workspace you pull it down to to the same state of original workspace that created the shelveset, including rolling back versions of the files at that point in time so that you have consistency.

All you need to do on machine #2 is do a get latest, then pull down the shelveset and work on it.

If you just want to find out the changeset the shelve was against then at the unshelve dialog, select the shelveset you are interested in and look at it's details, right click one of the files and select properties. In the window that comes up you should be able to see the shelveset's revision number

Hope that helps


You could just copy the 'good' tree onto the new machine.

0

精彩评论

暂无评论...
验证码 换一张
取 消