svn 常见错误分析

svn: Failed to add file 'Makefile': an unversioned file of the same name already exists
执行更新(svn up)时报错。由于其余人新增一个文件到服务器,而本地却存在一个同名文件(未版本控制)

先将本地重名文件更名,再执行"svn up",以后再比较、合并文件。或者执行 "svn up --force"html


这时可能会出现系统提示,由于subversion发现了local work copy和repository上的不一致。须要svn用户本身裁决,能够直接输入tf,即便用repository上版本便可,由于你没有更改project文件。即:

Conflict discovered in ‘EuM1.xcodeproj/project.pbxproj’.
Select: (p) postpone, (df) diff-full, (e) edit,
(mc) mine-conflict, (tc) theirs-conflict,
(s) show all options: s

(e)  edit             – change merged file in an editor
(df) diff-full        – show all changes made to merged file
(r)  resolved         – accept merged version of file

(dc) display-conflict – show all conflicts (ignoring merged version)
(mc) mine-conflict    – accept my version for all conflicts (same)
(tc) theirs-conflict  – accept their version for all conflicts (same)

(mf) mine-full        – accept my version of entire file (even non-conflicts)
(tf) theirs-full      – accept their version of entire file (same)

(p)  postpone         – mark the conflict to be resolved later
(l)  launch           – launch external tool to resolve conflict
(s)  show all         – show this list

Select: (p) postpone, (df) diff-full, (e) edit,
(mc) mine-conflict, (tc) theirs-conflict,
(s) show all options: tf

在这里,若是记不清楚各个选项的含义,能够输入s了解。另外,若是不肯定本身是否更改了本地的project文件,能够输入dc了解本地代码和repository上的差别。

可是,若是你也为项目增长了新文件,这样你的本地project文件和repository上的project文件都有新的内容。我如今的作法是 tc,即让svn自动合并,固然合并的是有问题的,会标出哪部分是我本地的,哪部分是repository上的,我是手工解决冲突,而后再次提交,通知项 目成员更新。



编号
出错信息
问题剖析
解决方案
1.

svn: Server sent unexpected return value (500 Internal Server Error) in response to OPTIONS request for 'http://svn.moon.ossxp.com/svn/test'
错误的用户名
检查登陆的用户名是否输入错误

svn: 服务器发送了意外的返回值(500 Internal Server Error),在响应 “OPTIONS” 的请求 “http://svn.moon.ossxp.com/svn/test” 中
2.

svn: OPTIONS of 'http://svn.moon.ossxp.com/svn/test': authorization failed: Could not authenticate to server: rejected Basic challenge (http://svn.moon.ossxp.com)
错误的口令
用正确的用户名/口令登陆

svn: 方法 OPTIONS 失败于 “http://svn.moon.ossxp.com/svn/test”: 认证失败: Could not authenticate to server: rejected Basic challenge (http://svn.moon.ossxp.com)
3.

svn: Server sent unexpected return value (403 Forbidden) in response to OPTIONS request for 'http://svn.moon.ossxp.com/svn/test'
用户无权限
联系管理员,为用户分配权限

svn: 服务器发送了意外的返回值(403 Forbidden),在响应 “OPTIONS” 的请求 “http://svn.moon.ossxp.com/svn/test” 中
4.

svn: OPTIONS of 'http://www.moon.ossxp.com/svn/test': 200 OK (http://www.moon.ossxp.com)
服务器地址错误,是普通Web页面,不支持SVN的 WebDAV 协议
确认输入正确的 SVN 服务地址。能够在浏览器中输入该地址进行确认

svn: 方法 OPTIONS 失败于 “http://www.moon.ossxp.com/svn/test”: 200 OK (http://www.moon.ossxp.com)
5.

The version of your subversion (client) is below 1.5.0, upgrade to 1.5.0 or above. SVN below 1.5.0 can not handle mergeinfo properly. It can mess up our automated merge tracking!
是因为客户端的软件版本低于1.5.0形成的。服务器端对客户端软件版本进行了限制,以避免对合并跟踪破坏。
升级本地的Subversion客户端软件到1.5.0或以上版本。
6.

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.
安装了多个版本的SVN客户端(TSVN,Subclipse,...),且各个客户端的版本不一致。高版本的SVN客户端会自动更新本地工做目录中的 .svn 目录下的文件格式,致使旧版本的SVN客户端不能继续访问该本地工做目录
将本机安装的全部的SVN客户端都更新到同一个大版本,以免本地工做目录的格式不一致

svn: 此客户端对于工做副本 “.” 太旧。你须要取得更新的 Subversion 客户端,或者降级工做副本。 参见 http://subversion.tigris.org/faq.html#working-copy-format-change 以得到更详细的信息。
7.

svn: Working copy 'trunk/src' locked svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
异常操做致使目录没有解锁。
一个简单的重现方法:在 .svn 目录下建立空的名为 lock 的文件
使用命令行"svn cleanup" 或者相似的“清理”动做删除锁定

svn: 工做副本“trunk/src”已经锁定 svn: 运行“svn cleanup”删除锁定 (输入“svn help cleanup”获得用法)
8.

日志中没有做者信息: ------------------------------------ r9 | (没有做者信息) | … ossxp.com anonymous commit test
匿名提交致使没有做者信息
检查版本库权限控制,禁止匿名提交
9.

正在发送 ... 传输文件数据.svn: 提交失败(细节以下): svn: Commit blocked by pre-commit hook (exit code 1) with output: 提交说明至少应包含 4 个字符, 或者太简单了。
这是因为用户提交的提交说明(commit log),太过简单了。在提交时须要输入有意义的 commit log。
写有意义的提交说明,或者请求管理员更改版本库插件
10.

增长 Logger.c 传输文件数据.svn: 提交失败(细节以下): svn: Commit blocked by pre-commit hook (exit code 1) with output: Wide character in print at /opt/svn/svnroot/myrepos/hooks/scripts/check-case-insensitive.pl line 259. 发现文件名大小写冲突: trunk/src/Logger.c 已经存在于 logger.c
管理员设置了对新增文件是否重名(只有大小写不一样)的文件进行检查。文件名只有大小写不一样,在Windows上进行检出会形成麻烦
不要添加剧名(仅大小写不一样)文件

增长 src/文件aBc.txt 传输文件数据.svn: 提交失败(细节以下): svn: Commit blocked by pre-commit hook (exit code 1) with output: Clash: '/trunk/src/文件aBc.txt' '/trunk/src/文件abc.txt'
11.

svn: While preparing '/home/jiangxin/tmp/svn.test/trunk/src/README.txt' for commit svn: Inconsistent line ending style
提交的文件已经设置了 svn:eol-style 属性,可是该文本内的换行符有DOS的换行符CRLF,也有Unix换行符LF,不一致!
统一该文本文件内的换行符。Linux 下能够用dos2unix, unix2dos, sed等命令。Windows下可用UltraEdit 进行转换。

svn: 当为提交操做准备“/home/jiangxin/tmp/svn.test/trunk/src/README.txt”时 svn: 不一致的行结束样式
12.

svn: Failed to add file 'Makefile': an unversioned file of the same name already exists
执行更新(svn up)时报错。由于其余人新增一个文件到服务器,而本地却存在一个同名文件(未版本控制)
先将本地重名文件更名,再执行"svn up",以后再比较、合并文件。或者执行 "svn up --force"

svn: 增长文件 'Makefile' 失败: 同名未版本控制的文件已存在
13.

Adding src/Makefile svn: Commit failed (details follow): svn: File '/svn/test/trunk/src/Makefile' already exists
添加新文件,提交时报错。由于其余人已经先于我增长了该文件。
先执行更新操做("svn up"),再根据提示进行操做:合并/提交...

增长 src/Makefile svn: 提交失败(细节以下): svn: 文件“/svn/test/trunk/src/Makefile”已存在
14.

$ svn up Conflict discovered in 'Makefile'. Select: (p) postpone, (df) diff-full, (e) edit, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: p C Makefile Updated to revision 5. Summary of conflicts: Text conflicts: 1
多人同时编辑同一个文件时,可能会遇到冲突。别人先于我提交,则当我提交时要先更新。更新可能遇到不能自动解决的冲突
使用工具进行冲突解决

$ svn up 在 “Makefile” 中发现冲突。 选择: (p) 推迟,(df) 显示所有差别,(e) 编辑, (mc) 个人版本, (tc) 他人的版本, (s) 显示所有选项: p C Makefile 更新到版本 5。 冲突概要: 正文冲突:1
15.

svn: Commit failed (details follow): svn: File 'Makefile' is out of date svn: File not found: transaction '6-d', path '/trunk/src/Makefile'
提交的文件已被他人删除
先执行更新操做("svn up"),再根据提示解决该树冲突:删除文件或继续添加...

svn: 提交失败(细节以下): svn: 文件 “Makefile” 已通过时 svn: File not found: transaction '6-c', path '/trunk/src/Makefile'
16.

svn: Commit failed (details follow): svn: File or directory '/trunk/XXX' is out of date; try updating svn: resource out of date; try updating
基于旧版本修改是不容许的
先更新("svn update"),再提交

svn: 提交失败(细节以下): svn: 文件或目录 “/trunk/XXX” 已通过时;请先更新 svn: resource out of date; try updating
17.

svn: DAV request failed; it's possible that the repository's pre-revprop-change hook either failed or is non-existent svn: At least one property change failed; repository is unchanged svn: Error setting property 'log': Repository has not been enabled to accept revision propchanges; ask the administrator to create a pre-revprop-change hook
修改提交说明等操做属于高风险操做,由于该操做没有被版本控制,属于不可恢复的操做。缺省禁止。
请联系管理员,启用该版本的相关钩子,容许修改“版本属性”。参见 管理员钩子设置

svn: DAV 请求失败;多是版本库的 pre-revprop-change 钩子执行失败或者不存在 svn: 至少有一个属性变动失败;版本库未改变 svn: 设置属性 “log” 出错: Repository has not been enabled to accept revision propchanges; ask the administrator to create a pre-revprop-change hook
18.

传输文件数据.svn: 提交失败(细节以下): svn: Commit blocked by pre-commit hook (exit code 1) with output: ==================== trunk/src/File.c : 属性 svn:mime-type 或者 svn:eol-style 没有设置 ==================== 管理员已经启用换行符属性检查。每个新添加的文件必须 指定换行符。若是 svn:mime-type 属性为文本文件,则 必须设置 svn:eol-style 属性。 对于二进制文件,执行以下命令: svn propset svn:mime-type application/octet-stream path/of/file 对于文本文件,能够执行以下命令: svn propset svn:mime-type text/plain path/of/file svn propset svn:eol-style native path/of/file 为了不每次添加文件手动设置,能够启用自动属性设置 ...

xcode