views:

22

answers:

1

In Visual Studio 2005, in the TFS Source Control Explorer, these is a top-level node for the TFS Server itself, with a child node for each Team Project. Right-clicking either the server node or the node for a Team Project gives a context menu on which there is a View History item. Selecting this gives you a History window showing the last 200 or so changesets, either for the specific Team Project chosen, or across all Team Projects.

It is this history across all Team Projects that I am wondering about. The command-line tf.exe history command provides (as I understand it) basically the same functionality as is provided by the VS TFS Source Control plug-in. But I cannot work out how to get tf.exe history to provide this across-all-Team-Projects history.

At a command line, supposing I have C:\ mapped as the root of my workspace, and Foo, Bar, and Baz as Team Projects, I can do

C:\> tf history Foo /recursive /stopafter:200

to get the last 200 changesets that affected Team Project Foo; or from within a Team Project folder

C:\Bar> tf history *.* /recursive /stopafter:200

which does the same thing for Team Project Bar - note that the wildcard *.* is allowed here.

However, none of these work (each gives the error message shown):

C:\> tf history /recursive /stopafter:200

The history command takes exactly one item

C:\> tf history *.* /recursive /stopafter:200

Unable to determine the source control server

C:\> tf history *.* /server:servername /recursive /stopafter:200

Unable to determine the workspace

I don't see an option in the docs for tf for specifying a workspace; it seems to only want to determine it from the current folder.

So what is VS 2005 doing? Is it internally doing a history on each Team Project in turn and then sticking the results together??

note also that I have tried with Power Tools; tfpt history from the command line gives exactly the same error messages seen here

+1  A: 

You need to be in a mapped directory for that to work. For example if you have "$/" mapped to "C:\TFSSOURCE", change directory to C:\TFSSOOURCE and try the command again.

Robaticus
Aha! This led me to the answer. Contrary to what it says in the question I *didn't* have `C:` mapped to `$/` - in fact *nothing* was mapped to `$/` and all the Team Projects had explicit mappings set to to `C:\Foo` etc. Setting up a mapping for `$/` means `tf history *.*` now works at root level! I still wonder what VS was doing though...
AakashM
That's the way the tf history works. If you specify an item spec of *.*, it looks at what your current disk folder is, and checks the mapping to the source folder and starts its search from there.
Robaticus