获取 SVN 中具有 svn:externals 到某个存储库的所有项目 [英] Get all projects in SVN that have svn:externals to a certain repository

查看:40
本文介绍了获取 SVN 中具有 svn:externals 到某个存储库的所有项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 SubVersion 中有许多项目有一个 svn:externals 引用一个核心项目(假设他们有一个 svn:externals 属性指向一个本地路径 /Componentshttp://svn/repos/core_components).

I have many projects in SubVersion that have an svn:externals reference to a Core project (let's say they have an svn:externals property pointing a local path /Components to http://svn/repos/core_components).

现在,我想获取所有具有对该 Core 项目的 svn:externals 引用的项目/文件夹的列表.是否有 SVN 命令/脚本/工具来执行该操作?(我在 Windows 上)

Now, I want to get a list of all the projects/folders that have an svn:externals reference to that Core project. Is there an SVN command/script/tool to perform that? (I am on Windows)

推荐答案

如果您的外部定义分散在整个存储库树中 - 您将遇到糟糕的一天 (tm):您必须递归遍历所有节点在您的每个存储库中,对于 Windows,这不是一项简单的任务.对于递归测试 repo-tree 添加 -R 选项到使用的命令

If your externals definitions are scattered throughout the repository-tree - you'll have a Bad Day (tm): you have togo recursively over all nodes in each you repository, for Windows it isn't an easiest task. For recursive testing repo-tree add -R option to used command

如果你在 repo 中有所有外部变量的共同位置(root/of trunk/是很好的候选者),你可以使用

If you have common place for all externals in repo (root /of trunk/ is good candidate), you can use

svn propget svn:externals(只检查一个属性)

svn proplist -v(获取所有带值的属性)

svn proplist -v (get all properties with values)

你会得到 grepable 输出(或者在 propget 和缺少外部的情况下没有)

you'll get grepable output (or none in case of propget and missing externals)

示例:

  • 具有外部路径的非递归属性

>svn propget svn:externals

https://subversion.assembla.com/svn/subversion-trouble-shooting/trunk/lib lib

  • 用于外部路径的非递归详细 proplist

>svn proplist -v

'.' 上的属性:

svn:externals

https://subversion.assembla.com/svn/subversion-trouble-shooting/trunk/lib lib

  • 具有外部路径的递归属性

>svn propget svn:externals -R

tags\1.0.1 - -r 2 https://subversion.assembla.com/svn/subversion-trouble-shooting/trunk/lib@2 lib

trunk - https://subversion.assembla.com/svn/subversion-trouble-shooting/trunk/lib lib

  • 无外部路径的非递归属性

>svn propget svn:externals

这篇关于获取 SVN 中具有 svn:externals 到某个存储库的所有项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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