0
我做了一些嚴重的愚蠢與svn move
和svn ci
。修復由Subversion svn移動命令的部分提交導致的樹衝突
舊的目錄結構:
source/branch1/test_framework/
source/branch2/test_framework/
希望的目錄結構:
source/branch1/
source/branch2/
source/test_framework/ <-- This is a merge of the 2
預期步驟:
- 移動源/ BRANCH1/test_framework /到源/ test_framework/
- 將source/branch2/test_framework /合併到源文件中E/test_framework/
我如何開始:
[[email protected] Prod1]$ svn move source/branch1/test_framework/ source/test_framework/
A source/test_framework
D source/branch1/test_framework/main.sh
D source/branch1/test_framework
我應該做的:
[[email protected] Prod1]$ svn ci source/test_framework/ source/branch1/test_framework/ -m "Move test framework to top level."
我的愚蠢:
[[email protected] Prod1]$ svn ci source/test_framework/ -m "Move test framework to top level."
Authentication realm: <http://localhost:8443> UNIX/LDAP User Account
Password for 'dev':
Adding source/test_framework
Committed revision 274232.
[[email protected] Prod1]$ svn ci source/branch1/test_framework/ -m "Move test framework to top level."
Authentication realm: <http://localhost:8443> UNIX/LDAP User Account
Password for 'dev':
Deleting source/branch1/test_framework
svn: Commit failed (details follow):
svn: Item '/repo/CoreApps/Prod1/source/branch1/test_framework' is out of date
在這裏,我看着谷歌和StackOverflow,並做到了下面的修復建議的Item ... out of date
錯誤:
[[email protected] Prod1]$ svn update
Authentication realm: <http://localhost:8443> UNIX/LDAP User Account
Password for 'dev':
C source/branch1/test_framework
At revision 274233.
Summary of conflicts:
Tree conflicts: 1
現在我卡住這個:
[[email protected] Prod1]$ svn ci source/branch1/test_framework/ -m "Move test framework to top level."
Authentication realm: <http://localhost:8443> UNIX/LDAP User Account
Password for 'dev':
svn: Commit failed (details follow):
svn: Aborting commit: '/repo/CoreApps/Prod1/source/branch1/test_framework' remains in tree-conflict
現在我該怎樣解決這個矛盾呢?請注意,svn merge
不是問題,而只是我如何到達這裏的一個解釋點。
我會很感激的答案,給出了做什麼以及推理。
編輯 - 我用來解決我的問題的解決方案(這不是理想的接受的答案是更好):
svn status source/branch1/test_framework/
列出在svn move
svn revert source/branch1/test_framework/$FILE
刪除的文件對於上面列出的每個文件來撤銷刪除/刪除操作的svn move
svn delete source/test_framework/
撤銷的複製操作後面svn ci source/test_framework/
檢入刪除。- 請正確操作。
我修正了另一種方式。所以請解釋一下,如果我接受這個。 – Samveen
這是一種在顛覆中的撤銷/重做,一種通用的方式,用於在不做任何提交的情況下排除糟糕的提交導致的混亂狀態,而在頂端完成提交併且凌亂的提交沒有太多的智力工作它(這正是你的情況,提交是一個簡單的_svn mv_)。所以我建議盲目回滾更改,甚至不要試圖理解混亂的狀態(並節省時間),然後正確地重複svn mv。 – bobah
將此添加到答案中,並且您有一個接受(我會將我的解決方案添加到您的答案中)。 – Samveen