{"id":4113,"date":"2012-10-26T10:03:00","date_gmt":"2012-10-26T10:03:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2012\/10\/26\/quick-response-sample-command-line-utility-to-create-tfs-branch-scenarios\/"},"modified":"2022-07-21T23:54:04","modified_gmt":"2022-07-22T07:54:04","slug":"quick-response-sample-command-line-utility-to-create-tfs-branch-scenarios","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/quick-response-sample-command-line-utility-to-create-tfs-branch-scenarios\/","title":{"rendered":"Quick Response Sample \u2013 Command line utility to create TFS Branch Scenarios"},"content":{"rendered":"<p><a href=\"http:\/\/blogs.msdn.com\/b\/willy-peter_schaub\/archive\/2012\/08\/10\/toc-quick-response-solutions.aspx\">Quick Response samples<\/a> provide information directly from Visual Studio ALM Rangers working with the Microsoft Visual Studio Product Group and Microsoft Services, in response to feature gaps to supplement the product and knowledge base information.<\/p>\n<p><span style=\"color: #800000;font-size: medium\"><strong>Update 2012\/11\/22<\/strong><\/span> &#8211; Please refer to the <a href=\"https:\/\/aka.ms\/treasure39a\">Quick Response Sample \u2013 Visual Studio Extension to support the ALM Rangers Branching and Merging guidance<\/a> for the** latest** information and Visual Studio extension support for this quick response sample solution.<\/p>\n<p><img decoding=\"async\" style=\"border: 0px currentcolor\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2012\/10\/0743.image_thumb_3712F974.png\" alt=\"image\" width=\"174\" height=\"130\" border=\"0\" \/><\/p>\n<h2><span style=\"font-family: Segoe UI Light\">Issue<\/span><\/h2>\n<p>It is not simple to implement a consistent branching model as part of team project or team creation process, that complies with the <a href=\"http:\/\/vsarbranchingguide.codeplex.com\/\">VS TFS Branching and Merging Guide<\/a>.<\/p>\n<h2><span style=\"font-family: Segoe UI Light\">Resolution<\/span><\/h2>\n<p>Team Foundation Server has extensive support for version control and branching management through the object model. You can create your own solution, using the sample command line tool, in the <a href=\"http:\/\/vsarguidance.codeplex.com\/releases\/view\/96222\">Quick Response<\/a> download package.<\/p>\n<h2><span style=\"font-family: Segoe UI Light\">Sample<\/span><\/h2>\n<p>To use the sample, proceed as follows:<\/p>\n<ul>\n<li>Rebuild the sample code using Visual Studio 2012, whereby you require the TFS Object Model (OM).<\/li>\n<li>Run the TfsBranchTool.exe command line tool with the \/? parameter to get started.<\/li>\n<\/ul>\n<p>Examples:<\/p>\n<ul>\n<li><strong>TfsBranchTool<\/strong> \/?<\/li>\n<li><strong>TfsBranchTool &#8220;Main only&#8221; \/?<\/strong><\/li>\n<li><strong>TfsBranchTool &#8220;Main only&#8221;<\/strong> \/ProjectCollectionUrl:&#8221;http:\/\/vstsr-vm2012rtm:8080\/tfs\/DefaultCollection&#8221; \/TeamProject:QRTest \/RootFolder:&#8221;$\/QRTest\/cmdline\/test\/mainonly&#8221;<\/li>\n<li><strong>TfsBranchTool Basic<\/strong> \/ProjectCollectionUrl:&#8221;http:\/\/vstsr-vm2012rtm:8080\/tfs\/DefaultCollection&#8221; \/teamproject:QRTest \/RootFolder:&#8221;$\/QRTest\/cmdline\/test\/basic&#8221;<\/li>\n<li><strong>TfsBranchTool Feature<\/strong> \/ProjectCollectionUrl:&#8221;http:\/\/vstsr-vm2012rtm:8080\/tfs\/DefaultCollection&#8221; \/TeamProject:QRTest \/RootFolder:&#8221;$\/QRTest\/cmdline\/test\/feature&#8221; \/FeatureName:f-One<br \/>\n<img decoding=\"async\" style=\"border: 0px currentcolor\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2012\/10\/7367.image_thumb_34F5FAAB.png\" alt=\"image\" width=\"427\" height=\"246\" border=\"0\" \/><\/li>\n<\/ul>\n<h2><span style=\"font-family: Segoe UI Light\">Team<\/span><\/h2>\n<ul>\n<li>ALM Ranger Contributor(s) <a href=\"http:\/\/blogs.msdn.com\/b\/willy-peter_schaub\/archive\/2012\/03\/28\/introducing-the-visual-studio-alm-rangers-esteban-garcia.aspx\">Esteban Garcia<\/a>, <a href=\"http:\/\/blogs.msdn.com\/b\/willy-peter_schaub\/archive\/2011\/03\/28\/introducing-the-visual-studio-alm-rangers-mattias-sk-246-ld.aspx\">Mattias Sk\u00f6ld<\/a>, <a href=\"http:\/\/blogs.msdn.com\/b\/willy-peter_schaub\/archive\/2012\/10\/01\/introducing-the-visual-studio-alm-rangers-tomas-scott.aspx\">Tomas Scott<\/a> and <a href=\"http:\/\/blogs.msdn.com\/b\/willy-peter_schaub\/archive\/2011\/04\/19\/introducing-the-visual-studio-alm-rangers-vladimir-gusarov.aspx\">Vladimir Gusarov<\/a><\/li>\n<li>ALM Ranger Reviewer(s) <a href=\"http:\/\/blogs.msdn.com\/b\/willy-peter_schaub\/archive\/2010\/09\/28\/introducing-the-visual-studio-alm-rangers-michael-fourie-also-known-as-mike.aspx\">Michael Fourie<\/a> | <a href=\"http:\/\/blogs.msdn.com\/b\/willy-peter_schaub\/archive\/2010\/10\/20\/introducing-the-visual-studio-alm-rangers-willy-peter-schaub.aspx\">Willy-Peter Schaub<\/a><\/li>\n<li>Product Owner\/SME: <a href=\"http:\/\/blogs.msdn.com\/b\/willy-peter_schaub\/archive\/2011\/07\/07\/introducing-the-visual-studio-alm-rangers-micheal-learned.aspx\">Micheal Learned<\/a><\/li>\n<\/ul>\n<h2><span style=\"font-family: Segoe UI Light\">Coffee break with the team<\/span><\/h2>\n<p><img decoding=\"async\" style=\"border: 0px currentcolor\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2012\/10\/3073.image_thumb_080097D0.png\" alt=\"image\" width=\"142\" height=\"101\" border=\"0\" \/><br \/>\nTo highlight the team\u2019s passion, vision and reason for the sample solution design, we asked each team member a question.<\/p>\n<ul>\n<li><strong>Mattias<\/strong> why did you sign up to lead this quick response solution, which is now your second?<br \/>\n<em>I\u2019ve used the Branching guidance a lot, hate manual work, and missed an integrated and automated solution. This was a great opportunity to build something really useful. Once I started to think about a vision for what we could accomplish I was stuck. Knowing I could do it, together with some great people from across the globe, it was a no brainer&#8230;<\/em><\/li>\n<li><strong>Vladimir<\/strong> what is the rules engine all about and why did you pick the implemented design?*<br \/>\nThe actions engine (aka Rules Engine) was designed as very abstract object model which allows defining any sequence of actions and execute them in order. <em>The idea was to split branch tool operations into basic actions like create SCC folder, perform branch, check in, etc. Combining those basic actions into different sequences provides us ability to cover different branching models we have in the guidance. *We anticipated that branching models may change frequently and there may be necessity to add more basic operations in the future. Given that, we designed action engine to be configured through XML and to be extendable even without recompilation. Design was very simple and powerful \u2013 XML lists all actions and parameters. You may pass output parameters to next action through the macro-expandable properties. Each action identified by name and engine loads action\u2019s handler as add-in through the Managed Extensibility Framework.<\/em><\/li>\n<li><strong>Tomas<\/strong> what is special about the command line parser?<br \/>\n<em>The command line parser is not so special, but the characteristic very much align with the Action Engine in that it does just reflect that parameters from the xml config files. So first it asks for the commands available, and then the parameters for that command. The challenge has been to build a piece of software that interacts with another piece of software without that much of a specification and very little communication except for immediate questions. It has been interesting to realize that when you think you are finished you get aware that there is something you missed. That is due to the fact that it is a Quick Response solution, that you work for just a few hours a week and cooperate with people over several time zones that puts in their weekly effort in other days than your own \u2013 this makes it really interesting, inspiring and challenging! It is nice to work with really talented and devoted people!<\/em><\/li>\n<li><strong>Esteban<\/strong> what nuggets can you share after working with Mathias to design and implement the version control logic?<br \/>\n<em>Testing the version control logic proved to be a bit tricky since we couldn\u2019t assume that we would always have an available TFS server to test against and of course, we were not verifying TFS\u2019s functionality. So we decided to take a look at the new Fakes framework to mock all TFS functionality. This was a really rewarding experience as we were able to unit test our version control logic without any dependencies on TFS.<\/em><\/li>\n<\/ul>\n<h2><span style=\"font-family: Segoe UI Light\">Other important highlights<\/span><\/h2>\n<p>This quick response sample was part of the \u201cNew Deliverable Experience\u201d validation. Read more in <a href=\"http:\/\/blogs.msdn.com\/b\/willy-peter_schaub\/archive\/2012\/10\/17\/alm-rangers-raising-the-quality-bar-for-tooling-part-1.aspx\">Raising the Quality Bar for Tooling (Part 1)<\/a> and <a href=\"http:\/\/blogs.msdn.com\/b\/willy-peter_schaub\/archive\/2012\/10\/17\/alm-rangers-raising-the-quality-bar-for-documentation-part-2.aspx\">\u2026 for Documentation (Part 2)<\/a>.<\/p>\n<h2><span style=\"font-family: Segoe UI Light\">Future plans<\/span><\/h2>\n<ul>\n<li>Visual Studio Team Explorer extension \u2026 coming soon!<br \/>\n<img decoding=\"async\" style=\"border: 0px currentcolor\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2012\/10\/0815.image_thumb_51AF6FC0.png\" alt=\"image\" width=\"283\" height=\"78\" border=\"0\" \/> &#8211;> <img decoding=\"async\" style=\"border: 0px currentcolor\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2012\/10\/6201.image_thumb_77A52016.png\" alt=\"image\" width=\"337\" height=\"201\" border=\"0\" \/><\/li>\n<li>Team Project creation wizard extension.<\/li>\n<li>Work with the ALM Rangers \/ ALM MVPs to extend the tooling for the community<\/li>\n<\/ul>\n<h2><span style=\"font-family: Segoe UI Light\">More ideas?<\/span><\/h2>\n<p><a href=\"http:\/\/visualstudio.uservoice.com\/\"><img decoding=\"async\" style=\"border: 0px currentcolor\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2012\/10\/3051.image_2FE3972F.png\" alt=\"image\" width=\"169\" height=\"37\" border=\"0\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Quick Response samples provide information directly from Visual Studio ALM Rangers working with the Microsoft Visual Studio Product Group and Microsoft Services, in response to feature gaps to supplement the product and knowledge base information. Update 2012\/11\/22 &#8211; Please refer to the Quick Response Sample \u2013 Visual Studio Extension to support the ALM Rangers Branching [&hellip;]<\/p>\n","protected":false},"author":77,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[226,229,1],"tags":[],"class_list":["post-4113","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ci","category-community","category-devops"],"acf":[],"blog_post_summary":"<p>Quick Response samples provide information directly from Visual Studio ALM Rangers working with the Microsoft Visual Studio Product Group and Microsoft Services, in response to feature gaps to supplement the product and knowledge base information. Update 2012\/11\/22 &#8211; Please refer to the Quick Response Sample \u2013 Visual Studio Extension to support the ALM Rangers Branching [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/4113","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/77"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=4113"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/4113\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=4113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=4113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=4113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}