敲了一個快速的PowerShell腳本2要做到這一點:
https://gist.github.com/1173044
param([int]$changelistNum, [string]$destBranch)
$regex = "^\s+//[^/]+(/\S+)\s"
$sourceFiles = p4 change -o $changelistNum | select-string $regex | %{$_.matches[0]}
$sourceFiles | %{
$sourcePath = (p4 where $_.groups[0].value.trim()).split(' ')[2];
$destPath = (p4 where ($destBranch + $_.groups[1].value)).split(' ')[2];
p4 edit $destPath;
copy $sourcePath $destPath;
p4 add $destPath;
}
(不知道爲什麼壓痕以上不工作 - 我已經8個空格爲前綴的腳本塊內?)
腳本翻出所有文件進行變更表的描述,併爲每一個嘗試找到對應的在另一個分支中的ng路徑。它蠻力強制每個文件的p4編輯和p4添加,而不是試圖猜測哪個是正確的。它非常詳細!
要複製的變更表443分支myBranch:
Copy-PendingChangelistToBranch.ps1 443 "//myBranch"
這是一件顯而易見的事情要做。爲什麼Perforce讓它變得如此痛苦? 「 – 2015-11-09 14:24:12
」5年前問,查看14087次。「 Perforce會很好地研究這些論壇,以瞭解用戶想要如何處理他們的軟件以及哪些方面不足。這裏有一個鏈接到大多數瀏覽的問題https://stackoverflow.com/search?tab=active&q=%5bperforce%5d%20views%3a2500 – 2016-03-09 11:22:03