How to use a recurring Integration Endpoint for importing data
You are here
Azure DevOps TFVC Merge Template
Let's look at the Azure DevOps Merge Template helper.
This can be found on Github.
To get started, go to the "setup" tab and fill in the relevant into. We'll need the DevOps URL for the project and the target branch we are merging code to. I typically have 3 or 4 copies of this to use as a template for each branch I want to target. I will have one for something like $/Trunk/Main, $/Dev/Main, $/Release/Main and so on for any branch that may exist. We'll walk through some examples of how to use this.
Example 1
I have a work Item with ID of 23. Work Item 23 has a changeset of 143 in /Dev/Main that needs to be merged to /Trunk/Main.
To fill out the Merge template, first we would update the setup tab to reflect the target branch for this set of merge(s). Next, we would put 23 into the task column, 143 into the changeset column and $/Dev/Main into the Source column. For the Change Request Column, if we have any other identifier for the change, we can use it here. If we do not, we can use the work item ID. You can review what that would look like here.
Example 2
I have work Item with ID 9256. Work Item 9256 has 3 changesets of 1853, 1842 and 1791 in /Dev/Dev2 that needs to be merges to /Trunk/Trunk.
To fill out the Merge template, first we would update the setup tab to reflect the target branch for this set of merge(s). Next, we would put 9256 into the task column for 3 rows, 1853 into the changeset column and $/Dev/Main into the Source colum for 1 row, 1842 for the next and 1791 for the next. For the Change Request Column, if we have any other identifier for the change, we can use it here. If we do not, we can use the work item ID. You can review what that would look like here. Finally, I want to sort on changeset from smallest to larger as I want to merge the changesets from the source in the same order as they were committed. Not doing this could have unintended consequences. In this example it is possible for you to combine changesets if they are contiguous. If not, they will be one at a time. You can review what that would look like here.
Example 3
I have 2 work Items. One has an ID of 9370 and another of 9337. All changesets are coming from /Trunk/Trunk and need to go to /Release/Release. Work Item 9370 has changesets 1836, 1801, 1794, 1471 and Work Item 9337 has changesets 1851, 1531, 1389.
Similar to last 2 examples, we punch in the various work items and changesets and update the Setup tab. Similar to Example 2, we have to manually sort on oldest changeset to newest. We are also changing the source work item for this so we have to keep that in mind while merging and attempting to consolidate changesets, if possible. You can Review what that would look like here.