locked
"Convert Folder to Branch" via command-line?

    Question

  • Hi,

     

    Both VS and Eclipse plugin have a GUI option for converting source control folders into branches. Unfortunately, something like:

    tf branch $/Project/Folder $/Project/Folder /checkin

    cannot be used to convert project folder to a branch.

     

    I've tried all options available for tf branch and was unable to achieve this functionality via the command-line client. I need this to automate project branching structure creation as repeating branch creation manually for more than five dozen projects is not quite optimal.

     

    Has anyone been able to replicate the "Convert Folder to Branch" GUI feature using the command-line client?

     

    Thanks in advance for your help!

     

    Friday, September 24, 2010 7:24 AM

Answers

  • Hello MaxCherny,

     

    Currently, tf branch /checkin does not automatically convert the folder to branch. However, if the source of the folder branched was already a branch the created folder will automatically be a branch as well and no conversion would be required.

    The Sept TFS Power tools found here : http://visualstudiogallery.msdn.microsoft.com/en-us/c255a1e4-04ba-4f68-8f4e-cd473d6b971f has the tfpt commandline that has "branches" command that allows you to achieve that :

    tfpt branches - Convert, reparent, list, and update branches

     

    Usage: tfpt branches [/collection:uri] [folderspec]

                            - Displays information about the specified branch

           tfpt branches /listBranches:roots [/collection:uri]

                            - Lists all root branches

           tfpt branches /listBranches:children,related,ancestors [/collection:uri] [folderspec]

                            - Lists the child, related, and/or ancestor branches for the specified branch

           tfpt branches /convertToBranch [/collection:uri] [/description:text] [/owner:name] [/recursive] [folderspec]

                            - Converts the specified folder to a branch

           tfpt branches /convertToFolder [/collection:uri] [folderspec]

                            - Converts the specified branch back to a normal folder

           tfpt branches /reparent folderspec parentfolderspec [/collection:uri]

                            - Reparents the specified branch to the specified parent branch

           tfpt branches /update [/collection:uri] [/description:text] [/owner:name] [folderspec]

                            - Updates the description and/or owner of the specified branch

           tfpt branches /properties [/collection:uri] [folderspec]

                            - Displays and edits branch properties in a GUI

     

     uri               Specifies the URI of the team project collection.

     folderspec        Server or local path of the root folder of a branch.

                       If not specified, the current local folder is used.

     parentfolderspec  Server or local path of the root folder of the new parent branch

     

    More information about power tools in Brain's post : http://blogs.msdn.com/b/bharry/archive/2010/09/09/sept-2010-tfs-power-tools-release-available.aspx

     

    Thanks, 

    Youhana - MSFT


    Youhana Naseim, SDET, Microsoft
    Friday, September 24, 2010 5:15 PM

All replies

  • Hello MaxCherny,

     

    Currently, tf branch /checkin does not automatically convert the folder to branch. However, if the source of the folder branched was already a branch the created folder will automatically be a branch as well and no conversion would be required.

    The Sept TFS Power tools found here : http://visualstudiogallery.msdn.microsoft.com/en-us/c255a1e4-04ba-4f68-8f4e-cd473d6b971f has the tfpt commandline that has "branches" command that allows you to achieve that :

    tfpt branches - Convert, reparent, list, and update branches

     

    Usage: tfpt branches [/collection:uri] [folderspec]

                            - Displays information about the specified branch

           tfpt branches /listBranches:roots [/collection:uri]

                            - Lists all root branches

           tfpt branches /listBranches:children,related,ancestors [/collection:uri] [folderspec]

                            - Lists the child, related, and/or ancestor branches for the specified branch

           tfpt branches /convertToBranch [/collection:uri] [/description:text] [/owner:name] [/recursive] [folderspec]

                            - Converts the specified folder to a branch

           tfpt branches /convertToFolder [/collection:uri] [folderspec]

                            - Converts the specified branch back to a normal folder

           tfpt branches /reparent folderspec parentfolderspec [/collection:uri]

                            - Reparents the specified branch to the specified parent branch

           tfpt branches /update [/collection:uri] [/description:text] [/owner:name] [folderspec]

                            - Updates the description and/or owner of the specified branch

           tfpt branches /properties [/collection:uri] [folderspec]

                            - Displays and edits branch properties in a GUI

     

     uri               Specifies the URI of the team project collection.

     folderspec        Server or local path of the root folder of a branch.

                       If not specified, the current local folder is used.

     parentfolderspec  Server or local path of the root folder of the new parent branch

     

    More information about power tools in Brain's post : http://blogs.msdn.com/b/bharry/archive/2010/09/09/sept-2010-tfs-power-tools-release-available.aspx

     

    Thanks, 

    Youhana - MSFT


    Youhana Naseim, SDET, Microsoft
    Friday, September 24, 2010 5:15 PM
  • Hi Youhana,

    I downloaded the TFS powertools from the link mentioned, but it does not have the command for branches.

    Is there something i am missing?

    The help documentation that comes along with TFPT does not mention abount branching except when creating a new team project.

    Regards,

    Shashi Sadasivan

     

    Monday, September 27, 2010 10:53 PM
  • Hello Shashi, 

     

    Did you download the september release ? can you send me the version of tfpt.exe that installed on your system ? This tool was only introduced in the sept release (the apr release does not have that command).

     

    Thanks,

    Youhana 


    Youhana Naseim, SDET, Microsoft
    Tuesday, September 28, 2010 12:24 AM
  • The link was updated minutes ago which now points to a more updated MSI :)

    I shall call it resolved

    Tuesday, September 28, 2010 12:32 AM