RE: SVN lock at version 1.8.3 and 1.8.4 - not working

2013-11-27 Thread Kovar, Vaclav (EOM)
What output does your 'pre-lock' hook template produce?
My guess would be that it produces something...

Hello,
My repo hasnt any active hooks, just templates in  hooks dir.
So as first i tried to run almost empty pre-lock hook and strange is, the batch 
file is not executed. Next step was to verify other hooks. Commit hooks was 
started successfully, but lock hook not.

Details:
My (very simple) hook batch (for start-commit, pre-commit and post-commit are 
similar):

pre-lock.bat
code
echo off

echo begin pre-lock  C:\software\svnroot\repos\test001\hooks\tracefile.txt
echo SVN_REPOS %1  C:\software\svnroot\repos\test001\hooks\tracefile.txt
echo SVN_PATH %2  C:\software\svnroot\repos\test001\hooks\tracefile.txt
echo SVN_USER %3  C:\software\svnroot\repos\test001\hooks\tracefile.txt
echo end pre-lock  C:\software\svnroot\repos\test001\hooks\tracefile.txt
/code

And tracefile.txt:

begin start-commit 
REPOS C:\software\svnroot\repos\test001 
USER iras24 
end start-commit 
begin pre-commit 
REPOS C:\software\svnroot\repos\test001 
TXN 4-5 
end pre-commit 
begin post-commit 
REPOS C:\software\svnroot\repos\test001 
REV 5 
TXN_NAME 4-5 
end post-commit

Eq, no lock hook is executed.

Please, any recommendations?


RE: SVN lock at version 1.8.3 and 1.8.4 - not working

2013-11-27 Thread Bert Huijben


 -Original Message-
 From: Kovar, Vaclav (EOM) [mailto:vaclav.ko...@skoda-auto.cz]
 Sent: woensdag 27 november 2013 13:10
 To: users@subversion.apache.org
 Subject: RE: SVN lock at version 1.8.3 and 1.8.4 - not working
 
 What output does your 'pre-lock' hook template produce?
 My guess would be that it produces something...
 
 Hello,
 My repo hasnt any active hooks, just templates in  hooks dir.
 So as first i tried to run almost empty pre-lock hook and strange is, the
batch
 file is not executed. Next step was to verify other hooks. Commit hooks
was
 started successfully, but lock hook not.
 
 Details:
 My (very simple) hook batch (for start-commit, pre-commit and post-commit
 are similar):
 
 pre-lock.bat
 code
 echo off

If your script really has 'echo off' and not '@echo off' then your script
produces output. And you should check the documentation on how that is
handled for the specific hooks. For pre-lock this has side effects:
[[
# If the hook program outputs anything on stdout, the output string will
# be used as the lock token for this lock operation.  If you choose to use
# this feature, you must guarantee the tokens generated are unique across
# the repository each time.
]]

 
 echo begin pre-lock 
 C:\software\svnroot\repos\test001\hooks\tracefile.txt
 echo SVN_REPOS %1 
 C:\software\svnroot\repos\test001\hooks\tracefile.txt
 echo SVN_PATH %2 
 C:\software\svnroot\repos\test001\hooks\tracefile.txt
 echo SVN_USER %3 
 C:\software\svnroot\repos\test001\hooks\tracefile.txt
 echo end pre-lock  C:\software\svnroot\repos\test001\hooks\tracefile.txt
 /code
 
 And tracefile.txt:
 
 begin start-commit
 REPOS C:\software\svnroot\repos\test001
 USER iras24
 end start-commit
 begin pre-commit
 REPOS C:\software\svnroot\repos\test001
 TXN 4-5
 end pre-commit
 begin post-commit
 REPOS C:\software\svnroot\repos\test001
 REV 5
 TXN_NAME 4-5
 end post-commit
 
 Eq, no lock hook is executed.
 
 Please, any recommendations?

What operation did you perform to test the lock hook?

svn lock something?

The lock script is invoked as part of committing.

Bert



RE: SVN lock at version 1.8.3 and 1.8.4 - not working

2013-11-27 Thread Kovar, Vaclav (EOM)
If your script really has 'echo off' and not '@echo off' then your script 
produces output. And you should check the documentation on how that is handled 
for the specific hooks. For pre-lock this has side effects:
[[
# If the hook program outputs anything on stdout, the output string will # be 
used as the lock token for this lock operation.  If you choose to use # this 
feature, you must guarantee the tokens generated are unique across # the 
repository each time.
]]

Sorry, my mistake, you are correct.  I corrected it to  @echo off.

I tested  it 5 minutes ago, same result for either @echo off or echo off:

- during commit all 3 hooks are executed, commit is successfull
- during lock no hook is executed, lock failed



 What operation did you perform to test the lock hook?
 svn lock something?
 The lock script is invoked as part of committing.

Yes. I used testing SVN instance on my machine, so SVN bin is not on the PATH.

Copied/pasted:
code

C:\work\dzcvk82\svn_views\test6\test001dir

 Výpis adresáře C:\work\dzcvk82\svn_views\test6\test001

27.11.2013  15:05DIR  .
27.11.2013  15:05DIR  ..
27.11.2013  15:05   135 testfile.txt
   Souborů:  1,   Bajtů:135
   Adresářů: 2,   Volných bajtů:  6 574 776 320

C:\work\dzcvk82\svn_views\test6\test001c:\software\Subversion\bin\svn.exe lock 
testfile.txt
svn: E200035: sqlite[S19]: LOCK.lock_token may not be NULL
svn: E200035: Additional errors:
svn: E200035: sqlite[S19]: LOCK.lock_token may not be NULL

C:\work\dzcvk82\svn_views\test6\test001

/code

Perhaps the the lock fails before the hook execution.

Vena Kovar


RE: SVN lock at version 1.8.3 and 1.8.4 - not working

2013-11-15 Thread Bert Huijben


 -Original Message-
 From: Kovar, Vaclav (EOM) [mailto:vaclav.ko...@skoda-auto.cz]
 Sent: vrijdag 15 november 2013 16:42
 To: users@subversion.apache.org
 Subject: SVN lock at version 1.8.3 and 1.8.4 - not working
 
 We use Apache Subversion1.8.3 and i now tested new Apache Subversion
 1.8.4 and got same result. When i checked out repo and tried to  get lock
on
 file,  i got result bellow:
 
 C:\software\test\test6c:\software\Subversion\bin\svn.exe lock --
 username iras24 test001/testfile.txt
 svn: E200035: sqlite[S19]: LOCK.lock_token may not be NULL
 svn: E200035: Additional errors:
 svn: E200035: sqlite[S19]: LOCK.lock_token may not be NULL
 
 from error.log (apache had debug level set):
 
 [Fri Nov 15 16:05:16.421641 2013] [authz_core:debug] [pid 9844:tid 1032]
 mod_authz_core.c(799): [client 127.0.0.1:53766] AH01626: authorization
 result of RequireAny: denied (no authenticated user yet)
 [Fri Nov 15 16:05:16.421641 2013] [authz_core:debug] [pid 9844:tid 1032]
 mod_authz_core.c(799): [client 127.0.0.1:53766] AH01626: authorization
 result of Require valid-user : granted
 [Fri Nov 15 16:05:16.421641 2013] [authz_core:debug] [pid 9844:tid 1032]
 mod_authz_core.c(799): [client 127.0.0.1:53766] AH01626: authorization
 result of RequireAny: granted
 [Fri Nov 15 16:05:16.421641 2013] [dav:error] [pid 9844:tid 1032] [client
 127.0.0.1:53766] Tried to attach multiple locks to a resource.  [400,
#405]

What output does your 'pre-lock' hook template produce?

My guess would be that it produces something...

From the standard template you get on 'svnadmin create':
#!/bin/sh

# PRE-LOCK HOOK
#
# The pre-lock hook is invoked before an exclusive lock is
# created.  Subversion runs this hook by invoking a program 
# (script, executable, binary, etc.) named 'pre-lock' (for which
# this file is a template), with the following ordered arguments:
#
#   [1] REPOS-PATH   (the path to this repository)
#   [2] PATH (the path in the repository about to be locked)
#   [3] USER (the user creating the lock)
#   [4] COMMENT  (the comment of the lock)
#   [5] STEAL-LOCK   (1 if the user is trying to steal the lock, else 0)
#
# If the hook program outputs anything on stdout, the output string will
# be used as the lock token for this lock operation.  If you choose to use
# this feature, you must guarantee the tokens generated are unique across
# the repository each time.

Bert