Last active
August 29, 2015 14:15
-
-
Save jrotello/4f4106cc50a267db5072 to your computer and use it in GitHub Desktop.
Gets a list of all changesets from $Source branch that have not been merged into $Destination branch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.Client") | Out-Null | |
<# | |
.Synopsis | |
Gets a list of all changesets from $Source that have not been merged into $Destination. | |
.DESCRIPTION | |
Gets a list of all changesets from $Source that have not been merged into $Destination. | |
.EXAMPLE | |
$tfs = Get-TfsServer http://<hostname>:8080/tfs | |
Get-MergeCandidates -Server $tfs -Source "$/Some/Source/Branch" -Destination "$/Some/Destinsation/Branch" | |
The Get-TfsServer cmdlet is included as part of the PowerShell snapin provided by the TFS Power Tools | |
extension for Visual Studio. If everything is installed correctly, you should be able to load the snapin | |
with the following command: | |
Add-PSSnapin Microsoft.TeamFoundation.PowerShell | |
#> | |
function Get-TfsMergeCandidates { | |
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory = $true)] | |
[Microsoft.TeamFoundation.Client.TfsTeamProjectCollection] | |
$Server, | |
[Parameter(Mandatory = $true)] | |
[string] | |
$Source, | |
[Parameter(Mandatory = $true)] | |
[string] | |
$Destination | |
) | |
$service = $Server.GetService([Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer]) | |
$candidates = $service.GetMergeCandidates( | |
$Source, | |
$Destination, | |
[Microsoft.TeamFoundation.VersionControl.Client.RecursionType]::Full | |
) | |
$candidates | select -ExpandProperty changeset | |
} |
Mozketo
commented
Feb 19, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment