简体   繁体   English

Subversion 中的提交后挂钩无法正常工作

[英]Post-commit-hook in Subversion doesn't work as I want

i came across a problem with subversion at my work.我在工作中遇到了颠覆问题。 I want to create a post-commit-hook (post-commit.bat file) command that creates information about the last transaction.我想创建一个 post-commit-hook(post-commit.bat 文件)命令来创建有关上次事务的信息。 The code looks like this:代码如下所示:

@echo off

set file="D:\mypath\logfile%2.txt"

svn log D:\'my path to repro'\ -r %2 -v > %file%

The %2 corresponds to the last revision number. %2 对应于最后的修订号。 It creates the file with the correct number and tries to write in it.它使用正确的编号创建文件并尝试写入其中。 But then the commit hangs and the file remains open.但是随后提交挂起并且文件保持打开状态。 The curious thing is, if I manually trigger the command with a valid revision number, then the whole thing works.奇怪的是,如果我用有效的修订号手动触发命令,那么整个过程就可以了。 Only with the hook it hangs and it also does not commit the files.只有它挂起的钩子,它也不提交文件。 Can anyone help me or have any ideas for my problem?任何人都可以帮助我或对我的问题有任何想法吗?

I found a solution, maybe this might be helpful for some person.我找到了解决方案,也许这对某些人有帮助。

I used the wrong command "log".我使用了错误的命令“log”。 Instead you have to use "svnlook changed..." on the server to get the latest information about the last commit.相反,您必须在服务器上使用“svnlook changed...”来获取有关上次提交的最新信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM