1.6.10 post-commit client hook fails when only deleting folder

48 views
Skip to first unread message

Christophe R.

unread,
Oct 7, 2010, 3:34:14 PM10/7/10
to us...@tortoisesvn.tigris.org
Hi,

I am using tsvn 1.6.10 on windows XP SP3. When I commit a folder deletion, the commit works but I get a "the hook script returned an error".
I have updated my hook to a single line batch file:
exit 0
the error still occurs

A Google search brought up a similar issue for **file** deletion (an older issue, fixed in 1.5 I believe).
(see http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=1069314)

I have tried to delete an empty folder, as well as a folder with a file in it: it fails in both cases.

I have tried to just delete a file: that case works fine.

Is this a defect, or I am doing something incorrectly?

Thank you

Christophe

Stefan Küng

unread,
Oct 8, 2010, 10:02:58 AM10/8/10
to us...@tortoisesvn.tigris.org

Since the hook script runs on the server, you should ask for help on the
Subversion users list. TSVN is only a client.

Stefan

--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest Interface to (Sub)Version Control
/_/ \_\ http://tortoisesvn.net

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2669321

To unsubscribe from this discussion, e-mail: [users-un...@tortoisesvn.tigris.org].

chr...@comcast.net

unread,
Oct 8, 2010, 11:55:46 AM10/8/10
to us...@tortoisesvn.tigris.org

----- "Stefan Küng" <torto...@gmail.com> wrote:

Since the hook script runs on the server, you should ask for help on the
Subversion users list. TSVN is only a client.

I am talking about a client hook (setup from tortoiseSVN settings, hook scripts tab).

Christophe

Stefan Küng

unread,
Oct 8, 2010, 12:02:01 PM10/8/10
to us...@tortoisesvn.tigris.org

Works just fine for me here.
Do you start your bat script as
cmd.exe /c path/to/batfile
?
If not, try it this way. You can't really execute a bat file directly,
so you have to specify the cmd.exe here.

Stefan

--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest Interface to (Sub)Version Control
/_/ \_\ http://tortoisesvn.net

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2669349

chr...@comcast.net

unread,
Oct 8, 2010, 12:46:44 PM10/8/10
to us...@tortoisesvn.tigris.org

----- "Stefan Küng" <torto...@gmail.com> wrote:

Works just fine for me here.
Do you start your bat script as
cmd.exe /c path/to/batfile
?
If not, try it this way. You can't really execute a bat file directly,
so you have to specify the cmd.exe here.

Interesting...I tried using cmd.exe /c "myscript", and it made no difference when I deleting a folder (I saw the same error message in the commit dialog).

However...Since I ran out of folders to delete, I went ahead and  added a few folders and committed. This time, I got a different error in the commit dialog:
Error                : The hook script returned an error:
Error                : 'C:\Documents' is not recognized as an internal or external command,
Error                : operable program or batch file.

(Fair enough, I must have messed up the quotes or something on the hook setting, I will look into that)

But that tells me that when I comitted my delete only, the script did not even run (or I would have seen the same error, right?)

Christophe


Stefan Küng

unread,
Oct 8, 2010, 12:54:43 PM10/8/10
to us...@tortoisesvn.tigris.org

Not sure. To check whether the script really runs, you'd have to make
the script do something you can check, for example create a dummy test
file or show a dialog or something like that.

Stefan

--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest Interface to (Sub)Version Control
/_/ \_\ http://tortoisesvn.net

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2669359

chr...@comcast.net

unread,
Oct 8, 2010, 1:19:02 PM10/8/10
to us...@tortoisesvn.tigris.org

----- "Stefan Küng" <torto...@gmail.com> wrote:
Not sure. To check whether the script really runs, you'd have to make
the script do something you can check, for example create a dummy test
file or show a dialog or something like that.
Actually, I did: I gave up on using cmd /c, so i am back to simply calling my cmd file. This is what I have for it:

@ECHO OFF
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

ECHO hello > c:\foo.txt
EXIT 0      

now, when I add a folder and commit, all works fine, and c:\foo.txt shows hello.
After I commit my "folder add", I delete c:\foo.txt and I try again deleting a folder from subversion. I get this error when I commit:

Error                : The hook script returned an error:

and c:\foo.txt does not exit.

Christophe

Stefan Küng

unread,
Oct 9, 2010, 3:53:09 AM10/9/10
to us...@tortoisesvn.tigris.org

Did you put the path to the script in quotes?

Stefan

--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest Interface to (Sub)Version Control
/_/ \_\ http://tortoisesvn.net

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2669523

Christophe R.

unread,
Oct 11, 2010, 12:20:05 AM10/11/10
to us...@tortoisesvn.tigris.org
On 10/9/2010 12:53 AM, Stefan Küng wrote:
>
> Did you put the path to the script in quotes?
Yes I did. I have the full path to my cmd file, and it is in double quote.
I also just tried to remove the quotes, but I get the same error.

Again, those errors only occur when the only thing I commit is a folder
delete. If I tried to commit a file delete, my script works just fine.

I am not sure I want to start a new thread for that, but would it help
if the action log (logfile.txt, accessible from tsvn settings "saved
data") showed the name of any client hook that was run?

Christophe

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2669872

Christophe R.

unread,
Oct 14, 2010, 11:47:28 PM10/14/10
to us...@tortoisesvn.tigris.org
On 10/10/2010 9:20 PM, Christophe R. wrote:
> On 10/9/2010 12:53 AM, Stefan Küng wrote:
>> Did you put the path to the script in quotes?
> Yes I did. I have the full path to my cmd file, and it is in double quote.
> I also just tried to remove the quotes, but I get the same error.
>
> Again, those errors only occur when the only thing I commit is a folder
> delete. If I tried to commit a file delete, my script works just fine.
>
Hi Stefan,
is there any thing I can do to help with that issue? I can live with it
(as I know that the commit worked fine) but it is annoying and it may
lead people to simply ignore that error (would be a problem when the
script fails for a valid reason). Would it at least be entered as a
defect somewhere?

Thanks,
Christophe

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2672160

Leo Davidson

unread,
Oct 15, 2010, 4:27:46 AM10/15/10
to us...@tortoisesvn.tigris.org
On 15 October 2010 04:47, Christophe R. <christ...@comcast.net> wrote:

> Again, those errors only occur when the only thing I commit is a folder
> delete. If I tried to commit a file delete, my script works just fine.

Pure guess, but I wonder if the current dir is being set to the
deleted folder or something like that?

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2672251

Stefan Küng

unread,
Oct 15, 2010, 2:03:42 PM10/15/10
to us...@tortoisesvn.tigris.org
On 15.10.2010 05:47, Christophe R. wrote:
> On 10/10/2010 9:20 PM, Christophe R. wrote:
>> On 10/9/2010 12:53 AM, Stefan Küng wrote:
>>> Did you put the path to the script in quotes?
>> Yes I did. I have the full path to my cmd file, and it is in double quote.
>> I also just tried to remove the quotes, but I get the same error.
>>
>> Again, those errors only occur when the only thing I commit is a folder
>> delete. If I tried to commit a file delete, my script works just fine.
>>
> Hi Stefan,
> is there any thing I can do to help with that issue? I can live with it
> (as I know that the commit worked fine) but it is annoying and it may
> lead people to simply ignore that error (would be a problem when the
> script fails for a valid reason). Would it at least be entered as a
> defect somewhere?

Since I can't reproduce this, I can't really fix it.

Can you give an exact recipe on how to reproduce this? Because I tried
folder deletions and the script worked just fine for me.

Stefan

--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest Interface to (Sub)Version Control
/_/ \_\ http://tortoisesvn.net

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2672402

chr...@comcast.net

unread,
Oct 15, 2010, 5:35:25 PM10/15/10
to us...@tortoisesvn.tigris.org

----- "Stefan Küng" <torto...@gmail.com> wrote:

Can you give an exact recipe on how to reproduce this? Because I tried
folder deletions and the script worked just fine for me.

I created a cmd file to reproduce the issue. Here is what I have, with some instructions in the comments.
I basically create a repo, add 2 folders, commit with tsvn, delete a folder, then commit again with tsvn. The post commit hook is called twice (after commiting the add, then the delete - but only the first time is successful).
--------------------------------------------------
REM make sure you have a post-commit hook script setup to run on  c:\tsvntestWC
REM my hook script is called c:\hook1.cmd and has the following content: (without
REM the REM of couse...)
REM @ECHO OFF
REM SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
REM ECHO hello > c:\foo.txt
REM EXIT 0

REM now for the scenario...

REM create the repository
svnadmin create --fs-type fsfs c:\tsvntestRepo

REM checkout a WC
svn checkout file:///c:/tsvntestRepo c:\tsvntestWC

REM in the WC, create a folder and a subfolder
cd c:\tsvntestWC
md f1
md f1\f2

REM add and commit the folders
svn add f1
TortoiseProc.exe /command:commit /path:"c:\tsvntestWC" /logmsg:"adding f1 and f1\f2"

REM at this point, check the output of the hook script (in my case, I do
REM have "hello" in c:\foo.txt, so I know the script itself works.

REM delete f2
svn delete c:\tsvntestWC\f1\f2

REM (before this last commit, make sure that the output of the post-commit
REM hook has been deleted  - in my case, c:\foo.txt)
REM then we can commit
tsvn commit -m "deleted f2"

TortoiseProc.exe /command:commit /path:"c:\tsvntestWC" /logmsg:"deleted f2"

pause
-----------------------------------------------------
Thanks,
Christophe

Stefan Küng

unread,
Oct 18, 2010, 7:49:19 AM10/18/10
to us...@tortoisesvn.tigris.org
On 15.10.2010 23:35, chr...@comcast.net wrote:
>
> ----- "Stefan Küng" <torto...@gmail.com> wrote:
>
>
> Can you give an exact recipe on how to reproduce this? Because I tried
> folder deletions and the script worked just fine for me.
>
> I created a cmd file to reproduce the issue. Here is what I have, with
> some instructions in the comments.
> I basically create a repo, add 2 folders, commit with tsvn, delete a
> folder, then commit again with tsvn. The post commit hook is called
> twice (after commiting the add, then the delete - but only the first
> time is successful).

Thanks for the script. But I still can't reproduce the problem. The
script is called properly and exits with code 0 on my test setup.
I'm using the latest nightly build, but I can't see a big difference
between the hook script code on trunk and on 1.6.x.

Stefan

--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest Interface to (Sub)Version Control
/_/ \_\ http://tortoisesvn.net

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2673040

Christophe R.

unread,
Oct 22, 2010, 12:01:33 AM10/22/10
to us...@tortoisesvn.tigris.org
On 10/18/2010 4:49 AM, Stefan Küng wrote:
>
> Thanks for the script. But I still can't reproduce the problem. The
> script is called properly and exits with code 0 on my test setup.
> I'm using the latest nightly build, but I can't see a big difference
> between the hook script code on trunk and on 1.6.x.
>
> Stefan
>
Thank you Stefan. I probably won't have time to investigate any further
for a while, but I am hoping to at least try on different machines. Does
tsvn has a debug mode? Wwould I be able to get more information on what
is going on without having to run a debugger?

Thanks,
Christophe

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2674477

Stefan Küng

unread,
Oct 27, 2010, 2:48:11 PM10/27/10
to us...@tortoisesvn.tigris.org
On 22.10.2010 06:01, Christophe R. wrote:
> On 10/18/2010 4:49 AM, Stefan Küng wrote:
>>
>> Thanks for the script. But I still can't reproduce the problem. The
>> script is called properly and exits with code 0 on my test setup.
>> I'm using the latest nightly build, but I can't see a big difference
>> between the hook script code on trunk and on 1.6.x.
>>
>> Stefan
>>
> Thank you Stefan. I probably won't have time to investigate any further
> for a while, but I am hoping to at least try on different machines. Does
> tsvn has a debug mode? Wwould I be able to get more information on what
> is going on without having to run a debugger?

If you want to try a nightly build, I've committed a change which will
return the error from the OS in case there's a problem when running the
script itself.
(r20347)

Stefan

--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest Interface to (Sub)Version Control
/_/ \_\ http://tortoisesvn.net

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2676234

Reply all
Reply to author
Forward
0 new messages