Functions/Get-HgOutgoingChangeset.ps1
function Get-HgOutgoingChangeset { <# .SYNOPSIS Gets all the outgoing changesets in the current directory's repository. .DESCRIPTION Returns objects representing the outgoing changes. ALIAS ghgoutc, hgout .EXAMPLE Get-HgOutgoingChangeset Returns objects representing the changesets that haven't been pushed. .EXAMPLE Get-HgOutgoingChangeset -Path C:\Projects\psHg Returns objects for any outgoing changesets in the C:\Projects\psHg repository. .EXAMPLE Get-HgOutgoingChangeset -Revision stable Returns all the outgoing changesets for the `stable` branch. #> [CmdletBinding()] param( [string] # The revision whose outgoing changesets to get. Can be a branch, revset query, etc. $Revision, [Alias('Path')] [string] # The repository whose outgoing changes to get. Defaults to the repository in the current directory. $RepoRoot = (Get-Location).Path, [string] # Specifing a explicit repository $Destination ) $rRepoRoot = Resolve-HgRoot -Path $RepoRoot if( -not $rRepoRoot ) { return } $revisionArg = '' if( $Revision ) { $revisionArg = '-r{0}' -f $Revision } $destinationArg = '' if ( $Destination ) { $destinationArg = $Destination } Push-Location $rRepoRoot try { if( -not (Test-HgDefaultPath -Outgoing) ) { Write-Error -Message ('Repository {0}''s default path setting not found.' -f $rRepoRoot) ` -RecommendedAction ('Add setting paths.default or paths.default-push to {0}.' -f (Join-Path $rRepoRoot .hg\hgrc)) ` -Category InvalidOperation return } hg out --style $PsHgStylePath $revisionArg -R $rRepoRoot $destinationArg | Split-HgXml } finally { Pop-Location } } Set-Alias -Name 'Read-HgOutgoingChangesets' -Value 'Get-HgOutgoingChangeset' Set-Alias -Name 'hgout' -Value 'Get-HgOutgoingChangeset' Set-Alias -Name 'ghgoutc' -Value 'Get-HgOutgoingChangeset' |