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.

6
  • 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? Commented Nov 1, 2021 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. Commented Nov 1, 2021 at 17:54
  • Still not clear on what the objective is. Why are you trying to "replicate" team explorer? Commented Nov 1, 2021 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. Commented Nov 1, 2021 at 18:33
  • 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. Commented Nov 1, 2021 at 23:50

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.