提交后的 svn 导出在窗口上不起作用?
我正在Windows环境中设置SVN服务器: 每当创建标签时,提交后脚本都会导出一定数量的有关该标签的信息(例如作者、评论、依赖项...)。
我还想附加标记存储库中的特定文件。为此,我一直在尝试“svn导出”命令。这对于“模拟”标签来说工作得很好,但对于 svn 客户端(乌龟)来说不起作用。
svn export --username foo --password bar svn://localhost/My_SVN_DB/tags/My_Tag/My_File.txt My_Export_Directory
我检查了以下内容:
- 命令的语法 -->似乎没问题,它在调用提交后并传递测试参数时有效
- My_Export_Directory 的访问权限 -->似乎没问题,因为脚本还在那里写入了一个调试文件
现在我想知道在执行提交后脚本时标签结构是否已经存在? (我以为是..?)
有什么想法吗?
I am setting up a SVN server in a windows environment:
Whenever a tag is made, the post-commit script export a certain number of information about the tag (like author, comments, dependencies ...).
I also want to attach specific files from the tagged repository. To do so, I have been trying the "svn export" commands. This work fine for a "simulated" tag, but does not work using the svn client (tortoise).
svn export --username foo --password bar svn://localhost/My_SVN_DB/tags/My_Tag/My_File.txt My_Export_Directory
I checked the following:
- Syntax of the command --> Seems to be ok, it works when calling the post commit and passing test arguments
- Access rights for My_Export_Directory --> Seems to be ok as the script write also a debug file there
Now I am wondering if the tag structure is already present when executing the post commit script? (I thought it was..?)
Any ideas ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
重定向标准输出&标准错误帮助查找问题:
问题来自于导出之前的一条语句。使用 for /f 循环并覆盖临时循环变量 ( DBNAME ) 提取数据库名称。
<代码>::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::
:: 提取数据库名称
<代码>::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::
setLocal EnableDelayedExpansion
for /f "tokens=4 delims=\" %%a in ("%REPOS%") do (set DBNAME=%%a)
echo !DBNAME!>%TMPFILE%
endlocal
REM 这是问题
set /p DBNAME=<%TMPFILE%
通过将最后一个变量名修改为 DBNAME2:
set /p DBNAME2=<%TMPFILE%
脚本能够正常工作。
我仍然不清楚为什么会发生这种情况,因为预提交脚本中也使用了相同的技巧(用于 /f + 覆盖)并且它可以正常工作。有什么想法吗?
Redirecting the standard output & standard error help to find the problem:
The problem came from one statement before the export. The DB name was extracted using a for /f loop and overwriting an temporary loop variable ( DBNAME ).
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Extract the DB name
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
setLocal EnableDelayedExpansion
for /f "tokens=4 delims=\" %%a in ("%REPOS%") do (set DBNAME=%%a)
echo !DBNAME!>%TMPFILE%
endlocal
REM Here is the problem
set /p DBNAME=<%TMPFILE%
By modifying the last variable name into DBNAME2:
set /p DBNAME2=<%TMPFILE%
The script was able to work properly.
It is still very unclear to me why this happens since the very same trick (for /f + overwrite) is also used in pre-commit script and there it works properly. Any ideas??