SVN X remains in tree-conflict

37,878

Solution 1

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

Solution 2

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.

Solution 3

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

Solution 4

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.

Share:
37,878

Related videos on Youtube

Paul Knopf
Author by

Paul Knopf

Updated on September 05, 2020

Comments

  • Paul Knopf
    Paul Knopf over 3 years

    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!

    • Jay Sullivan
      Jay Sullivan about 9 years
      Also see stackoverflow.com/questions/2406469/svn-remains-in-conflict (none of the answers on this page worked for me)
    • granters
      granters almost 5 years
      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.
  • aioobe
    aioobe over 12 years
    Doesn't work for me. I get "svn: Unable to lock path/to/directory/I/just/moved/back" when trying to commit afterwards.
  • Stefan L
    Stefan L over 12 years
    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)
  • Stefan L
    Stefan L over 12 years
    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.
  • robomc
    robomc over 11 years
    This is by far the best answer.
  • Leoa
    Leoa almost 11 years
    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 worked