Re: SVN MOVE don't perform a delete in some case

2010-04-16 Thread Stefan Sperling
On Fri, Apr 16, 2010 at 09:40:34AM +0200, Yann Crueghe wrote:
 Hi !

Hi!

 *Test 1 : Try to rename a directory BRANCHE to BRANCHE_1*
 
 *Command :*
 svn move --message Rename BRANCHE to BRANCHE_1 
 http://tetris.agora.msanet:16060/svn/METIER/y78amodifier/branches/BRANCHE 
 http://tetris.agora.msanet:16060/svn/METIER/y78amodifier/branches/BRANCHE_1
 
 *Hook params :*
 D y78amodifier/branches/BRANCHE/
 
 *Command result : * A repository hook failed
 svn: Commit blocked by pre-commit hook (exit code 1) with output:
 It's not allowed to rename or delete a branch.
 
 
 *Test 2 : Try to rename a directory BRANCHE to BRANCH*
 
 *Command :*
 svn move --message Rename BRANCHE to BR 
 http://tetris.agora.msanet:16060/svn/METIER/y78amodifier/branches/BRANCHE
 http://tetris.agora.msanet:16060/svn/METIER/y78amodifier/branches/BR
 
 *Hook params :*
 A y78amodifier/branches/BRANCH/
 
 *Command result : * Commit done without error.
 
 Do you think it's a bug ?

I don't know. On the surface this looks like a bug, but we need
to find out what the real problem is. For that, you'll need to
help others reproduce this problem on their own machines.

Can you try to show a list of commands that starts by creating
an empty repository, imports some files or folders, installs
the hook script, and then runs some svn commands to trigger the problem?

Thanks,
Stefan


RE: SVN MOVE don't perform a delete in some case

2010-04-16 Thread Giulio Troccoli



Linedata Services (UK) Ltd
Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB
Registered in England and Wales No 3027851VAT Reg No 778499447

-Original Message-


 From: Stefan Sperling [mailto:s...@elego.de]
 Sent: 16 April 2010 08:52
 To: Yann Crueghe
 Cc: users@subversion.apache.org
 Subject: Re: SVN MOVE don't perform a delete in some case

 On Fri, Apr 16, 2010 at 09:40:34AM +0200, Yann Crueghe wrote:
  Hi !

 Hi!

  *Test 1 : Try to rename a directory BRANCHE to BRANCHE_1*
 
  *Command :*
  svn move --message Rename BRANCHE to BRANCHE_1
 
 http://tetris.agora.msanet:16060/svn/METIER/y78amodifier/branches/BRAN
  CHE
 
 http://tetris.agora.msanet:16060/svn/METIER/y78amodifier/branches/BRAN
  CHE_1
 
  *Hook params :*
  D y78amodifier/branches/BRANCHE/
 
  *Command result : * A repository hook failed
  svn: Commit blocked by pre-commit hook (exit code 1) with output:
  It's not allowed to rename or delete a branch.
 
 
  *Test 2 : Try to rename a directory BRANCHE to BRANCH*
 
  *Command :*
  svn move --message Rename BRANCHE to BR
 
 http://tetris.agora.msanet:16060/svn/METIER/y78amodifier/branches/BRAN
  CHE
  http://tetris.agora.msanet:16060/svn/METIER/y78amodifier/branches/BR
 
  *Hook params :*
  A y78amodifier/branches/BRANCH/
 
  *Command result : * Commit done without error.
 
  Do you think it's a bug ?

 I don't know. On the surface this looks like a bug, but we
 need to find out what the real problem is. For that, you'll
 need to help others reproduce this problem on their own machines.

 Can you try to show a list of commands that starts by
 creating an empty repository, imports some files or folders,
 installs the hook script, and then runs some svn commands to
 trigger the problem?


I should see the whole pre-commit hook but I think you parse the list of files 
being committed and rely on some kind of order, e.g. the deletion being the 
first of the list.

I had a similar situation and I found out that (and this is documented) you can 
not rely on the order of the output of svnlook changed (or any other commands 
for that matter).

So, I think you will have to parse the whole list of files and if there is a 
delete then exit with an error.

Again, this is just hypothetical, as I don't know your pre-commit hook.

G


Re: SVN MOVE don't perform a delete in some case

2010-04-16 Thread Yann Crueghe

Hi !

Thank you very much for your quick replies !
In fact, the only thing that the hook control is that the user don't try 
to delete a directory (he can delete the content) in an other directory 
called branches


ie : myapp   /branches/my_branch/myfile.txt
/trunk/myfile.txt
/tags

The hook must block the user when he want to delete or rename 
/branches/my_branch

The user can alter the file /branches/my_branch/myfile.txt

The hook work when i try to delete the directory
The hook work when i try to rename the /branches/my_branch to 
/branches/my_branche
The hook work when i try to rename the /branches/my_branch to 
/branches/another_branch
The hook won't work when i try to rename the /branches/my_branch to 
/branches/my_bra (no svn delete perform)


Here is a partial copy of the hook (light from the original which 
control more things)


I prepare the svn commands to reproduce this comportment ASAP

Thank you very much

# sortie en erreur
function exit_error {
   echo $1 2
   exit 1
}

# sortie ok
function exit_success {
   exit 0
}


# parametres d'appels du hook
SVN_REPO_PATH=$1
SVN_TXN_ID=$2

# Binaires et fichiers de configuration du serveur SVN
SVNLOOK=/opt/CollabNet_Subversion/bin/svnlook

# Constantes
STR_BRANCHES=branches
STR_CODE_SVN_DELETE=D

# extraction de l'action et de la ressource cible
CHANGED=$($SVNLOOK changed -t $SVN_TXN_ID $SVN_REPO_PATH)
set -- $CHANGED
ACTION=$1
RESSOURCE=$2

# extraction du repertoire impacte par le commit
PATH_VARS=$(echo $RESSOURCE | tr '[:upper:]' '[:lower:]' | awk -F/ 
'{print $1,$2,$3,$4}')

set -- $PATH_VARS
APPLICATION=$1
REPERTOIRE=$2
ELEMENT=$3
CHEMIN=$4

# Securisation des branches
if [[ $REPERTOIRE = $STR_BRANCHES ]]
then   
   # Suppression sur une branche

   if [[ $ACTION = $STR_CODE_SVN_DELETE ]]
   then
   # Suppression de la branche ou du tag interdite aux dev. metier 
et responsables metier

   if [[ ! $CHEMIN ]]
   then exit_error La suppression d'une BRANCHE ou d'un TAG est 
interdite

   fi
   fi
fi

exit_success


Giulio Troccoli a écrit :



Linedata Services (UK) Ltd
Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB
Registered in England and Wales No 3027851VAT Reg No 778499447

-Original Message-


  

From: Stefan Sperling [mailto:s...@elego.de]
Sent: 16 April 2010 08:52
To: Yann Crueghe
Cc: users@subversion.apache.org
Subject: Re: SVN MOVE don't perform a delete in some case

On Fri, Apr 16, 2010 at 09:40:34AM +0200, Yann Crueghe wrote:


Hi !
  

Hi!



*Test 1 : Try to rename a directory BRANCHE to BRANCHE_1*

*Command :*
svn move --message Rename BRANCHE to BRANCHE_1

  

http://tetris.agora.msanet:16060/svn/METIER/y78amodifier/branches/BRAN


CHE

  

http://tetris.agora.msanet:16060/svn/METIER/y78amodifier/branches/BRAN


CHE_1

*Hook params :*
D y78amodifier/branches/BRANCHE/

*Command result : * A repository hook failed
svn: Commit blocked by pre-commit hook (exit code 1) with output:
It's not allowed to rename or delete a branch.


*Test 2 : Try to rename a directory BRANCHE to BRANCH*

*Command :*
svn move --message Rename BRANCHE to BR

  

http://tetris.agora.msanet:16060/svn/METIER/y78amodifier/branches/BRAN


CHE
http://tetris.agora.msanet:16060/svn/METIER/y78amodifier/branches/BR

*Hook params :*
A y78amodifier/branches/BRANCH/

*Command result : * Commit done without error.

Do you think it's a bug ?
  

I don't know. On the surface this looks like a bug, but we
need to find out what the real problem is. For that, you'll
need to help others reproduce this problem on their own machines.

Can you try to show a list of commands that starts by
creating an empty repository, imports some files or folders,
installs the hook script, and then runs some svn commands to
trigger the problem?




I should see the whole pre-commit hook but I think you parse the list of files 
being committed and rely on some kind of order, e.g. the deletion being the 
first of the list.

I had a similar situation and I found out that (and this is documented) you can 
not rely on the order of the output of svnlook changed (or any other commands 
for that matter).

So, I think you will have to parse the whole list of files and if there is a 
delete then exit with an error.

Again, this is just hypothetical, as I don't know your pre-commit hook.

G
  



Ce message est protégé par les règles relatives au secret des correspondances. 
Il est donc établi à destination exclusive de son destinataire. Celui-ci peut 
donc contenir des informations confidentielles. La divulgation de ces 
informations est à ce titre rigoureusement interdite. Si vous avez reçu ce 
message par erreur, merci de le renvoyer à l'expéditeur dont l'adresse e-mail 
figure ci-dessus et de détruire le message ainsi que toute pièce jointe.

This message is protected by the secrecy of correspondence rules. Therefore, 
this message is intended solely for the 

Re: Extra newline added to commit messages -- why?

2010-04-16 Thread Ori Avtalion

On 04/16/2010 01:56 AM, Ryan Schmidt wrote:


I think you should use log-police.py to make it a non-issue. This script 
ensures all log messages end with exactly one newline, regardless how many were 
there originally. You can set it up as a hook script to auto-correct new 
commits as they happen, and run it once over all existing commits to fix them 
up as well.



I understand you can hack around such things with server hooks (if you 
have access to the server), but shouldn't this inconsistency be 
considered a (minor) bug that should be fixed?


Regexp for parsing urls

2010-04-16 Thread Pablo Beltran
Hi,

Do you know a regexp to validate Subversion urls?

I've written one quite basic

/^(svn|file|http|https):\/\/\w+(:[0-9]+)?(\/\w*)*/

but it doesn't work for all cases.

Pablo.


Subversion Repository At Symlink

2010-04-16 Thread Jonas Zimmermann
Hi,

Haven't found info on this one:
I try to set up a subversion server with apache, with some repositories living 
on a separate drive linked to by a symlink.
However, I cannot get this setup to work.
FollowSymLinks is set for Directory /var/www/svn/, the svn parent path; the 
symlink belongs to apache and the repository has been cp -a'ed to preserve all 
owners/permissions. The logs say 

[Fri Apr 16 23:36:08 2010] [error] [client 78.86.217.64] (20014)Internal error: 
Can't open file '/var/www/svn/projects/format': Permission denied
[Fri Apr 16 23:36:08 2010] [error] [client 78.86.217.64] Could not fetch 
resource information.  [500, #0]
[Fri Apr 16 23:36:08 2010] [error] [client 78.86.217.64] Could not open the 
requested SVN filesystem  [500, #13]


If I log in as apache, I can cd to the directory and read format.

I've also tried to change the whole svn parent path to another location, to no 
avail.

Anyone an idea what the problem might be?

Thanks very much

Jonas