颠覆;仅检查多个项目的主干

发布于 2024-09-18 16:29:32 字数 459 浏览 7 评论 0原文

我在 svn 中有一个这样的目录结构:

  • 项目 A
    • 分支机构
    • 标签
    • 树干
  • 项目 B
    • 分支机构
    • 标签
    • 树干

...

我只想签出所有这些项目的 trunk 目录。此类项目大约有 400 个,因此手动检查 trunk 不是一个选择。

我的第一个猜测是使用 svn list,但我的 shell 脚本编写技能达不到标准,我确定如何创建适当的目录并附加“trunk”并进行结帐。

有人愿意为我指出正确的方向吗?

TL:博士;

  • svn list 生成类似“project_a”的内容。
  • 我想将“project_a/trunk”签出到“project_a”。

I have a directory structure in svn like this:

  • Project A
    • branches
    • tags
    • trunk
  • Project B
    • branches
    • tags
    • trunk

...

I want to checkout only trunk directories for all these projects. There are about 400 of these kind of projects so checking out trunk manually won't be an option.

My first guess would be to use svn list, but my shell scripting skills are not up to par and I'm sure how to create the appropriate directories and append 'trunk' and do a checkout.

Anyone willing to point me in the right direction?

TL:DR;

  • svn list produces something like 'project_a'.
  • I want to checkout 'project_a/trunk' into 'project_a'.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

鸠魁 2024-09-25 16:29:32

您可以将项目列表存储到文件 (projects_list),然后运行以下脚本:

for p in $(cat projects_list); do
    mkdir $p
    svn co "$url/$p/trunk" $p
done

You can store the list of projects to a file (projects_list), then run this script:

for p in $(cat projects_list); do
    mkdir $p
    svn co "$url/$p/trunk" $p
done
躲猫猫 2024-09-25 16:29:32

这是使用深度标志的一种方法:

echo Getting Projects the folder structure
svn co http://www.therepo.com/projectsParentFolder --depth immediates

echo Getting the structure for each Project
for /f %%f in ('dir /b .\projectsParentFolder') do svn co http://www.therepo.com/projectsParentFolder/%%f .\projectsParentFolder\%%f --depth immediates

echo Getting the trunk for each Project
for /f %%f in ('dir /b .\projectsParentFolder') do svn co http://www.therepo.com/projectsParentFolder/%%f/trunk .\projectsParentFolder\%%f\trunk --depth infinity

Here is a way to do it by using the depth flag:

echo Getting Projects the folder structure
svn co http://www.therepo.com/projectsParentFolder --depth immediates

echo Getting the structure for each Project
for /f %%f in ('dir /b .\projectsParentFolder') do svn co http://www.therepo.com/projectsParentFolder/%%f .\projectsParentFolder\%%f --depth immediates

echo Getting the trunk for each Project
for /f %%f in ('dir /b .\projectsParentFolder') do svn co http://www.therepo.com/projectsParentFolder/%%f/trunk .\projectsParentFolder\%%f\trunk --depth infinity
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文