SVN X remains in tree-conflict
Asked Answered
O

6

25

I am using VisualSVN (which uses Tortoise). I accidentally move a folder to a different location. When tries to move it back, SVN pukes with this error. It happened once before and I managed to do some random updates/commits, not knowing what I was doing and it was "fixed". I cannot pull the same magic again, so I need to know how to get my files and directory and of tree-conflict.

Thanks!

Ordinary answered 13/4, 2010 at 1:42 Comment(2)
Also see https://mcmap.net/q/99687/-svn-remains-in-conflict (none of the answers on this page worked for me)Plant
Note that this can occur even if you "do things right" - i.e. someone moves around folders on you in the repo and you don't know about it.Bagpipe
U
16

I had the same error (tree conflict), but from a different workflow.

Find what process has the lock. Download Handle.exe, and open to the folder you extracted to. Then run "C:\path\handle.exe" "C:\path\FileOrFolder".

https://technet.microsoft.com/en-us/sysinternals/bb896655.aspx

Workflow to reproduce:

- delete folder (having one of the files locked by a program that is within this folder)
- commit parent folder of folder you deleted, and look for red text of the folder you deleted (it should be brown, not red if there aren't issues in SVN)

To fix:

- forcefully kill the lock (or close the program so it releases the lock)
- run cleanup command on folder you deleted
- revert folder you deleted
- delete folder you deleted
- commit parent folder of folder you deleted
Unbalanced answered 2/4, 2012 at 19:18 Comment(1)
This is by far the best answer.Match
A
17

I'm not sure what state it's in now, but your best bet would probably be to:

  1. Move the folder out of your repository completely
  2. Do an svn cleanup
  3. Do an svn update
  4. Copy the files from the folder back (without the .svn files) overwriting the old source files that were just svn updated.
Aretino answered 13/4, 2010 at 1:46 Comment(1)
Doesn't work for me. I get "svn: Unable to lock path/to/directory/I/just/moved/back" when trying to commit afterwards.Wahhabi
U
16

I had the same error (tree conflict), but from a different workflow.

Find what process has the lock. Download Handle.exe, and open to the folder you extracted to. Then run "C:\path\handle.exe" "C:\path\FileOrFolder".

https://technet.microsoft.com/en-us/sysinternals/bb896655.aspx

Workflow to reproduce:

- delete folder (having one of the files locked by a program that is within this folder)
- commit parent folder of folder you deleted, and look for red text of the folder you deleted (it should be brown, not red if there aren't issues in SVN)

To fix:

- forcefully kill the lock (or close the program so it releases the lock)
- run cleanup command on folder you deleted
- revert folder you deleted
- delete folder you deleted
- commit parent folder of folder you deleted
Unbalanced answered 2/4, 2012 at 19:18 Comment(1)
This is by far the best answer.Match
N
2

http://rubyjunction.us/subversion-hell-sh

Edit

Here's the shell script from the link, which could be useful to Linux/Unix users...

#!/bin/sh

if [ "" == "$1" ] ; then
  echo "Usage: subversion-hell.sh A_PROJECT"
  echo "A_PROJECT should be a Subversion folder you are having problems with,"
  echo "and you should be in the folder above A_PROJECT"
fi

DIR=`pwd`
PWD=$DIR
DIR=`echo $DIR | sed s/^.*\\\/trunk/trunk/`

mkdir ~/tmp/       2>/dev/null
rm -Rf ~/tmp/$1   2>/dev/null
mv ~/$DIR/$1 ~/tmp/
find ~/tmp/$1/ -iname '.svn*' -exec rm -Rf {} \; 2>/dev/null
cd $PWD
echo svn co YOUR_URL_HERE/$DIR/$1 $1
svn co YOUR_URL_HERE/$DIR/$1 $1
cp -Rf ~/tmp/$1/* $PWD/$1/

# YOUR_URL_HERE can be found by looking in file .svn/entries, near the top
Niemann answered 26/10, 2010 at 20:6 Comment(3)
Ehm... won't that remove your home directory if the "problematic folder" is ".."?! (it would be ignoring the usage information in the script of course, but still a little bit dangerous)Doited
Another thing, the "cp" at the end won't copy any modified files or directories starting with a "." (period) back over what was updated from SVN.Doited
I made a copy and then deleted the folders from the svn and the local file system. Then on windows I needed to make the hidden folders visible. Then I deleted all folders with the .svn in the folders I wish to update. then I committed the folders. and that workedBoylan
B
1

I had the same problem when tried to delete a branch on linux enviroment. What I did was:

  1. svn revert branch
  2. svn up
  3. svn cleanup
  4. svn remove branch - mark the branch again for removal
  5. svn ci

I don't know what the problem was but I experienced it twice in two weeks.

Backstay answered 23/8, 2012 at 7:9 Comment(0)
S
0

Keep a backup of the folder that you have moved. Now in SVN, click on TortoiseSVN>>Resolved. Select the files/folder and resolve. Now update/commit the svn data.

Scum answered 21/9, 2016 at 12:5 Comment(0)
B
0

Note that this can occur even if you "didn't do anything" - i.e. someone moves around folders on you in the repository and you don't know about it. Happened to me. If this is the case, delete the problem folder from your repository and svn update.

A tree conflict occurs when a developer moved/renamed/deleted a file or folder, which another developer either also has moved/renamed/deleted or just modified. There are many different situations that can result in a tree conflict, and all of them require different steps to resolve the conflict.

Bagpipe answered 20/6, 2019 at 16:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.