[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn (un)lock commands succeed when pre-(un)lock hooks fail on svn 1.9

From: Gustavo Chaves <gustavo_at_gnustavo.com>
Date: Sat, 22 Aug 2015 21:51:32 -0300

2015-08-22 21:22 GMT-03:00 <bert_at_qqmail.nl>:

> Can you confirm that the file is locked after the command? (E.g. by
> running svn status on the target)
>
> Does it lock the file when the hook blocks it… or does ‘svn lock’ return
> success?
>
No, it doesn't.

Look at these comnands, using svn 1.9, first without a hook:

$ svn info file.txt|grep Lock

$ svn lock file.txt
'file.txt' locked by user 'gustavo'.

$ svn info file.txt|grep Lock
Lock Token: opaquelocktoken:360cf86f-3c4b-4fa1-8657-18aea331e020
Lock Owner: gustavo
Lock Created: 2015-08-22 21:47:16 -0300 (Sat, 22 Aug 2015)

$ svn unlock file.txt
'file.txt' unlocked.

Now, with a failing hook:

$ mv ../repo/hooks/pre-lock- ../repo/hooks/pre-lock

$ svn lock file.txt
svn: warning: W165001: Lock blocked by pre-lock hook (exit code 255) with
no output.

$ echo $?
0

$ svn info file.txt|grep Lock

$

The "svn lock" command succeeded (exited with 0) but the file wasn't locked.

-- 
Gustavo.
Received on 2015-08-23 02:52:02 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.