Powershell 修改";tf历史“;命令只生成未合并的变更集
我有两个分支,Powershell 修改";tf历史“;命令只生成未合并的变更集,powershell,command-line,tfs,Powershell,Command Line,Tfs,我有两个分支,Apple和Banana。在Apple中所有未合并的变更集中,我只想合并那些在签入注释中包含术语mergetobana的变更集 到目前为止,这是我在PowerShell脚本中的内容: Param ( [Parameter(Mandatory=$true)] [String]$ChangesetComment ) $tf = get-item "c:\program files (x86)\Microsoft Visual S
Apple
和Banana
。在Apple
中所有未合并的变更集中,我只想合并那些在签入注释中包含术语mergetobana
的变更集
到目前为止,这是我在PowerShell脚本中的内容:
Param (
[Parameter(Mandatory=$true)]
[String]$ChangesetComment
)
$tf = get-item "c:\program files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\TF.EXE"
if ($ChangesetComment) {
echo "*** Looking for all changesets containing '$ChangesetComment' in their check-in comments. This might take a while. ***"
$changesetsToMerge = & $tf history $/TeamProject/Server/Apple /noprompt /recursive | findstr $ChangesetComment
$changesetNumbers = $changesetsToMerge | % $_.changesetnumber
echo "*** Now merging filtered changesets. ***"
Foreach ($c in $changesetNumbers) {
& $tf merge /version $_.c $/IMSDev/Closed/$ScdVersion . /r /noprompt
}
}
在我的示例中,运行脚本时,changesetcoment
将设置为mergetobana
我想修改我的tf history
命令,以便它只生成Apple
中尚未合并到Banana
中的变更集信息,这样我就不必在整个历史记录中搜索签入注释中包含changesetcoment
的变更集。我怎样才能做到
关于如何改进我的脚本的任何其他建议也是受欢迎的。您可以尝试在中使用
/candidate
选项,而不是使用tf history命令
tf合并/候选源分支目标分支
例如:
tf合并/候选苹果香蕉
更多详细方法请参考此问题的答案: