svn版本过低无法读取高版本的workcopy的问题

当使用低版本的cygwin svn(1.4.5)尝试访问由TortoiseSVN 1.6.2创建的工作副本时,会遇到错误提示。为了解决此问题,无需升级cygwin中的svn,而是选择从源代码编译安装更高版本的Subversion。在编译安装过程中遇到错误,通过查阅Subversion FAQ找到了一个脚本,该脚本可以将工作副本格式降级以适应旧版本的svn。通过运行这个脚本,成功地在不升级Subversion的情况下解决了问题。
摘要由CSDN通过智能技术生成

 

由于工作环境依赖于cygwin,TortoiseSVN .

之前的TortoiseSVN 比较消耗系统资源,经常弄得系统无响应。升级到TortoiseSVN 1.6.2版本后,这个问题得到了较好的解决,可随之而来的问题是:cygwin中svn的版本是1.4.5, 无法读取TortoiseSVN 1.6.2的workcopy。而本人偶尔会使用命令行来处理一些事情,在经过一番google后,终于搞定了。

在TortoiseSVN 1.6.2的work copy目录下使用 svn info 得到如下的提示:

$ svn info
svn: This client is too old to work with working copy '.'; please get a newer Su
bversion client

看来是cygwin中的svn版本很低

$ svn --version
svn, version 1.4.5 (r25188)
   compiled Sep 19 2007, 23:10:31

Copyright (C) 2000-2006 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
  - handles 'http' scheme
  - handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme

确实有点低,google一下没有找到cygwin先有新的版本,于是下载subversion-1.6.2.tar.gz,按照READE和INSTALL的说明 一步一步从源代码编译安装。

刚开始一切都很顺利,可到了 make时却出现了错误:


.libs/fs_fs.o: In function `svn_fs_fs__add_change':
/cygdrive/d/subversion-1.6.2/subversion/libsvn_fs_fs/fs_fs.c:4783: undefined ref
erence to `_svn_fs_path_change2_create'
Creating library file: .libs/libsvn_fs_fs-1.dll.a
collect2: ld returned 1 exit status
make: *** [subversion/libsvn_fs_fs/libsvn_fs_fs-1.la] Error 1

有Google了一番,重新仔细阅读README INSTALL ,rm libsvn*等等,还是没有解决。

快要崩溃时,想到了 Subversion FAQ,还真找到了,FAQ啊 太帅了:

I get an error that says "This client is too old".

You're using both an older (pre-1.4) version of the Subversion command-line client, and Subclipse. You recently upgraded Subclipse, and now your command-line client says
svn: This client is too old to work with working copy
'/path/to/your/working/copy'; please get a newer Subversion client
This happened because Subversion's working-copy format changed incompatibly—the new version of Subclipse upgraded your working copy, so now your command-line program, which is old, cannot read it. (This problem isn't specific to Subclipse; it would also have happened if you'd used a command-line client that was 1.4 or newer, along with your older command-line client.) The fix is simply to upgrade your command-line client to 1.4 or newer. As of Subversion 1.5, a helper script is provided to downgrade working copies to formats compatible with earlier releases of Subversion; see  this faq.

I got an error saying "This client is too old to work with working copy '...' ". How can I fix it without upgrading Subversion?

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.

1.5.0 upgraded the working copy for a good reason: it realizes that 1.4.4 does not know about these new features, and that if 1.4.4 were to meddle with the working copy metadata now, important information might be lost, possibly causing corruption (see issue #2961 , for example).

But this automatic upgrade behavior can be annoying, if you just want to try out a new release of Subversion without installing it permanently. For this reason, we distribute a script that can downgrade working copies when doing so is safe:

http://svn.collab.net/repos/svn/trunk/tools/client-side/change-svn-wc-format.py

Run that script with the "--help " option to see how to use it. As future versions of Subversion are released, we will try to keep this FAQ entry up-to-date with potential downgrade scenarios and their implications.

 

 

 

 

 

 

脚本源码:

 


#!/usr/bin/env python

#

# change-svn-wc-format.py: Change the format of a Subversion working copy.

#

# ====================================================================

#    Licensed to the Apache Software Foundation (ASF) under one

#    or more contributor license agreements.  See the NOTICE file

#    distributed with this work for additional information

#    regarding copyright ownership.  The ASF licenses this file

#    to you under the Apache License, Version 2.0 (the

#    "License"); you may not use this file except in compliance

#    with the License.  You may obtain a copy of the License at

#

#      http://www.apache.org/licenses/LICENSE-2.0

#

#    Unless required by applicable law or agreed to in writing,

#    software distributed under the License is distributed on an

#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

#    KIND, either express or implied.  See the License for the

#    specific language governing permissions and limitations

#    under the License.

# ====================================================================


import sys

import os

import getopt

try:

  my_getopt = getopt.gnu_getopt

except AttributeError:

  my_getopt = getopt.getopt


### The entries file parser in subversion/tests/cmdline/svntest/entry.py

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值