Reputation: 3540
I did some serious stupidity with svn move
and svn ci
.
Old directory structure:
source/branch1/test_framework/
source/branch2/test_framework/
Desired directory structure:
source/branch1/
source/branch2/
source/test_framework/ <-- This is a merge of the 2
Expected steps:
How I started:
[dev@bld 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
What I should have done:
[dev@bld Prod1]$ svn ci source/test_framework/ source/branch1/test_framework/ -m "Move test framework to top level."
My Stupidity:
[dev@bld 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.
[dev@bld 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
Here, I looked up Google and StackOverflow and did the following fix suggested for the Item ... out of date
error:
[dev@bld 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
Now I get stuck with this:
[dev@bld 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
Now how do I fix this conflict? Please note that the svn merge
is not an issue, and is instead just an explanation point of how I reached here.
I'd appreciate answers that give the reasoning on what to do as well.
Edit - The solution I used to fix my issue (This is not ideal. The accepted answer is better):
svn status source/branch1/test_framework/
to list the files deleted during the svn move
svn revert source/branch1/test_framework/$FILE
for each file listed above to undo the removal/deletion action of the svn move
svn delete source/test_framework/
to undo the copy action of the svn move
followed by svn ci source/test_framework/
to check-in the deletion.Upvotes: 0
Views: 2188
Reputation: 18864
This is a sort of undo/redo functionality in Subversion, a generic way of sorting out the messy state of the repository caused by a bad commit, when not many commits are done on the top and the messy commit does not have much intellectual work in it (which is exactly your case, commit is a simple svn mv
). So basically I suggest to blindly roll back the change without even trying to understand the messy state (and save time) and then repeating svn mv
correctly.
Upvotes: 1