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

Re: Previous transaction name in pre-commit script?

From: Hari Kodungallur <hkodungallur_at_gmail.com>
Date: 2007-11-21 03:48:03 CET

On Nov 20, 2007 2:54 AM, Sas Janusz <j.sas@teta.com.pl> wrote:

> Hi, I have such a problem
> Client: Windows XP SP2
> Server: Windows XP SP2
> Subversion: Client & Server version
> Client action:
> E:\T2K_WF\GL\serwer\Funkcje>svn add new_file.txt
> A new_file.txt
> E:\T2K_WF\GL\serwer\Funkcje>svn commit -m "adding new file"
> Dodawanie Funkcje\new_file.txt
> Przesyłanie treści pliku.
> Zatwierdzona wersja 85.
> E:\T2K_WF\GL\serwer\Funkcje>svn add new_file2.txt
> A new_file2.txt
> E:\T2K_WF\GL\serwer\Funkcje>svn commit -m "adding new file 2"
> Dodawanie Funkcje\new_file2.txt
> Przesyłanie treści pliku.
> Zatwierdzona wersja 86.
> Pre-commit.bat on the server side:
> SET TXN=%2
> FOR /F "tokens=1,2 delims= " %%i IN ('svnlook changed %REPOS%') DO (
> ECHO %%j %TXN%> E:\check-file.txt
> )
> EXIT 0
> Content of E:\check-file.txt after the above 2 commits:
> serwer/Funkcje/new_file.txt 85-1
> This test has proved, that the second parameter of the pre-commit hook
> script equals to previous transaction name (85-1) instead of
> current transaction name (should be "86-1", I guess). Every documentation,
> I have read, tells otherwise. I can't really believe, that it is a "general
> bug". I have tried to find in the web any descriptions of similar problems -
> with no results. Release notes of 1.4.5 version doesn't indicate any
> changes in this matter.
> I would appreciate any suggestions. Thanks in advance.

I don't think you are seeing anything wrong. From what I have seen that is
the way svn is designed. Those in the dev list may explain the design
better.. but here's how I look at it.

Revision 86 can not be created until the transaction is complete. When you
are working within the pre-commit hook, the transaction is still not
committed and so there is no revision 86 just yet. All the transactions that
are happening simultaneously after revision 85 and before revision 86 will
be marked 85-1, 85-2 and so on.

I hope I am making some sense here :)

-Hari Kodungallur
Received on Wed Nov 21 03:48:33 2007

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.