Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS: Find a moved file by the old name

Tags:

c#

tfs

is there a way to get the version-history of a file if you only know an old name of the file?

I am currently looking at an old copy of our repository (I don't know the exact date, the copy was taken). When I compare it to the current repository, there is one file, that only exists in the copy, but not in the current repository. It has not been deleted in the repository. I guess, it has been moved or renamed. Is there any way in TFS to find the version-history using the old path and name?

I know that I could dig around using the name or some code-fragments. But IMO this is not an acceptable solution when using a repository :)

Thank you very much

Andreas

like image 422
Andreas Avatar asked Sep 14 '11 16:09

Andreas


1 Answers

In Team Explorer 2010, you can simply turn on the "Show Deleted Files" option and navigate to the original folder, you'll be able to then see the file that was moved or deleted. You can view history on the item to see its last changeset - this will show you whether it was outright deleted, or if it was just renamed and thus the item no longer exists in the current path name (aka "slot") and was deleted that way. You can further drill down in to changeset details for that changeset to see the new path name (slot) that item occupies.

As you mention, you could certainly do this with a little bash against the TFS API using the GetItems method. Though I understand that it's not what you want to do, I thought it worth saying just because the TFS API is surprisingly easy to work with.

like image 68
Edward Thomson Avatar answered Oct 10 '22 14:10

Edward Thomson