You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by ma...@externe.bnpparibas.com on 2008/03/03 07:24:29 UTC

Réf. : Re: svnlook log doesn't return message

Hello,

sure you are right about the fact I was in some case testing the ouput, 
and sometimes testing return code.
My problem was that I doesn't understand that exec returns only the last 
line :)
My pre-commit.php works better now:
Thanks for your help
Best regards 

Matthieu




Internet 
subversion-2008a@ryandesign.com
29/02/2008 11:06

Pour
Matthieu MARY
cc
users@subversion.tigris.org
Objet
Re: svnlook log doesn't return message






On Feb 29, 2008, at 03:48, Ryan Schmidt wrote:

> And of course right after I sent my reply, I thought a bit more 
> about the problem and realized that because you're using the return 
> value from exec(), which is just the last line of output, you're 
> only checking the last line of the log message. If you have a nice 
> long log message but it ends with a blank line (for example if it 
> was composed in an editor like mine which always makes sure that 
> every saved file ends with a blank line), your script will think 
> you entered no log message, and will issue an error. You should be 
> checking the entire output of svnlook log, not just the last line.

And for the same reason, your php lint checker is only checking the 
last file in the list.

And for the same reason, your not-allowed-filename checker is only 
checking the last file in the list. Also, from the comments it sounds 
like you want to check only files that are being added, which makes 
sense. But your code only checks a file *unless* it's being added. To 
fix this, this line:

if (!preg_match_all("/[A]\s+([^\s]+)$/i", $cmd, $matches)) {

should be changed to

if (preg_match_all("/[A]\s+([^\s]+)$/i", $cmd, $matches)) {





This message and any attachments (the "message") is
intended solely for the addressees and is confidential. 
If you receive this message in error, please delete it and 
immediately notify the sender. Any use not in accord with 
its purpose, any dissemination or disclosure, either whole 
or partial, is prohibited except formal approval. The internet
can not guarantee the integrity of this message. 
BNP PARIBAS (and its subsidiaries) shall (will) not 
therefore be liable for the message if modified. 
Do not print this message unless it is necessary,
consider the environment.

                ---------------------------------------------

Ce message et toutes les pieces jointes (ci-apres le 
"message") sont etablis a l'intention exclusive de ses 
destinataires et sont confidentiels. Si vous recevez ce 
message par erreur, merci de le detruire et d'en avertir 
immediatement l'expediteur. Toute utilisation de ce 
message non conforme a sa destination, toute diffusion 
ou toute publication, totale ou partielle, est interdite, sauf 
autorisation expresse. L'internet ne permettant pas 
d'assurer l'integrite de ce message, BNP PARIBAS (et ses
filiales) decline(nt) toute responsabilite au titre de ce 
message, dans l'hypothese ou il aurait ete modifie.
N'imprimez ce message que si necessaire,
pensez a l'environnement.