是否可以使用 subversion 将单个文件提交到共享同一父目录的多个目录

发布于 2024-09-28 10:22:33 字数 111 浏览 0 评论 0原文

我想知道如何使用 subversion 工具一次性将文件/文件夹提交到多个文件夹。 我可以将文件放置在多个文件夹中,然后进行提交,但我只想将其放置在单个文件夹中,并且它应该在所需的文件夹中创建副本。是否可以?

I would like to know as how to commit a file/folder to multiple folders in one go using subversion tool.
I can place the file in multiple folders and then do commit, but i just want to place it is a single folder and it should create copies in the required folders. Is it possible?

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

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

发布评论

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

评论(3

隱形的亼 2024-10-05 10:22:33

不,Subversion 仅支持一个主存储库。但您可以从许多位置进行更新。提交一个地方,从其他地方(例如 Web 服务器目录)更新。如果您在那里进行更改,您也可以从那里提交。

No, subversion supports only one main repository. But you can update from many locations. Commit one place, update from other places like web server directory. If you make change there you can also commit from there.

一笔一画续写前缘 2024-10-05 10:22:33

Apache Ant 或 Maven 等工具将帮助您完成此任务。

编辑:也许在预提交挂钩中是这样的(在存储库/挂钩目录中创建文件“预提交”)(草稿版本):

#!/bin/bash

REPOS="$1"
TXN="$2"
SVNDIR=""
SVNLOOK="/usr/bin/svnlook"
NEWPATH="/path"

CHANGED=`$SVNLOOK changed -t "$TXN" "$REPOS" | $GREP "^[U|A]" | $AWK '{print $2}'`

for FILE in $CHANGED
do 
cp "$FILE" "$NEWPATH/$FILE" 
done

svn add -force "$SVNDIR" 

Something like Apache Ant or Maven will help you accomplish this task.

Edit: maybe something like this in a pre-commit hook (create a file 'pre-commit' in your repository/hooks dir)(draft version):

#!/bin/bash

REPOS="$1"
TXN="$2"
SVNDIR=""
SVNLOOK="/usr/bin/svnlook"
NEWPATH="/path"

CHANGED=`$SVNLOOK changed -t "$TXN" "$REPOS" | $GREP "^[U|A]" | $AWK '{print $2}'`

for FILE in $CHANGED
do 
cp "$FILE" "$NEWPATH/$FILE" 
done

svn add -force "$SVNDIR" 
丶情人眼里出诗心の 2024-10-05 10:22:33

如果您尝试重用中心文件,可以使用 svn:externals 属性。将文件提交到存储库树中的某个中心位置,然后为该文件创建 svn:externals 属性(或者最好是其父目录)。这样你就可以从任何地方提交它(还有 svn:externals 拉入它的位置),并重用它。

If you're trying to reuse a central file, you can use the svn:externals property. Commit the file to some central place in your repository tree, and then create an svn:externals property to the file (or maybe better its parent directory). That way you can commit it from everywhere (also the locations where its being pulled in by svn:externals), and reuse it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文