SVN
svn稀疏目录--通过设置工作目录的深度(depth)实现目录树的部分签出
【Linux】
稀疏目录(Sparse Directories)功能,允许对目录设置深度(depth), 这个设置可以保存在工作目录上,以后svn update等命令都在这个设置下工作。
有以下几种depth可以选择:
- --depth empty: 只包含目录自身,不包含目录下的任何文件和子目录。
- --depth files: 包含目录和目录下的文件,不包含子目录。
- --depth immediates: 包含目录和目录下的文件及子目录。但不对子目录递归。
- --depth infinity: 这是默认的,包含整个目录树。
svn up有个参数--set-depth,可以修改保存在工作目录上的depth。
# svn co svn://10.10.20.234/sda10 my_checkout --depth immediates
# svn up --set-depth=exclude backup data doc src tool
# svn update --set-depth infinity scripts/
# svn update --set-depth=exclude gdosp
D gdosp
# svn up
At revision 3653.
【windows]
右键->TortoiseSVN->Update to revision
Update Depth设置depth,Choose Items选择生效的目录
修改SVN的IP
- 【windows】右键在工作复本的根目录上右键->TortoiseSVN->重新定位 (Relocate),然后修改URL就可以了,但最好先备份一下,据说这样的操作有一定的危险性(至今我没有发现)。
- 【Linux】 svn sw --relocate svn://192.168.5.234/code/cis7.5/server svn://10.10.9.234/code/cis7.5/server
svn co的代码时间戳和版本库上的时间戳保持一致
现在想在让svn co下来的代码的时间戳和版本库上提交代码的时间戳保持一致,这样的好处就是两个相同的文件比对的时间,如果时间戳一致,就直接忽略掉,只有时间戳不一致的才保留下来去比对
在一些对文件检测的configure;make中可能会报错
# make
CDPATH="${ZSH_VERSION+.}:" && cd /install/Mesa-10.3.5 && /bin/bash /install/Mesa-10.3.5/bin/missing aclocal-1.14 -I m4
/install/Mesa-10.3.5/bin/missing: line 81: aclocal-1.14: command not found
WARNING: 'aclocal-1.14' is missing on your system.
You should only need it if you modified 'acinclude.m4' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'aclocal' program is part of the GNU Automake package:
<http://www.gnu.org/software/automake>
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
<http://www.gnu.org/software/autoconf>
<http://www.gnu.org/software/m4/>
<http://www.perl.org/>
vim ~/.subversion/config中的use-commit-times = yes注释去掉
设置文件的权限
本地文件在commit到仓库之前若没有chmod +x 权限的话,那在svn仓库里的文件将会保持当前无可执行属性状态。
即使在本地chmod +x filename 之后,再提交到仓库也是没有用的。check out到其他目录的时候,文件仍然没有可执行权限。
需要使用svn 设置文件属性,如下
-
【linux】
-
svn propset svn:executable on file
-
svn commit -m "" file
-
-
【windows】
-
右键 - > propeties ->new ->executable.
-
commit上去即可
-
TortoiseSVN设置比较工具为BeyondCompare
右击【TortoiseSVN】【setting】【Diff Viewer】
- First 【External】"C:\Program Files\Beyond Compare 4\BCompare.exe" %base %mine /title1=%bname /title2=%yname /leftreadonly
查看用户名与密码
- Linux
cat .subversion/auth/svn.simple/b1485f2743b740952cb897e26e22fd85
创建tags
- 右击trunk目录,选择【Branch/tags】
- 在copy(Branch/Tag)对话框中,【To path】选择tags目录,然后补上版本号,如/tags/v2.2,【Log message】填写日志信息
将trunk上修复的bug合并到tag上
在tag目录上右击选择merge
svn移动目录并且保存历史日志
- 目标文件夹必须是版本控制的文件夹
- 用鼠标右键选中原目录,拖动到目标目录
- 释放鼠标的时候会弹出菜单,选中"SVN Move versioned item(s) here",然后commit即可保留历史数据
Access to '/svn/platforms/!svn/me' forbidden
【setting】->【Saved Data】清理所有缓存即可