Login | Register
My pages Projects Community openCollabNet

Discussions > users [DISABLED] > Re: strange reaction from post-commit hook

subversion
Discussion topic

There will be a brief maintenance window every Friday at 17:00 Pacific.
For further details, see CollabNet's maintenance and upgrade policy.

Back to topic list

Re: strange reaction from post-commit hook

Author ryandesign
Full name Ryan Schmidt
Date 2009-06-04 15:01:18 PDT
Message On Jun 4, 2009, at 01:08, J. Bakshi wrote:

>>> It repeated again and again even after " svn cleanup". I also
>>> tried " chmod -R 777 .svn" once more but the same error.
>>
>> Please confirm: even after running "svn cleanup", running "svn
>> update" tells you the working copy is locked? Is this only when
>> running "svn update" from the hook script or also when running "svn
>> update" from the command line?
>
> "svn up" from command line is working well
>
> ````````````````````​````````````````````​`````````
> [root@192 POSTCOMMIT]# vim newfile
> [root@192 POSTCOMMIT]# svn commit -m "check 24" newfile
> Sending newfile
> Transmitting file data .
> Committed revision 24.
>
> Warning: 'post-commit' hook failed with error output:
> svn: Working copy '/var/www/html/POSTCOMMIT' locked
> svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for
> details)
>
> [root@192 POSTCOMMIT]# svn cleanup
> [root@192 POSTCOMMIT]# svn up newfile
> At revision 24.

Wait. You are committing from within the POSTCOMMIT directory! So of
course the working copy will be locked -- a commit is currently in
progress in it.

You should not be committing from the POSTCOMMIT directory. That
working copy should only be manipulated by the post-commit hook, and
not by you.

Get a different working copy, somewhere else, and commit in it. Your
post-commit hook should be working fine.


>> Note also that hook scripts run in an empty environment. When you
>> manually execute the hook script, it inherits the environment (PATH,
>> etc.) from your shell and is thus not necessarily a good test. You
>> can get closer by running the hook script through the env command to
>> clear the environment:
>>
>> env -i ./post-commit /path/to/repo $REV
>
> Ok, I have done it
>
> ````````````````````````````
> env -i ./post-commit https://192.168.1.1:/repos/test
> svn post commit called
> At revision 24.
> ~~~~~~~~~~~~~~~~~

It's not really relevant here, since your post-commit hook doesn't
use any of the parameters given to it, but note that the first
parameter to the post-commit script is the path to the repository on
disk, not its URL; and the second parameter is the revision that was
just committed.

« Previous message in topic | 4 of 15 | Next message in topic »

Messages

Show all messages in topic

strange reaction from post-commit hook "J dot Bakshi" <joydeep at infoservices dot in> "J dot Bakshi" <joydeep at infoservices dot in> 2009-06-02 05:46:19 PDT
     Re: strange reaction from post-commit hook ryandesign Ryan Schmidt 2009-06-02 15:13:08 PDT
         Re: strange reaction from post-commit hook "J dot Bakshi" <joydeep at infoservices dot in> "J dot Bakshi" <joydeep at infoservices dot in> 2009-06-03 23:08:58 PDT
             Re: strange reaction from post-commit hook ryandesign Ryan Schmidt 2009-06-04 15:01:18 PDT
                 Re: strange reaction from post-commit hook "J dot Bakshi" <joydeep at infoservices dot in> "J dot Bakshi" <joydeep at infoservices dot in> 2009-06-04 22:21:52 PDT
                     Re: strange reaction from post-commit hook ryandesign Ryan Schmidt 2009-06-04 22:51:33 PDT
                         Re: strange reaction from post-commit hook "J dot Bakshi" <joydeep at infoservices dot in> "J dot Bakshi" <joydeep at infoservices dot in> 2009-06-04 23:37:12 PDT
     Re: strange reaction from post-commit hook ryandesign Ryan Schmidt 2009-06-05 02:47:26 PDT
         Re: strange reaction from post-commit hook "J dot Bakshi" <joydeep at infoservices dot in> "J dot Bakshi" <joydeep at infoservices dot in> 2009-06-05 03:37:45 PDT
             Re: strange reaction from post-commit hook "J dot Bakshi" <joydeep at infoservices dot in> "J dot Bakshi" <joydeep at infoservices dot in> 2009-06-05 05:43:43 PDT
                 Re: [ SOLVED ] strange reaction from post-commit hook "J dot Bakshi" <joydeep at infoservices dot in> "J dot Bakshi" <joydeep at infoservices dot in> 2009-06-05 05:50:47 PDT
                     Re: [ SOLVED ] strange reaction from post-commit hook ryandesign Ryan Schmidt 2009-06-05 13:18:19 PDT
                         Re: [ SOLVED ] strange reaction from post-commit hook "J dot Bakshi" <joydeep at infoservices dot in> "J dot Bakshi" <joydeep at infoservices dot in> 2009-06-07 21:35:58 PDT
                             Re: [ SOLVED ] strange reaction from post-commit hook ryandesign Ryan Schmidt 2009-06-07 21:43:53 PDT
                                 Re: [ SOLVED ] strange reaction from post-commit hook "J dot Bakshi" <joydeep at infoservices dot in> "J dot Bakshi" <joydeep at infoservices dot in> 2009-06-07 22:46:35 PDT
Messages per page: