SVN的使用

1.Attempted to lock an already-locked dir
svn: Working copy 'x:\mywork\project\res\layout' locked

 

原因:

产生这种情况大多是因为上次svn命令执行失败且被锁定了。

如果cleanup没有效果的话只好手动删除锁定文件。

cd 到svn项目目录下,然后执行如下命令

del lock /q/s

就把锁删掉了。

图片:如下

原文:http://my.oschina.net/whp/blog/53255

 

 

2.检出项目

例如检出一个开源项目:

svn co http://www.cl.cam.ac.uk/research/dtg/code/svn/android-tor/

3.更改SVN插件记住的用户名和密码

windows-->preference-->Team-->SVN查看SVN接口:

3.1.JavaHL

删除这个目录C:\Users\“用户名”\AppData\Roaming\Subversion\auth下面的所有文件、文件夹。重启Eclipse就OK了。

3.2.SVNkit(此情况没有尝试)

如果你用的SVNKit, 找到以下目录并删除.keyring文件.
         [eclipse_home]\"configuration"\org.eclipse.core.runtime

4.去除TortoiseSVN记住的用户名和密码

最近研究使用SVN来同步工作机器和个人笔记本之间的文档资料,最先尝试的是google code服务,客户端用的是常见的TortoiseSVN,在使用过程中遇到一个问题,经过搜索最终解决。现在把问题与解决思路记在这里备查。

在第一次使用TortoiseSVN从服务器CheckOut的时候,会要求输入用户名和密码,这时输入框下面有个选项是保存认证信息,如果选了这个选项,那么以后就不用每次都输入一遍用户名密码了。

不过,如果后来在服务器端修改了用户名密码,则再次检出时就会出错,而且这个客户端很弱智,出错之后不会自动跳出用户名密码输入框让人更新,我找了半天也没找到修改这个用户名密码的地方。

最终,找到两种解决办法:

办法一:在TortoiseSVN的设置对话框中,选择“已保存数据”,在“认证数据”那一行点击“清除”按钮,清楚保存的认证数据,再检出的时候就会重新跳出用户名密码输入框。

如果方法一不起作用,则可以采用方法二:

Tortoise的用户名密码等认证信息都是缓存在客户端文件系统的这个目录:

C:\Documents and Settings\Administrator\Application Data\Subversion\auth

删除auth下面的所有文件夹,重新连接远程服务器进行检出,对话框就会出现!

转自:http://tony.san.blog.163.com/blog/static/9293675220094643012394

5.svn check out和export的区别

check out回来的项目带有版本控制信息,

export回来的项目没有版本控制信息。

6.SVN一些命令的使用

svn mkdir --parents -m "初始导入" http://xxx.3322.org/svn/test/trunk/asset在本地建立一个workingcopy

svn checkout http://xxx.3322.org/svn/test/trunk/asset -r HEAD --depth=immediates --force g:\test

svn add g:\test\*  ;add命令实际做了什么呢?

svn import -m "hello" g:\atest http://308.f3322.org/svn/test/trunk/asset

 

svn:ignore属性操作:

svn propget svn:ignore d:\mywork\myproject > d:\tmpfile  读取属性到一个文件

在读取出的属性文件中可以设置一些要忽略的文件或目录

*.apk
*.class
*.dex
*.jar
*.ap_
.classpath
.project
project.properties
bin

svn propset svn:ignore -F d:\tmpfile d:\mywork\myproject  将文件中的属性应用到项目中的svn:ignore属性中。

 

svn delete命令:

svn delete --force g:\atest\*  删除一个workingcopy比较危险,不知道能不能找回?

 

问题:命令行提交的时候如何应用svn:ignore属性呢?

 

7.Moving a Subversion Repository to Another Server(迁移svn版本库数据到另一台windows服务器)

Moving a subversionrepository from one server to another, while still preserving all your versionhistory may seam like a daunting task, but fortunately it's not too difficult.

I recently had tomove a subversion (svn) repository to another server. The repository was on aWindows server and had to be moved to a Linux server.

Step 1: Backup your oldRepository

The first thing youneed when moving from one server to another is adump of your subversionrepository. Hopefully you are already creating dump's with a backup script, butif not here's how you can create a subversion dump file:

svnadmin dump /path/to/repository > repo_name.svn_dump

The dump filecontains all the revisions you have ever made to your svn repository, so itwill probably be quite large (it even includes files you may have deleted in aprevious revision).

Step 2: Create the newRepository

Now, simply transferthe dump file on to your new subversion server, and create an empty repository:

svnadmin create /path/to/repository

Step 3: Import your oldrepository into the new one

Next import your dumpfile:

svnadmin load /path/to/repository < repo_name.svn_dump

You may want to forcesubversion to use the same UUID for the new repository as the old repository.To do this add--force-uuid to yoursvnadmin load command.In my case I wanted to do this. If you have already loaded your repository,there is a way to set the UUID at a later date, check the docs.

That's it, you nowhave a replica of your old repository on your new server.

FAQ's

What if someonecommitted a new revision to the old server during installation?

You can easily importthe new revision, by creating an incremental dump on the old server:

svnadmin dump --incremental -r 1234 /path/to/repository > rev1234.svn_dump

Now to import thatrevision on your new server:

svnadmin load /path/to/repository < rev1234.svn_dump

Can't I just use ahotcopy to restore the repository?

It depends, hotcopiescreated with svnadminhotcopymust be moved to a server with identical setup. You should have the sameversion of subversion installed on both servers, same operating system, etc.

Subversion dumps aredesigned to work with different versions of subversion, and are just moreflexible. Hotcopies are handy to have, but I recommend creating both hotcopiesand dumps as part of your backup plan.

8.svn版本库迁移后在查看viewvc的时候产生错误

Windows7 64位,Collabnet subversion4.0.3

错误详情如下:

An Exception Has Occurred
Python Traceback

Traceback (most recent call last):
  File "C:\csvn\lib\viewvc\viewvc.py", line 4325, in main
    request.run_viewvc()
  File "C:\csvn\lib\viewvc\viewvc.py", line 257, in run_viewvc
    cfg.options.svn_config_dir)
  File "C:\csvn\lib\view​vc\vclib\svn\__in​it__.py", line 53, in SubversionRepository
    import svn_repos
  File "C:\csvn\lib\view​vc\vclib\svn\svn_​repos.py", line 25, in <module>
    from svn import fs, repos, core, client, delta
  File "C:\csvn\lib\svn-​python\svn\fs.py",​ line 19, in <module>
    from libsvn.fs import *
  File "C:\csvn\lib\svn-​python\libsvn\fs.p​y", line 22, in <module>
    import _fs
ImportError: DLL load failed The operating system cannot run %1 _fs

解决办法如下:

That error is listed in the FAQ.  It is typically caused by a conflicting version of the OpenSSL library installed in system32 folder.  Move libeay32.dll and ssleay32.dll out of that folder into some temp folder.  It should resolve the problem.
将windows System32目录中libeay32.dll,ssleay32.dll备份一下,然后将svn目录中的这两个文件复制过去,或许需要重启一下电脑或者apache服务器。

9.代码提交后在fisheye上不能查看,提示一个错误dbException,could not pocess request具体错误号忘记了。

瞎忙乎了一个月,最后是将项目的名字去掉,把项目下面的子目录和文件直接提交到svn上解决了,不知道什么原理。不得不说,端的是神奇。

 晚上回去突然想到,出这个问题的原因是因为缺少了一个目录路径,实际路径http://host/svn/project/android/moli,fisheye配的路径却是http://host/svn/project/android,理论阶段,没有实际验证。svn的服务器用的是apache

10.SVN科普

http://www.cnblogs.com/blsong/archive/2010/09/02/1816124.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值