2014-10-03 15 views
2

我正嘗試從Perforce遷移到Git。我們的發展結構如下:使用git-p4導入分支 - 未知版本或路徑不在工作樹中

版本1.3.0被創建,開發併發布到生產環境。 開發繼續,版本1.3.1是分支和開發 etc ..

目前我們有一大堆的版本是增加的順序創建。我的任務是將這些版本作爲連續分支導入,即分支1.3.1從1.3.0出來; 1.4.0分支從分支1.3.1等出來......

我使用以下命令集:

git init 
git config --add git-p4.branchList 1.3.0:1.3.1 
#continue configuration for all of the branches 
git p4 sync --detect-branches //depot/path/to/[email protected] 

最終branchList配置看起來就像這樣:

[git-p4] 
     branchList = 1.3.0:1.3.0 
     branchList = 1.3.0:1.3.1 
     branchList = 1.3.1:1.4.0 
     branchList = 1.4.0:1.5.0 
etc... 

當我運行上述命令時,出現錯誤:

Importing revision 457240 (18%) 
    Importing new branch common/1.4.0 

    Resuming with change 457240 
fatal: ambiguous argument 'refs/remotes/p4/common/1.3.1': unknown revision or path not in the working tree. 
Use '--' to separate paths from revisions, like this: 
'git <command> [<revision>...] -- [<file>...]' 
Command failed: ['git', 'rev-list', '--reverse', '--no-merges', 'refs/remotes/p4/common/1.3.1'] 

但是,如果我的branchList confi guration看起來像這樣:

[git-p4] 
      branchList = 1.3.0:1.3.0 
      branchList = 1.3.1:1.3.1 
      branchList = 1.4.0:1.4.0 
      branchList = 1.5.0:1.5.0 

導入是完全成功的,但分支歷史記錄沒有正確反映。

這裏有什麼問題?

回答

4

根據你的分支列表配置,從分支1.3.1創建分支1.4.0。 但是在第一次找到分支1.4.0的變更清單457240處,分支1.3.1仍未找到!

1.4.0和1.3.1是否可能都是從1.3.0創建的?

您的branchList配置必須匹配P4中的集成歷史記錄。

要確認P4中的集成歷史記錄,請選擇一個存在於所有分支中且很少修改的文件,並使用P4V「修訂圖表」功能。另一種方法是使用CLI命令p4 filelog //depot/path/to/file

+0

你是一個非常聰明的人得出這個結論; 1.4.0和1.3.1都是從1.3.0創建的。我有兩個後續問題 - 1)在這種情況下,Perforce試圖在1.3.1之前導入1.4.0? 2)我還沒有谷歌它,但我如何查看Perforce GUI中的集成歷史記錄?謝謝你的回答! – worldpart 2014-11-28 14:24:48

+0

找到一個文件,存在於所有分支中,並且不會經常修改,並使用p4v的版本圖功能記錄它的歷史記錄,或者使用CLI命令:'p4 filelog // depot/path/to/file' – Vitor 2014-12-01 13:41:53

相關問題