subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gustavo Chaves <gust...@gnustavo.com>
Subject svn (un)lock commands succeed when pre-(un)lock hooks fail on svn 1.9
Date Sat, 22 Aug 2015 20:02:15 GMT
Hi there,

It seems that svn 1.9 changed the behaviour of the "svn lock" and the "svn
unlock" commands with regards to the fate of the corresponding
pre-lock/pre-unlock hooks.

Up to svn 1.8, when those hooks failed (exit code != 0) the commands (svn
lock/unlock) failed too.

Now, on svn 1.9, the commands always succeed.

To reproduce you can execute the atached script, which creates a temporary
directory, cd to it, creates a repository and a working copy, commits a
file and then tries to lock the file, before and after installing a hook
that always fail. With svn 1.8 in you path the results would be like this:

$ ./repro-lock.sh
The files will be left in the /tmp/tmp.xoidDWLkub directory
+ cd /tmp/tmp.xoidDWLkub
+ svnadmin create repo
+ svn --version
+ head -1
svn, version 1.8.10 (r1615264)
+ svn co file:///tmp/tmp.xoidDWLkub/repo wc
Checked out revision 0.
+ cd wc
+ touch file.txt
+ svn add file.txt
A         file.txt
+ svn ci -mx
Adding         file.txt
Transmitting file data .
Committed revision 1.
+ svn up
Updating '.':
At revision 1.
+ svn lock file.txt
'file.txt' locked by user 'gustavo'.
+ echo lock succeeded without a hook
lock succeeded without a hook
+ cat
+ chmod +x ../repo/hooks/pre-lock
+ svn lock file.txt
svn: E165001: Lock blocked by pre-lock hook (exit code 1) with no output.
+ echo lock failed with a failing hook
lock failed with a failing hook


Now, with svn 1.9 in your path the results are like this:

$ ./repro-lock.sh
The files will be left in the /tmp/tmp.qGx4oqIlNo directory
+ cd /tmp/tmp.qGx4oqIlNo
+ svnadmin create repo
+ svn --version
+ head -1
svn, version 1.9.0 (r1692801)
+ svn co file:///tmp/tmp.qGx4oqIlNo/repo wc
Checked out revision 0.
+ cd wc
+ touch file.txt
+ svn add file.txt
A         file.txt
+ svn ci -mx
Adding         file.txt
Transmitting file data .done
Committing transaction...
Committed revision 1.
+ svn up
Updating '.':
At revision 1.
+ svn lock file.txt
'file.txt' locked by user 'gustavo'.
+ echo lock succeeded without a hook
lock succeeded without a hook
+ cat
+ chmod +x ../repo/hooks/pre-lock
+ svn lock file.txt
svn: warning: W165001: Lock blocked by pre-lock hook (exit code 1) with no
output.
+ echo lock succeeded with a failing hook
lock succeeded with a failing hook


The problem was reported to me by the Debian maintainers of my SVN::Hooks
Perl module at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=795756.

-- 
Gustavo.

Mime
View raw message