按文件扩展名过滤的SVN签出? [英] SVN checkout filtered by file extension?

查看:19
本文介绍了按文件扩展名过滤的SVN签出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 DOS 批处理文件形式的自产自动构建脚本.在该脚本的一部分中,我检查(使用svn checkout")我们 SVN 存储库的一部分,其中包括我们项目中使用的一堆第三方内容.这个批处理文件在很长一段时间内都表现得很好,但现在人们已经将大量的内容(文档、示例代码等)签入了第三方区域,并且这个脚本的签出部分变得慢了很多.我想通过只检查我们需要的东西来缓解这个问题——在我们的例子中主要是 dll 文件.所以,我的问题是:检出按文件扩展名过滤的 SVN 存储库的最佳方法是什么?

I have a home-grown automated build script in the form of a DOS batch file. In part of that script, I check out (with "svn checkout") a section of our SVN repository that includes a bunch of third-party stuff that's used in our projects. This batch file performed pretty well for a long time, but now people have checked in lots of fluff (docs, sample code, etc.) into the third-party area and the checkout part of this script has gotten lots slower. I'd like to mitigate this by checking out only the stuff we need -- mostly dll files in our case. So, my question is this: what's the best way to check out an SVN repository filtered by file extension?

我在 svn 帮助中没有看到任何明显的方法来做到这一点.我有一个以某种方式包装 svn.exe 的 .NET 实用程序库,我正在考虑扩展它以仅检索与我感兴趣的扩展名匹配的内容.但如果存在,我更愿意使用更简单或现有的方法.

I didn't see any obvious way to do this in the svn help. I have a .NET utility library that wraps svn.exe in some ways, and I was thinking of extending this to retrieve only content that matched my extensions of interest. But I'd prefer to use an easier or existing method if one exists.

推荐答案

这是可能的:你可以svn checkout一个空目录,然后svn update filename为每个您确实想要的文件.

This is possible: you can svn checkout an empty directory, and then svn update filename for each file that you do want.

您的脚本可以执行以下操作:

Your script can do something like:

  1. svn checkout svn://path/to/repos/directory --depth 为空
  2. svn list --recursive svn://path/to/repos/directory
  3. 通过过滤器去除被禁止的文件扩展名的管道,例如grep
  4. 迭代这个新的过滤列表和svn update --parents每个文件

这将提供您想要的没有某些文件或文件扩展名的工作副本的结果.

That would give your desired result of a working copy without certain files or file extensions.

当然,还有你提到的人们 [checking] 有很多毛病"的问题,但那是另一回事.

Of course, there is also the issue that you mention of "people [checking] in lots of fluff" but that’s a separate matter.

这篇关于按文件扩展名过滤的SVN签出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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