Thursday, June 07, 2007

Move caveats (I like to move it move it ... not)

Recent post on MSDN forums reminded me of an important issue in TFS Move functionality.

To give you a short summary - you move file (or more frequently a folder) within your source code repository using TFS Move command. The sky is blue, everything works all right - until at some later point you decide to retrieve the item version before move changes. Then in VS GUI you will receive an error; nothing you do will get you that version using UI. Only possible workaround is to use tf command line get with an old item name/path specified and versionspec before move.

While for most of us it is hardly a show stopper, think about a scenario when you move a whole team project subtree (that's what the author of the original forum post did). If you interested in previous revisions in that setup - that might be pretty cumbersome.

I do not judge the implementation of that; in my opinion you can argue successfully both ways (bug vs logical implementation). But it is certainly the fact to be aware of before you check in the results of your latest move operation.

4 comments:

Anonymous said...

I recently moved folders around that had branch relationships. I later realized the branch relationships between parent and children were lost. I guess this would be related to this issue. Any ideas about how to recove the parent-child relationships?

eugenez said...

I think something is wrong with your process; move should not affect branch relationships.

Please provide a repro scenario for where you encountered a problem.

Unknown said...

I've moved a folder and now I can't get previous versions created before the move (just like you explain). I've tried using tf get itemspec version-as-date but I get message "All files are up to date". I need to patch a released version of our product which is represented in tfs as a label. The plan was to branch on this label, but first I moved our source into a better folder structure. I foolishly expected history to follow the move. I can get all the history using "view history" but I can't get or branch on a previous version.

Anonymous said...

Moving a branch will break parent/child relationships, but moving the branch back to the original location will restore history & merging between branches. We archive old DEV branches to an Archive directory, and when moved backed everything is back to normal.