[cvsnt] Re: Help with Audit

Clovis Garcia clovis at phoebus.com.br
Wed Feb 15 21:55:46 GMT 2006


Community technical support mailing list was retired 2010 and replaced with a professional technical support team. For assistance please contact: Pre-sales Technical support via email to sales@march-hare.com.


Bo,


g_pDb->Bind(0,message?message:"");
g_pDb->Bind(1,diff);
if(g_AuditLogSessions)
	g_pDb->Execute("Insert Into %sCommitLog (SessionId, Directory, Message, 
Type, Filename, Tag, BugId, OldRev, NewRev, Added, Removed, Diff) Values 
(%lu, '%s', ? ,'%c','%s','%s','%s','%s','%s',%lu, %lu, ? 
)",g_szPrefix,g_nSessionId,directory,change_list[n].type,change_list[n].filename,NULLSTR(change_list[n].tag),NULLSTR(change_list[n].bugid),NULLSTR(change_list[n].rev_old),NULLSTR(change_list[n].rev_new),added,removed);
else
	g_pDb->Execute("Insert Into %sCommitLog (Directory, Message, Type, 
Filename, Tag, BugId, OldRev, NewRev, Added, Removed, Diff) Values (%lu, 
? ,'%s','%c','%s','%s','%s','%s','%s',%lu, %lu, ? 
)",g_szPrefix,directory,change_list[n].type,change_list[n].filename,NULLSTR(change_list[n].tag),NULLSTR(change_list[n].bugid),NULLSTR(change_list[n].rev_old),NULLSTR(change_list[n].rev_new),added,removed);


Take a look at the 2 top lines, the message and diff goes there. They 
are probably put back into the command in the place of '?'.

About the conversion code I think there is a conversion from UTF8 to 
UCS2 but it seems to me that the string is still an ANSI string so the 
conversion could be wrong.

Clovis


On 15/2/2006 18:35, Bo Berglund wrote:
> On Wed, 15 Feb 2006 17:41:44 -0300, Clovis Garcia
> <clovis at phoebus.com.br> wrote:
> 
>> I´m using the CVSNT_2_5_03_2151 version so try this:
>>
>> triggers/audit_trigger.cpp, 253
> This is where I looked before and failed to understand it...
> 
> g_pDb->Execute("Insert Into %sCommitLog (SessionId, Directory,
> Message, Type, Filename, Tag, BugId, OldRev, NewRev, Added, Removed,
> Diff) Values (%lu, '%s', ? ,'%c','%s','%s','%s','%s','%s',%lu, %lu, ?
> )",g_szPrefix,g_nSessionId,NULLSTR(directory),change_list[n].type,
> NULLSTR(change_list[n].filename),NULLSTR(change_list[n].tag),
> NULLSTR(change_list[n].bugid),NULLSTR(change_list[n].rev_old),
> NULLSTR(change_list[n].rev_new),added,removed);
> 
> Seems to me that the Message item is missing from the argument list
> (should be betweeen directory and type). I really do not understand
> this strange syntax...
> 
>> cvsapi/mssql/mssqlConnection.cpp, 202
>> cvsapi/mssql/mssqlRecordSet.cpp, 188
>> cvsapi/cvs_string.h, 172
> 
> Looked here too but I an't get a grip on C++ syntax, it looks way too
> complex for me. :-(
> (I am doing ObjectPascal on a daily basis and that is rather much
> clearer).
> 
> 
> /Bo
> (Bo Berglund, developer in Sweden)



More information about the cvsnt mailing list
Download the latest CVSNT, TortosieCVS, WinCVS etc. for Windows 8 etc.
@CVSNT on Twitter   CVSNT on Facebook