注册 登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

linux 学习

 
 
 

日志

 
 

SVN文件夹链接  

2011-05-10 11:33:35|  分类: SVN使用 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

Subversion provides a natural way to pull together resources from different parts of one or more subversion repository locations into a single working folder.  Once setup the commits are pushed into correct parent locations and updates are pulled from the initially configured urls.  This mechanism works equivalent to the symbolic links.  Here is an example.

Step 1:

Create a folder ./externals

Step 2:

Add the new folder into repository using command,

svn add ./externals

Step 3:

Create a file “externals.txt” with these two lines

tomcat/bin http://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/bin
apacheds/resources http://svn.apache.org/repos/asf/directory/apacheds/tags/1.5.7/resources

Step 4:

From command line run the following command.

svn propset svn:externals ./externals -F externals.txt

You are all set.  Any updates on externals folder (after committing the newly created folder) will fetch you the latest from tomcat/trunk and apacheds/tags/1.5.7/resources.  What the command has done is to set a property names ‘svn:externals’ into the folder metadata of folder ‘externals’ that tells svn client that some of its child folders are to be fetched/updated/committed through a different repository location.

  If you change any parts of the “externals” code, you will be able to check it in right into the correct code-base.  This solution avoids potential mess ups involving code base mash-ups.

One flipside of this solution is that while branching or tagging you will need to be extra careful in case your symbolic links also needs to shift.  To this effect it is worth noting that there are other useful commands for managing svn folder properties.  Check out the documentation here.


举例:
1:如果需要在  test 目录下,增加 comlibs 目录的链接文件,链接到 http://192.168.1.35/svn/media/software/comlibs/ 路径
则  externals.txt  文件内容如下所示:
  comlibs http://192.168.1.35/svn/media/software/comlibs/

2:再把 externals.txt   文件放到 test 目录的平级位置,如
      │   ├── 1
      │   │   ├── test
      │   │   │   ├── buffer.c
      │   │   │   ├── buffer.h
      │   │   │   └── Makefile
      │   │   ├── externals.txt

3:在 目录 1 下执行如下命令
     svn propset svn:externals dvs -F externals.txt

4:提交修改属性
     svn  ci -m "modify"

5:更新,下载 comlibs 目录
    svn  update

6:最后目录如下所示
      │   ├── 1
      │   │   ├── test
      │   │   │   ├── buffer.c
      │   │   │   ├── buffer.h
      │   │   │   └── Makefile
      │   │   │   └── comlibs
      │   │   ├── externals.txt
  评论这张
 
阅读(3158)| 评论(1)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018