如何使用 svn 中的属性进行条件签出?
是否可以根据 svn 版本控制文件的属性从存储库中签出? 这将是一种特殊的稀疏结账方式。 例如,仅签出带有“svn:corelib”==“yes”的文件。
或者是签出整个存储库并稍后删除不需要的文件的唯一机会? 例如,使用一个脚本为每个文件提取带有“svn propget svn:corelib”的道具并检查数据?
(第三个选项当然只是将 corelib 文件和非 corelib 文件的存储库分开。)
Is there a possibility to checkout from a repo based on the properties of a svn-versioned file? That would be a special kind of sparse checkout. For example to checkout only files with "svn:corelib" == "yes".
Or is the only chance just to checkout the whole repo and to delete the unwanted files later? For example with a script that pulls for each file the props with "svn propget svn:corelib" and examines the data?
(Third option would be of course just to separate the repos of the corelib-files and noncorelib-files.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从阅读 http://svnbook.red-bean.com/ en/1.5/svn.advanced.props.html,Subversion 似乎无法做到这一点:-( 您可能必须手动搜索存储库中的所有文件才能获取带有以下内容的文件列表 。
如果您可以合理地将 corelib 和非 corelib 文件放在单独的存储库中,甚至将同一存储库中的单独目录树中,那么这几乎肯定是最好和最有效的解决方案
From reading http://svnbook.red-bean.com/en/1.5/svn.advanced.props.html, it doesn't seem like Subversion can do that :-( You'd probably have to search all files in the repository manually to get a list of the ones with the property set and just check those out.
If it's reasonable for you to put the corelib and non-corelib files in separate repositories, or even separate directory trees within the same repository, that is almost certainly the best and most efficient solution.
您可以查询文件的属性而无需检查它。 您可以在 shell 脚本中使用此功能,该脚本收集要检查的文件名称。
列出属性:
svn proplist http://repo/path/to/file
获取特定属性的值:
< code>svn propget svn:corelib http://repo/path/to/file
如果您在没有所请求属性的文件上使用
propget
,您将得到一个空的细绳。You can query the properties of a file w/o checking it out. You could use this feature in a shell script which collects the names of files to check out..
Listing properties:
svn proplist http://repo/path/to/file
Fetching value of specific property:
svn propget svn:corelib http://repo/path/to/file
If you
propget
on a file that doesn't have the requested property, you'll get an empty string.