Eli : Memcached, MySQL, Highcharts

Solve svn : This client is too old to work with working copy error without upgrading Subversion

At work we use two different major version of Subversion : 1.5 for our own repositories and 1.6 for everything that come from others repositories (Apache, Google Code, ...).

Reason is that we do not have time to upgrade to Subversion 1.6, and we cannot commit to Google Code without 1.6 client.

svn: This client is too old to work with working copy

It's dangerous to use 1.6 client with 1.5 working copies because Subversion 1.6 working copy format was upgraded from 1.5, this means that :

  • 1.5 and older Subversion clients will not be able to work with working copies produced by Subversion 1.6
  • Working copies are upgraded automatically
  • We get a svn: This client is too old to work with working copy message too often

Recently we made two mistake using Tortoise SVN and Subclipse for Eclipse Helios newest version in two different places, a linux server via Samba, and my Windows computer.

Nobody is able to work with theses upgraded working copies, getting this message

svn: This client is too old to work with working copy '.'.  You need
to get a newer Subversion client, or to downgrade this working copy.
See http://subversion.tigris.org/faq.html#working-copy-format-change
for details.


Working copy format change with Subversion 1.6

Subversion becomes Apache Subversion in 2010, let's check the new documentation URL on subversion.apache.org.

Sometimes the working copy metadata format changes incompatibly between minor releases. For example, say you have a working copy created with Subversion 1.4.4, but one day you decide to try out Subversion 1.5.0. Afterwards, you attempt to switch back to 1.4.4, but it doesn't work — it just gives the above error.

This is because 1.5.0 upgraded your working copy format to support some new features (in this case, changelists, the keep-local flag, and variable-depth directories). Although 1.4.4 doesn't know anything about these new features, it can at least recognize that the working copy format has been upgraded to something higher than it can handle.

Subversion team distribute a Python script that can downgrade working copies safely because this automatic upgrade behavior can be annoying.

Linux part : change-svn-wc-format.py Python script

Download and installation

We need to first download the change-svn-wc-format.py script

wget http://svn.apache.org/repos/asf/subversion/trunk/tools/client-side/change-svn-wc-format.py

Then don't forget to give execution right to it

chmod +x change-svn-wc-format.py

Testing if everything work by checking the help

 ./change-svn-wc-format.py --help
usage: change-svn-wc-format.py WC_PATH SVN_VERSION [--verbose] [--force] [--skip-unknown-format]
       change-svn-wc-format.py --help
Change the format of a Subversion working copy to that of SVN_VERSION.
  --skip-unknown-format    : skip directories with unknown working copy
                             format and continue the update

If you don't see this message, you probably got a Python error, this script use Python 2.X, check Google to help you on this subject as i'm not a specialist on it.

Downgrading working copy

I want my working copy to be downgraded to Subversion 1.5 and to see what happen so let's use this command :

./change-svn-wc-format.py /my/broken/WC/path/. 1.5 --verbose

I strongly suggest you to use --verbose, because using change-svn-wc-format.py in a path that does not exists say that ... it worked.

./change-svn-wc-format.py /this/path/does/not/exists/. 1.5
Converted WC at '/this/path/does/not/exists/.' into format 9 for Subversion 1.5

Now on a real working copy

Processing directory '.'
Parsing file '/my/broken/WC/path/.svn/entries'
Updating file '/my/broken/WC/path/.svn/format'
/my/broken/WC/path/.svn/format does not exist, creating it.
Checking whether WC format can be converted
Writing WC format
[...]
Writing WC format
Converted WC at '/my/broken/WC/path/' into format 9 for Subversion 1.5

A simple status command to check everything :

svn status -u
Status against revision:    604

It worked !

Windows part for change-svn-wc-format.py

Python download and installation

Subversion script use Python 2.X, so download it from this download page, then install it.

Add Python directory (C:/Python27 here) to your Windows environment variable "Path", open Control Panel > System > Advanced Panel > Environment variables > Path > Modify.
A screen in a french Windows XP can help you /blog/public/windows_python_env_path.png.

Download and test change-svn-wc-format.py

Open http://svn.apache.org/repos/asf/subversion/trunk/tools/client-side/change-svn-wc-format.py and "Save As" the script on your computer.
Then open a DOS command prompt windows and execute this command to check correct python installation

python change-svn-wc-format.py --help

If you 've got the following message your are using Python 3.X and you need to install Python 2.X

  File "change-svn-wc-format.py", line 99
    except UnrecognizedWCFormatException, e:
                                        ^
SyntaxError: invalid syntax

Both version can be installed at the same time, but only one can be put in Windows environment variable "Path" or you can try the conversion tool for Python 2.x code from 2to3 tools.

Downgrading working copy

Open a DOS command prompt windows then execute

C:\>python change-svn-wc-format.py c:/my/broken/working/copy 1.5 --verbose
Processing directory 'c:/my/broken/working/copy.'
Parsing file 'c:/my/broken/working/copy.svn/entries'
Updating file 'c:/my/broken/working/copy/.svn/format'
[...]
Converted WC at 'c:/my/broken/working/copy' into format 9 for Subversion 1.5

Again I strongly suggest you to use --verbose using change-svn-wc-format.py in a path that does not exists say that ... it worked.

Hope that after losing hour after hour we finally get some green light to upgrade Subversion.

Related Posts





comments powered by Disqus

You may also be interested in