我正在尝试使用PowerShell编写构建脚本来检出代码。我需要能够用SVN仓库中的相应更改替换工作副本中所做的任何修改。这还包括删除在仓库中已删除但未在工作副本中删除的任何文件。
不幸的是,我无法进行全新检出,因为每次运行构建脚本时检出所有10GB代码将效率过低。我该如何解决?
我一直在尝试以下操作:
不幸的是,我无法进行全新检出,因为每次运行构建脚本时检出所有10GB代码将效率过低。我该如何解决?
我一直在尝试以下操作:
&$SVN_EXE revert $workingPath
&$SVN_EXE update $workingPath
$x = &$SVN_EXE status $localPath --no-ignore | where {$_ -match "^[\?I]"} | %{$_ -replace "^[\?I]",""} # get the status, get any items with a ? and strip them out
$x | %{$_ -replace "[`n]",", "} # Replace newlines with commas
Remove-Item $x # Remove all the unversioned items
我似乎无法将第三行的输出存储到 $x 中,而且我不确定其余部分是否正确。
我不确定这是正确的方法,但如果是的话,我似乎无法存储和解析 SVN 状态的输出。
有人有什么建议吗?谢谢!