views:

879

answers:

2

I have a TFS project that ought to be a folder under another project, so I want to move the source control history (We don't use the other features of TFS for this project, so I don't care about the project site). I've branched the code into the new location, and I'm preparing to delete the original project.

This SO question deals with the obviously lacking TFS feature of history after you branch, but since I'm deleting the trunk folder, this workaround functionality will break, and I'll completely lose my source history pre-branch.

Does anybody else have a better solution that would allow me to keep the history? I'd most like to retain the ability to do previous builds, and I lose that if I delete the trunk folder from source control, something which isn't acceptable. Thanks for your help!

A: 

Another option to consider besides deleting the directory is simply cloaking it. Cloaking the directory won't actually remove anything from source code control. It will just prevent it from being checked out on your client. The end effect is it won't show up on your client and you'll still have the work around for history purposes.

JaredPar
That's an option I'd considered, but I also want to avoid the risk that somebody else will edit the source code in the future, since this is an inactive copy. While I could have everybody cloak it, I'd prefer a direct solution instead of a workaround.
rwmnau
+1  A: 

My recommendation is to use the Move (aka rename) feature. All history will be preserved in-place. And you can still recreate old builds in the other project by sync'ing back to the appropriate version.

If you do decide to Branch, it doesn't matter whether you delete the original source or not. Nothing in TFS is ever really deleted, simply placed into a "deleted state." History -- including merge history -- works identically. (Unless you also use the Destroy command. And even then, there's an option to delete the file contents & diffs but preserve the historical metadata.)

Richard Berg
It was my expectation that nothing was ever deleted, but it seems that when you delete a team project, it actually destroys the source history for that project (see "Version Control" under "How TFSDeleteProject Works" at http://msdn.microsoft.com/en-us/library/dd206696.aspx). Since this is the case, I'll never be able to recreate any builds prior to my branch.I'll check out the Move option - I hadn't considered that, though I'm not sure it will work across projects.
rwmnau
I just tried "Move", and it did what I expected, even across projects, and source history is preserved. I'll leave the question option to see if I get any other solutions, but if I don't, I'll accept yours. Thanks for the help!
rwmnau
Glad to hear Move worked. Good point about TfsDeleteProject, though. Having it perform a Destroy is a relatively recent change. If you don't need to create another project with the same name -- especially if you anticipate you might need to revisit old artifacts someday -- you probably don't need to run that command. Simply remove everyone's GENERIC_READ permission to the project (or everyone but admins, etc), then nobody will be able to see it or manipulate it, without doing anything destructive.
Richard Berg
Revoking the permissions would work - call me anal, but I'm happier with the old project actually gone, especially since I've fully migrated the source control history.
rwmnau