-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 21.01.2011 13:45, Richard Hipp wrote: > On Thu, Jan 20, 2011 at 11:52 PM, Francisc Simon > <[email protected]>wrote: > > > Hi @all, > > i probably ask a question that was already asked before but i can not > figure out from the tickets/mailing-list cache if this was already > solved or not. > > Is there a way to hook into push/sync/commit commands ? > > >> There is a branch in the source tree that attempts to do this. See, for >> example > >> http://www.fossil-scm.org/fossil/timeline?r=StvPrivateHook2+ > >> And especially > >> http://www.fossil-scm.org/fossil/ci/ba5e03444b > >> But I did not accept that branch onto the trunk. I want to do the "hooks" >> via a different mechanism. But in order to implement this different >> mechanism, I need example C code for launching a background process in >> windows that is not associated with an console. Doing that is easy in Unix, >> but I'm not sure how to do it in windows. > >> This background process would be responsible for waiting until the push/pull >> finished and then running whatever hooks are required. > >
Ok, i found on the web the following solution: .... http://serverfault.com/questions/39451/there-is-any-way-to-run-processes-in-the-background-in-windows-nohup-equivalent .... The only way, in Windows, that you can have a process started by a user continue running after logoff (i.e. what "nohup" does) is to start it either through a "scheduled task" or as a Windows service. When the user logs off all processes in their logon session will be killed. If you're game to try the "Scheduled Tasks" method, you'll want to know how to create them programmatically. The *Win32_ScheduledJob* WMI class can do it. Documentation is provided in detail here: http://www.microsoft.com/technet/scriptcenter/guide/sas_man_rsxs.mspx?mfr=true Basically, you're looking at doing (shamelessly stolen from Microsoft): Set objService = GetObject("winmgmts:\\.") Set objNewJob = objService.Get("Win32_ScheduledJob") errJobCreated = objNewJob.Create("Program-to-execute.exe", "ugly-formatted-time-string-per-Microsoft-docs",True ,1 OR 4 OR 16, , ,JobID) If Err.Number = 0 Then Wscript.Echo "New Job ID: " & JobID Else Wscript.Echo "An error occurred: " & errJobCreated End If To grant "joe user" the ability to create scheduled tasks, you'll have to modify the permission on the %SystemRoot%\Tasks folder. See here for some info on that front: http://technet.microsoft.com/en-us/library/cc785125(WS.10).aspx .... i do not know if this will help you, i'm not a windows developer and i guess i will never be one :-) On the other hand is there a reason why you do not want to add first the unix hooks and after that if even possible the windows one ? The most of us even microsoft i guess use *NIX servers for production. > > > reason: i need a hook that i can run the unit tests for my projects i > use the check unit test framework and it has a nice feature it produces > XML based logfiles of the tests running. This files can be displayed so > i do not need to install a continous integration server :-) > It would be nice to have a hook because i'm not a very big fan of cron > jobs... :-) > > Thx for help! > > Regards > Frank > _______________________________________________ fossil-users mailing list [email protected] http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users >> > _______________________________________________ > fossil-users mailing list > [email protected] > http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users Thx for your time! Regards Frank -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREIAAYFAk05iRsACgkQPKy7P5mnYdnhKgD/bz86rbcEykzi0qlMV8Z1RUKM uh5AF2SH2KWe+HbpZosBAI5Dz8pGFzsDOjiRhJvxUNsmR/WI0bSCJk6nXLjdqVlt =/zPJ -----END PGP SIGNATURE----- _______________________________________________ fossil-users mailing list [email protected] http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

