windows 如何在win7 64位中设置VisualSVN提交后钩子

wmomyfyw  于 2022-12-24  发布在  Windows
关注(0)|答案(1)|浏览(134)

我的post-commit钩子从来没有被触发过,我想这是因为
我需要设置一些文件系统权限。
我已经安装了VisualSVN-Server-2.5.2,并运行了带有Subversion插件的eclipse。
除VisualSVN钩子触发外,一切均按预期运行。
这是我的post-commit.cmd文件,文件名为“post-commit.cmd”

C:\PROGRA~2\VISUAL~1\bin\myScript.cmd 
exit 0
  • 更新1* 当我把“开始”文本像这样的提交窗口冻结与脉动进度绿色条,像它等待钩子触发或某事.我不能

取消提交操作,但我可以关闭eclipse,然后硬杀死提交窗口。

start C:\PROGRA~2\VISUAL~1\bin\post-commit.cmd
exit 0
  • 更新2*

它的工作,如果一个保存到本地硬盘存储库。这是当保存路径是网络驱动器,它不工作。好的,这是一个前进的一步。浴文件需要一些用户/密码可能
下面是将存储库保存到本地硬盘的bat文件(感谢Christopher C. Simmons(CCS))

@ECHO OFF
CLS
:: =================== COPYRIGHT ========================================= 
:: File:          svn_backup.bat
:: Author:        Christopher C. Simmons (CCS)
:: Date:          05.01.2008
:: Purpose:       To make backups ("hot copies") of multiple SVN repos
:: History:       0.1 Initial Release
:: Assumes:       Your path contains: C:\Program Files\Subversion\bin
::                Your repodir contains only repos
:: Copyright:     2008 csimmons.net
::                
:: NOTICE!!!
:: csimmons.net, LLC supplies this software AS IS and makes no guarantees
:: for your use of it. csimmons.net, LLC is not responsible for any damage
:: or pain the use of this product may cause you.  Please give credit if 
:: you use this or create a derivative work.
:: =================== COPYRIGHT =========================================

:: =================== CONFIG ============================================
:: Path of the dir containing your repos [Note Trailing slash]
SET repodir=F:\Repositories\
:: Path of the dir in which to create you hotcopies [Note Trailing slash]
SET repodirhot=f:\druidBACKUP\SVN\
:: Path for log file [Note Trailing slash]
SET logdir=f:\druidBACKUP\SVN\
:: Path for svnadmin [Note Trailing slash]
::SET svnpath=C:\PROGRA~2\VISUAL~1\bin\svnadmin.exe
:: User mode - 1=Interactive | 0=NonInteractive
SET imode=1
:: =================== CONFIG ============================================

:: =================== SCRIPT ============================================
:: !!! NO NEED TO EDIT BEYOND THIS POINT !!!

:: Make a date_time stamp like 030902_134200
SET hh=%time:~0,2%

:: Add a zero when this is run before 10 am.
IF "%time:~0,1%"==" " set hh=0%hh:~1,1%
SET yymmdd_hhmmss=%date:~12,2%%date:~4,2%%date:~7,2%_%hh%%time:~3,2%%time:~6,2%

:: Make a name for the log file
SET repolog=%logdir%%yymmdd_hhmmss%repobackup.log

:: Start log
ECHO START %date% %time% >> %repolog%

:: IF a  hotcopy exists delete it first ELSE
:: Create directories and svn hotcopy repos to them
FOR /F %%G IN ('dir /b /ad %repodir%') DO ^
IF EXIST %repodirhot%%%G (rmdir /S /Q %repodirhot%%%G & mkdir %repodirhot%%%G >> %repolog% & ^
ECHO Starting SVN backup for %%G... >> %repolog% & ^
C:\PROGRA~2\VISUAL~1\bin\svnadmin hotcopy %repodir%%%G %repodirhot%%%G --clean-logs >> %repolog% & ^
IF %imode%== 1 ECHO FINISHED...%%G) ^
ELSE (mkdir %repodirhot%%%G >> %repolog% & ^
ECHO Starting SVN backup for %%G... >> %repolog% & ^
C:\PROGRA~2\VISUAL~1\bin\svnadmin hotcopy %repodir%%%G %repodirhot%%%G --clean-logs >> %repolog% & ^
IF %imode%== 1 ECHO FINISHED...%%G)

:: Finish log
ECHO END %date% %time% >> %repolog%
:: Display log message if interactive mode otherwise EXIT
ECHO Done... Logs available here: %repolog% 
if %imode%== 1 pause
:: =================== SCRIPT ============================================
EXIT

我们的想法是启动一个更大的脚本myScript.cmd,该脚本正在执行
我的存储库。如果我手动启动post-commit.cmd,这将正常工作
在此阅读手册visualsvn.com
我不明白实际上该如何处理下面这段文字。
“Subversion执行钩子的用户身份与访问Subversion仓库的进程的用户身份相同.在大多数情况下,仓库是通过Subversion服务器访问的,所以这个用户就是运行Subversion服务器的用户.钩子本身需要配置操作系统级别的权限,以允许这个用户执行钩子.另外,这意味着任何被钩子直接或间接访问的程序或文件(包括Subversion仓库)都将以同一个用户的身份被访问.换句话说,要警惕潜在的权限相关问题,这些问题可能会阻止钩子执行其设计任务.

  • 更新 * x1c 0d1x
ie3xauqp

ie3xauqp1#

  • VisualSVN Server服务默认在Network Service帐户下运行,或在专用自定义帐户(应手动创建)下运行。
  • Subversion钩子在VisualSVN服务器服务下执行

帐户(Network Service或专用帐户)
如果手动启动钩子脚本时它工作正常,我建议您检查服务帐户的权限。它应该可以访问'C:\PROGRA~2\VISUAL~1\bin\myScript.cmd'和所有其他相关文件。
还请注意,Subversion在调用钩子脚本之前,会从环境中删除所有变量--包括Windows中的%PATH%.因此,只有在写出另一个程序的绝对名称后,脚本才能运行该程序.
Subversion常见问题解答:为什么我的存储库钩子不工作?

相关问题