Home > Software > svn merge hell!

svn merge hell!

August 30th, 2006
svn: REPORT request failed on '/svn/rhg/!svn/vcc/default'
svn: Working copy path 'path/to/afile/in/your/project/a_file_that_is_broken' does not exist in repository

If you’ve ever seen this error you’ve probably resorted to ‘rm -rf’

Thanks to some of the great minds of revolution we have a simple fix that involves editing the .svn/entries file and locating an incorrect attribute revision=”0″

And to automate this I wrote a little ruby script. It uses libxml-ruby because I wanted to get fimilar with the API, which thankfully is very similar to the C API.

Note: This only applies to subversion 1.3 client, the newer 1.4 client does not generate xml property files.

#!/usr/bin/env ruby
require 'find'
require 'pathname'
require 'rubygems'

require 'xml/libxml'
# going to search through all the folders in the current project
# and locate all .svn/entries files.  Parse each file looking for
# bad entries
# a bad entry is defined as
# any entry with a revision="0"

# that is not scheduled="add"

def start_doc
end

def start_element(name,attrs, entry_path)

 if( name == "entry" && attrs["revision"] == "0" && attrs["schedule"] != "add" )

   puts "Potential Error in #{entry_path}"
 end
end

def end_element(name)

end

def chars
end
def comments
end

subversion_folder = /\.svn$/i

root_path = Pathname.new(".").realpath
Find.find(root_path) do |file_name|

 if subversion_folder.match(file_name)
   Find.find(file_name) do |sub_file|

     entry_file = File.basename(sub_file)
     if entry_file == "entries"

       entry_path = "#{file_name}/#{entry_file}"
       parser = XML::SaxParser.new

       parser.on_start_element {|name,attrs| start_element( name, attrs, entry_path ) }

       parser.on_end_element {|name| end_element(name) }
       parser.filename = entry_path

       parser.parse
       break
     end
   end
 end

end

Software , ,

  1. December 1st, 2008 at 10:29 | #1

    Hi there thank you for your research. it helped me to diagnose the problem that I had on my web site but your solution did not work for me. I have written a blog article on my one and a script that is written in bash so it will provide a little more accessibility to those of use still using LAMP servers that don’t have or need ruby capabilities.
    the the blog is located here.
    http://sanguisdevelopment.com/content/svn-merger-errors-working-copy-path-does-not-exist-repo

    JOsh Beauregards last blog post..My email was rejected, and in the email it said "550 Access denied". I want to send email!

  1. No trackbacks yet.
CommentLuv Enabled

Comments links could be nofollow free.