Tag Archives: svn

Tips: Working copy is too old (format 10, created by Subversion 1.6)

I confront a version issue of subversion that it keeps spitting “Working copy is too old (format 10, created by Subversion 1.6)” error message and recommend svn upgrade.

svn upgrade however also spits error message, “Can’t upgrade ‘/working_directory’ as it is not a pre-1.7 working copy directory”.

The reason is this version difference of svn that you are currently using on your computer is differ from one in svn checked-out folder. My case I checked out my svn repository using 1.6 and upgrade svn running on my laptop to 1.7.

I could manage this by following the following link.


In summary, there are 3 steps to resolve this issue.

1. Make a backup without hidden CSV/SVN folder. There are hidden folders for each directory for svn version management named “.svn”. The following command simply ignores copying of these files and creates a backup. ‘C’ option does this job for you.

rsync -arC working_dir working_dir_wo_svn

This will create a folder named “working_dir_wo_svn” which doesn’t contain any .svn folders.

2. Delete the old versioned working folder.

rm -rf ./working_dir

3. Check out using a new version of svn from a repository to your computer.

 svn co https://svn.example.com/project/trunk working_dir

Note that the files will be stored in “working_dir” folder.
4. Restore files to the checked-out folder,working_dir, from backup folder, working_dir_wo_svn. This command will modify (add/remove) some files to working_dir from working_dir_wo_svn if any changes were made to working_dir_wo_svn. This is bit confusing.

 rsync -ar working_dir_wo_svn working_dir

5. Check whether are there any changes were made.

 svn stat | grep "^?" | awk '{print $2}' | xargs svn add

6. If yes, check in those to the repository.

 svn ci

This can resolve my version issue in svn and hope this will help some one will struggle with.

How to resolve Subversion Conflicts


When you commit your changes, you’ll get an error message:

$ svn commit -m "Updated README"
Sending    README
Transmitting file data .svn: Commit failed (details follow):
svn: Out of date: '/myproject/README'

This is good. Subversion has detected that the file you want to commit has changed since you last updated it. Update the file to get it up-to-date again.


$ svn update
Updated to revision 6.

The ‘C’ indicates there is a conflict with the README file, and Subversion does not know how to solve this. You are called in to help.

If you now take a look at README, you’ll notice that there are several markers that indicate what parts of the code are conflicting. You can easily see what you changed, and what has changed in the repository:

<<<<<<< .mine
This is fun stuff!
This is a documentation file
>>>>>>> .r6

What are your options?

You have three options for resolving the conflict. Whatever you choose, make sure you confer with your colleague on the matter.

1. Scrap your changes, and go with the current work from your colleague.

This is the easiest solution. All you have to do is revert the changes you made, and update your working copy:

<strong><span style="color: #ff0000;">$ svn revert README</span></strong>
Reverted 'README'
$ svn update README
At revision 6.


SVN check in command line when you want to add new files in a exist folder.

This post comes from http://growingventuresolutions.com/comment/reply/325

I often update code by adding files in a bunch of directories and then need to add all thosefiles to the svn repository. Here is the command line one-liner to get that done and an explanation:

svn stat | grep "^?" | awk '{print $2}' | xargs svn add

  1. svn stat tells you the status of all the files in the directory with a question mark at the beginning of the line for any files that svn doesn’t currently know about (i.e. that aren’t under revision control).
  2. The next step is to pipe that to a grep command that looks for lines beginning with a question mark so that we can add only those items to svn.
  3. Next, since the output of svn stat is a two column listing split by whitespace with the status indicator first and the full path to the file second, we use a simple awk pattern to print out just filename
  4. Finally, we use the xargs command to take the input and pass it on to the svn add command which schedules the files to be added to the repository.

I will typically run svn stat | less first and review the output to make sure that the command is only going to add things I want. I do the same thing just before any commit. If you need to undo the addition of some file prior to the commit, simply svn revert filename or use the recursive flag like svn revert --recursive path/to/directory/ if you are dealing with a directory.

Once you’re happy with the changes, all you need to do is an actual svn commit so that the files will be permanently added to the repository.