Alex Rivera | Logout

TFS 2010: history lost after moving a folder

Asked 2012-12-24T12:49:34.310
29

In order to clean up my project structure, I moved a folder into another (new) folder through the TFS Power Tools Shell-Extension (Rename/Move).

After checking the history at the new place, the move is the only entry. (I tried one folder up, down, even on single files in the moved folder.. same result.)

I had also put on some labels on versions of the folder before the move, since there were some important states of the code I wanted to get back to.

So.. what went wrong, and how can I either get the history or at least find out the label names again and check out those versions?

Edit
Report

1 Answer

17

DISCLAIMER: For reference of everyone that gets here, this answer is not fixing @Andreas problem, just giving some context on why this happens and offering a couple of workarounds.

Seems that losing history when moving folders in TFS 2010 is not a bug, is a "feature". (still happening in TFS2012. From this MSDN link you can read official Microsoft answer:

Thanks for the feedback here. The previous comment about this being by design is correct, and there is an option on the command line. In the UI, history of folders is recursive - always. This is because most of the time, users care about the history of the contents of the folder. Files on the other hand dont have the concept of recursive history - you always see the history for the file itself. Now, from the command line, there is an option to show recursive history (/r) and if you run tf history on a folder without the recursive option, you'll see the changes to the folder itself. This would include changes such as a rename for the folder itself.

  • Workaround to get history once lost: As you can see there, you have a workaround using tf history.
  • Workaround to avoid losing history: If you want to avoid losing history in folders instead of using move feature, you can use TFS Integration tool to migrate code from one folder to other preserving history, migrating from $/TFSCode/FolderA to $/TFSCode/FolderB. It is a little bit overkill but if the history is pretty important for you is much better than looking for it in deleted folders
answered 2013-06-25T12:07:37.803

Your Answer