1

TFS 2012 is installed on a Server. On this server there are 3 projects- Dev, QA, and Prod. Is there a way to locate where a source code file is on the server. So be able to tell if it is in the Dev, QA, or Prod project currently. And would this be by Source Code name or by using a label and searching for that label?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
eric_13
  • 383
  • 1
  • 8
  • 22
  • 1
    Dev, QA & Prod are projects, or branches? Do you mean to locate a specific version of a file? Can you provide a little more information? What is the known quantity? Just the filename? Are you trying to do this in the UI? – Andrew Clear Oct 23 '12 at 19:17
  • They are separate projects. There is currently only one version of the file. What happens is it starts in Dev, after it is worked on will be checked out and moved to QA, and then checked out and moved to Dev after the QA process is completed. I was able to locate it as the project is not very big but I was looking for a fast way of doing this by either using the filename or using labels and finding it that way. Ideally I would be able to search for it and know it is either in Dev, QA, or Prod to know where in the process it is. – eric_13 Oct 23 '12 at 19:31
  • Would there be a way to do this? – eric_13 Oct 24 '12 at 15:27

1 Answers1

0

I would say that division you have made as projects isn't the intended way of using TFS, they're meant to be made as branches within the same project. You may have specific reasons to have them created as projects (and I'm interested in why), but you won't get much help from standard TFS source there, I'm afraid.

You can use Find in Source Control on wildcards or the equivalent tf command

tf info [wildcard] /recursive

to look for source control paths, but there are two caveats:

  • this search is limited to per-project, so you will have to do the search for each of your projects in turn (until you get a hit).
  • By default the command returns all source-controlled objects, even deleted ones, so you'll have to filter the search on DeletionID and Local path

This command could be scripted to search through each project folder. And here's a related Q&A for doing it programmatically.

Community
  • 1
  • 1
Torbjörn Bergstedt
  • 3,359
  • 2
  • 21
  • 30
  • I did not actually create the layout. I have sense changed it from separate projects to one project with separate branches for each. – eric_13 Oct 30 '12 at 12:53
  • Ok, this doesn't seem to work. Let's say I'm looking for a file called "filename.src". I want to figure out where it is stored in TFS. SO, I type in tf info filename.src /recursive, and I get the following error: "There is no working folder mapping for C:\Progra...\filename.src" – Sean Worle Jan 21 '15 at 16:37
  • You have to run the command from within a workspace mapped folder in order for TFS to understand where to search. – Torbjörn Bergstedt Jan 22 '15 at 09:40