Erro on svn hook

44 views
Skip to first unread message

Tiago Herrmann

unread,
May 26, 2014, 3:27:07 PM5/26/14
to ag...@googlegroups.com

When i create the post-commit and pre-revpro hooks, occurr this error. How i can solve this?

I use this hooks:

@echo off
::
:: Trac-SVN post commit hook for explicit synchronisation
::

setlocal

set REPOS=%1
set REV=%2

C:\Python27\Scripts\trac-admin.exe C:\SVNTrac changeset added "%REPOS%" "%REV%"

@echo off
::
:: Trac-SVN post revprop change hook
::

setlocal

set REPOS=%1
set REV=%2

C:\Python27\Scripts\trac-admin.exe C:\SVNTrac


Claudio Di Cosmo

unread,
Jun 3, 2014, 4:07:48 AM6/3/14
to Tiago Herrmann, ag...@googlegroups.com
Hi Tiago,

On 27 May 2014 at 09:10:33, Tiago Herrmann (tiago.h...@gmail.com) wrote:

When i create the post-commit and pre-revpro hooks, occurr this error. How i can solve this?

--
Follow Agilo on Twitter: http://twitter.com/agilofortrac
Please support us by reviewing and voting on:
http://userstories.com/products/8-agilo-for-scrum
http://ohloh.net/p/agilo-trac
http://freshmeat.net/projects/agiloforscrum
 
You have received this message because you are subscribed to
the "Agilo for Trac" Google Group. This group is focused on
supporting Agilo for Trac users and is moderated by
Agilo Software GmbH <http://www.agilosoftware.com>.
 
To post to this group, send email to ag...@googlegroups.com
To unsubscribe from this group, send an email to
agilo+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/agilo

---
You received this message because you are subscribed to the Google Groups "Agilo for Trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to agilo+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Which version of Windows are you using? 
The problem can be related to Windows UAC since you are using path which should not be accessible so easily by programs.
One thing that you could try at the beginning is to disable it and try to run again the script. (http://windows.microsoft.com/en-us/windows/turn-user-account-control-on-off#1TC=windows-7)

If it is working than we can add this code so that you can elevate the privileges to admin:

:::::::::::::::::::::::::::::::::::::::::
:: Automatically check & get admin rights
:::::::::::::::::::::::::::::::::::::::::
@echo off
CLS  
ECHO.
ECHO =============================
ECHO Running Admin shell
ECHO =============================

:checkPrivileges  
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )  

:getPrivileges  
if '%1'=='ELEV' (shift & goto gotPrivileges)   
ECHO.  
ECHO **************************************
ECHO Invoking UAC for Privilege Escalation  
ECHO **************************************

setlocal DisableDelayedExpansion
set "batchPath=%~0"
setlocal EnableDelayedExpansion
ECHO Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs"  
ECHO UAC.ShellExecute "!batchPath!", "ELEV", "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs"  
"%temp%\OEgetPrivileges.vbs"  
exit /B  

:gotPrivileges  
::::::::::::::::::::::::::::
:START
::::::::::::::::::::::::::::
setlocal & pushd .
set REPOS=%1
set REV=%2

C:\Python27\Scripts\trac-admin.exe C:\SVNTrac changeset added "%REPOS%" "%REV%"

Let me know if it works.


Cheers,
Claudio Di Cosmo
Software Engineer
Agilo Software GmbH
Gruenberger Str. 54
10245 Berlin, Germany

claudio...@agilosoftware.com
http://www.agilosoftware.com

Follow us on twitter: http://twitter.com/agiloforscrumhttp://twitter.com/agilofortrac

Amtsgericht Charlottenburg: HRB 127146
CEO Marion Eickmann, Andrea Tomasini

Tiago Herrmann

unread,
Jun 5, 2014, 2:36:56 PM6/5/14
to ag...@googlegroups.com, tiago.h...@gmail.com
I'm using windows xp...
I had problemas with visualsvn and python bindings. Now the problems was solve.
I install a older version of visual svn and svn from alagazam.

Now i try use agilo_svn_hook_commit to create a comment in trac using REFS. 
When i use this hook occur some errors (this is one):

post-commit hook failed (exit code 1) with output:
Traceback (most recent call last):
  File "C:\Python27\Scripts\agilo_svn_hook_commit.py", line 4, in <module>
    import pkg_resources
  File "build\bdist.win32\egg\pkg_resources.py", line 2749, in <module>
  File "build\bdist.win32\egg\pkg_resources.py", line 444, in _build_master
  File "build\bdist.win32\egg\pkg_resources.py", line 725, in require
  File "build\bdist.win32\egg\pkg_resources.py", line 628, in resolve
pkg_resources.DistributionNotFound: trac>=0.12

Tiago Herrmann

unread,
Jun 6, 2014, 11:19:21 AM6/6/14
to ag...@googlegroups.com, tiago.h...@gmail.com
In pre commit ocurr this error

Commit failed (details follow):
Commit blocked by pre-commit hook (exit code 1) with output:
Traceback (most recent call last):
  File "C:\Python27\Scripts\agilo_svn_hook_commit.py", line 4, in <module>
    import pkg_resources
  File "build\bdist.win32\egg\pkg_resources.py", line 2749, in <module>
  File "build\bdist.win32\egg\pkg_resources.py", line 444, in _build_master
  File "build\bdist.win32\egg\pkg_resources.py", line 725, in require
  File "build\bdist.win32\egg\pkg_resources.py", line 628, in resolve
pkg_resources.DistributionNotFound: trac>=0.12
This error was generated by a custom hook script on the Subversion server.
Please contact your server administrator for help with resolving this issue.
Reply all
Reply to author
Forward
0 new messages