0

I have this example where FolderA had sub FolderB and they were both folders, until I branched FolderB to FolderB-branch. Then both sub folder turned into branches.

enter image description here

How can I use tf command to determine what is folder and what is branch?

tf dir /r and tf dir /r /folders show the same info.

How can I use tf command to distinguish what is what?

TFS 11, Visual Studio 2012.

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
Mike Torrettinni
  • 1,816
  • 2
  • 17
  • 47
  • I don't think you can. The distinction between a folder and a branch in TFVC is primarily in metadata and doesn't affect very much. What is your use-case for needing this information? – Daniel Mann Nov 01 '21 at 15:53
  • @DanielMann trying to replicate the look so it looks like original view in Team explorer, `dir` command doesn't say what it is. – Mike Torrettinni Nov 01 '21 at 17:54
  • Still not clear on what the objective is. Why are you trying to "replicate" team explorer? – Daniel Mann Nov 01 '21 at 18:29
  • Not replicating team explorer. Just the hierarchy view of folders. Like a summary of the TFS server instance, that can be then exported as html file. The icons should be same. – Mike Torrettinni Nov 01 '21 at 18:33
  • @DanielMann you commented: `"...is primarily in metadata..."`, is this info available with `tf command`? – Mike Torrettinni Nov 01 '21 at 19:30
  • 1
    I wouldn't expect it to be. It's probably available via the SOAP APIs but I haven't looked at the TFS 2012 object model in at least half a decade. TFVC is pretty much dead and you're unlikely to find a lot of people who remember much about TFS 2012 given that it's almost 10 years old. – Daniel Mann Nov 01 '21 at 23:50

1 Answers1

0

There is a way do this, using tf branches command. When using it, TFS returns 2 responses:

when item is a Folder:

Item FolderA is not used in any branch view

when item is a Branch, it lists branch tree, like:

../FolderB
>>  ../FolderB-branch

Now we can parse the output and assign if item is a Folder or a Branch.

Of course, the command tf branches need to be run in parent folder or with full parameters like /collection and others, if required.

Mike Torrettinni
  • 1,816
  • 2
  • 17
  • 47