tf.exe Rename==tf.exe Move in Visual Studio Team Foundation
When you use the Team Foundation tf rename command to rename a source-controlled file in your local workspace, you change its address, not its name. If you rename file1.cs to file2.cs, you implicitly change its address from c:\folder\file1.cs to c:\folder\file2.cs.
So what happens if you rename the folder part of an address to an existing repository folder rather than renaming the file? Example:
tf rename c:\queue\ file1.cs c:\projects\ file1.cs*
Note This example uses local, workspace paths but repository paths such as $/queue/file1.cs are also accepted.
This example uses the tf rename command to move file1.cs from the queue folder to project folder in your workspace and when you check in the change from your workspace, the move will be committed to the repository as well. That, my friends, is why there is no move command in Visual Studio Team Foundation: the move command isn't needed because the rename command does it all.
For folks like me who just don’t get it (square peg (rename)...round hole (move)...pound), the Hatteras team was kind enough to provide a move alias for the rename command. Thus, tf rename c:\folder\file1.cs c:\projects\file1.cs can also be written as tf movec:\folder\file1.cs c:\project\file1.cs.
The rename command has one option, /Lock, which locks both the source namespace ($/folder/file1.cs) and the destination namespace ($/project/file1.cs) and thereby prevents other users from modifying the item until you check in the pending rename and unlock it. For more about locks, see Team Foundation vs. SourceSafe | Locking vs Exclusive Checkouts.
++++++++++++++++++++
*In the second Community Technology Preview, which is due out in November and is MUCH better than the first, tf.exe does not exist. Instead, use h.exe. The 'h' stands for Hatteras.
Comments
Anonymous
October 19, 2004
The comment has been removedAnonymous
October 21, 2004
To any unix person the equivalence of move and rename is decidedly old hat. Several decades old, in fact. As any unix user knows, the way you rename files is "mv"...
Think of it this way: imagine you want to move a file and also change its name along the way. It's perfectly natural, if you have a move command, to expect this to work:
move folder1file1.cs folder2file2.cs
(Perhaps some people actually would expect to have to use two separate steps to achieve this? I don't know of any systems with commandline move tools that do require that, though)
Now, if you can do that, what behavior would you expect if you do this:
move folder1file1.cs folder1file2.cs
That's right, it "moves" the file to the same place it already was, with a new name.
(I suppose you might expect that the move tool would complain that the source and destination folder are the same, but work with me here, okay? ;) )
And if that works, why shouldn't it work the same way if you leave off the folder name?Anonymous
October 24, 2004
In DOS (through int 21h, ah=17h, i used this in dos 3.2 with good sucess) you could rename an file to another location, which is the same as move.. :), well, if it was to the same drive..
Anyway, in TF, will the history of the file record this rename/move?Anonymous
October 25, 2004
Its history is absolutely maintained along with any other pending changes that you check in to the repository at the same time. In fact, the "history" of a rename/move operation is maintained even before you commit it to the repository.
Before you check in a rename operation (or any other pending change such as an edit, add, delete, or branch), you can see it in your workspace by using the tf status command. Any other user in the system with sufficient privileges (most users) can see that you have a pending change of type rename in your workspace from their client by using tf status /server:TeamFound1 /workspace:AsbjornM.
It's nice to hear from you again, Asbjorn. :-) I hope you get a chance to pick up a copy of the November/December community drop of Visual Studio Team System and let us know what you think.Anonymous
October 25, 2004
Yepp, we have access to the drops at work, so I have tested the first Beta1, haven't installed the refresh yet, but will soon.
I found an page with some information about the new editions of vs.net, but it looked like the Team Foundation (IMHO the most interresting part) is an addon-product? and VSS is still the default?, hm, can't quite find out if I liked that. :)
Anyhow, this time I'm back, also with an blog :), not much there yet, but someday...Anonymous
August 27, 2006
good site
wellcome to our
http://bmw.dkblog.orgAnonymous
September 07, 2006
Very interesting and good point about <a href="http://eteamz.active.com/legalbusiness/files/play-free-bingo-game.html"">http://eteamz.active.com/legalbusiness/files/play-free-bingo-game.html" title="play free bingo game">play free bingo game</a> and [URL=http://eteamz.active.com/legalbusiness/files/play-free-bingo-game.html]play free bingo game[/URL]Anonymous
May 29, 2009
PingBack from http://paidsurveyshub.info/story.php?title=korby-parnell-s-social-software-wunderkammer-tf-exe-rename-tf-exeAnonymous
May 31, 2009
PingBack from http://woodtvstand.info/story.php?id=2773