标题必须听起来很奇怪,但我试图达到以下目的:
SVN回购位置:/ home / flx / svn / flxdev SVN回购“flxdev”结构:
+ Project1 ++ files + Project2 + Project3 + Project4
我试图build立一个提交后的钩子,当我提交时自动检查另一端。
提交后的文档明确列出了以下内容:
# POST-COMMIT HOOK # # The post-commit hook is invoked after a commit. Subversion runs # this hook by invoking a program (script, executable, binary, etc.) # named 'post-commit' (for which this file is a template) with the # following ordered arguments: # # [1] REPOS-PATH (the path to this repository) # [2] REV (the number of the revision just committed)
所以我做了以下命令来testing:
REPOS="$1" REV="$2" echo "Updated project $REPOS to $REV"
但是,当我编辑Project1中的文件,例如,这会输出“更新的项目/家庭/ FLX / SVN / FLXDEV 1016”
我想这是: “更新项目Project1到1016”
有了这个variables,我可以指定为每个项目提交后执行不同的操作。 我怎样才能指定项目参数?
谢谢!
丹尼斯
使用svnlook 。
快速和肮脏将尝试像这样的东西:
REPOS="$1" REV="$2" CHANGED_DIRS="`/usr/bin/svnlook -r $REV dirs-changed $REPOS`" echo "Updated paths $CHANGED_DIRS in revision $REV"
你可能想尝试运行svnlook help ; 它会列出你可以使用的各种命令/你可以得到的信息。