查找带有svn:external属性并带有特定字符串的路径? [英] Find paths with svn:external properties with certain string?

查看:162
本文介绍了查找带有svn:external属性并带有特定字符串的路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常大的Subversion存储库,它的大小约为7 GB,并包含来自不同项目的许多文件和目录.

I've a very large subversion repository, it's about 7 GB in size and holds many many files and directories from different projects.

现在,我对一个项目结构进行了重大更改,该项目结构实际上是一个库,并且我正在同一存储库中的许多其他项目中使用它.现在文档稀疏,我不知道哪个项目实际将外部库真正用作该库,我想以某种方式查询Subversion服务器/存储库,以向我返回在svn:export属性中具有特定字符串的所有目录,因此我可以调整它们.

Now I did some major change to one project structure which is actually a library and I'm using it in quite a few other projects within the same repository. Now the documentations is sparse and I don't know which project actually really used this library as external and I'd like to somehow query the subversion server/repository to return me all directories which have a certain string in the svn:export property so I can adjust them.

理想情况下,如果不检查整个存储库,由于所有分支和标签,结果会出现问题.

Ideally without checking out the whole repository, would turn out problematic due all the branches and tags.

以一种聪明的方式有可能吗?

Is that possible somehow in a smart way?

thx

推荐答案

快速而肮脏的方法(如果只是进行一些更改)是将svn propget与--recursive标志一起使用以获取属性并进行更改手动(可能需要一段时间才能返回):

The quick and dirty way, if it's just a few changes, is to use svn propget with the --recursive flag to get the properties, and make the changes manually (this might take a while to return):

svn propget --recursive svn:externals http://your.svn.server/ | grep -B 5

要以更自动化的方式执行此操作,可以编写脚本:

To do this in a more automated fashion you can script it:

  • 为根中的每个路径递归地检索svn:externals

  • recursively retrieve svn:externals for every path in the root

检出目录,其外部包含要查找的字符串(可以通过文件系统分隔符分割路径组件,并使用depth = immediate检出每个组件,如果您想真正选择出检出的内容)

check out directories whose externals contain the string you're looking for (you can split the path component by filesystem separator and check out each component with depth=immediate if you want to be really selective about what you check out)

进行并提交更改

这样做的好处是,由于您的结帐有效地反映了您的存储库(即使丢失了很多东西),因此您可以在所有更改的顶层进行一次提交.

The advantage doing it this way is that because your checkout effectively mirrors your repository (even though it's missing loads of stuff) you can make a single commit at the top level with all the changes made.

HTH.

这篇关于查找带有svn:external属性并带有特定字符串的路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆