[cvsnt] CVS Server Side Reporting Tools?

Bo Berglund bo.berglund at telia.com
Sun Nov 9 08:19:07 GMT 2008


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.


On Sun, 9 Nov 2008 05:56:13 +1100, "Arthur Barrett"
<arthur.barrett at march-hare.com> wrote:

>>> We had implemented such this tool some time ago, when we migrated 
>>> to 2.5.03.
>>> You can check this out at
>>> http://www.3ia.com.br/cms/index.php/download/37-cvsnt-hit
>> 
>> Interesting piece of code!
>> It could simply be made portable across database backends 
>>> (supported by the ADO system in Delphi) 
>
>Somehow I missed this when it was first posted.
>
>Ideally we'd like to see people using the CVSAPI for things like this, it's very powerful and is the same API as we use for writing to databases ourselves so therefore is furture compatible.
>
>Since audit was in 2.5.01 and since CVSNT audit in 2.5.03 does not support Oracle (2.5.04 does) I find the supplied program a little odd, but great to see people extending CVSNT.
>
>I know there has been some complaint before that the CVSAPI is difficult to call from Delphi, but if making it easier to call will result in more contributions then I think there is some work that could be done there.  The two ways forward would be either:#
>* a 'standard c' interface - same as the Win32 API uses
>* a COM intergace 
>
>Does anyone know if either of these would help?  Would someone like to volunteer to try and port the above Delphi code to use CVSAPI with assistance from me at using the API with CVSNT 2.5.05?
>

I don't know about the API part, but I have a fair deal of experience
programming Delphi and MSSQLServer...

The program supplied by the OP is intended to fill the Audit database
with what data are available inside the RCS files by directly parsing
them. This is obviously a bit "odd" in the sense that it uses a
backdoor to the CVSNT server files. Probably something best done
*once* with the server stopped.
Parsing files this way might run into some difficulties if diffs are
also stored into the database, because I don't think that binary diff
capability is built into the Delphi converter....
But I would not store diffs anyway in the database because of the size
of storage then required.

When you talk about using the API, do you mean that there are API
functions to extract the data via the server to be used with a tool
like this? How does it work?
A standard DLL type interface would be simplest to use or failing that
a TCP/IP connection with some calls there maybe.

I have not looked very detailed into the code except to find that it
uses portugese naming for identifiers, which makes sense for the OP
(coming from Brazil) but makes it harder to follow for Englis speaking
developers...
I also saw that a lot of database functionality is hidden in
properties of Delphi components dropped onto a form. I have changed
this for the queries to load from code instead so the queries are
visible more easily.
I have not converted any of the functionality to MSSQL yet because I
need first to understand what the Oracle syntax does (never used
Oracle). Queries below.

There is one item I don't know about this that needs to be figured out
and this is how to use the tool to get old info into the Audit
database in a repository that has started using Audit along the way so
some parts are already stored and some are not....
Clearly this must be handled so there are not afterwards double
entries for the same items.

I wonder how far one can come by using cvs log to extract the data via
the server? Might be a betterway than using RCS files directly.

Here are the queries I found in the component SQL properties:

qrSessionLog.SQL.Text:
'INSERT INTO SESSIONLOG (COMMAND,  "DATE", USERNAME, SESSIONID) VALUES
(:command, :date, :username, :sessionid)'

qrSessionIdSessao.SQL.Text:
'SELECT SEQ_ID_SESSIONLOG.CURRVAL AS ID FROM DUAL'

qrSessionId.SQL.Text:
'SELECT ID FROM SESSIONLOG WHERE SESSIONID=:sessionid'

qrTagLog.SQL.Text:
'INSERT INTO TAGLOG (SESSIONID, DIRECTORY,  FILENAME, TAG, REVISION,
ACTION, TYPE) VALUES (:sessionid, :directory, :filename, :tag,
:revision, :action, :type)'

qrHistoryLog.SQL.Text:
'INSERT INTO HISTORYLOG (SESSIONID, TYPE, REVS, NAME) VALUES
(:sessionid, :type, :revs, :name)'

qrCommitLog.SQL.Text:
'INSERT INTO COMMITLOG (SESSIONID, TYPE, DIRECTORY, FILENAME, MESSAGE,
OLDREV, NEWREV, TAG, BUGID, ADDED, REMOVED, DIFF) VALUES (:sessionid,
:type, :directory, :filename, :message, :oldrev, :newrev, :tag,
:bugid, :added, :removed, :diff)'

I am not familiar with the : notation, but I assume it is just a
placeholder for call argumants, same as @ would be used for MSSQL
procedures, right? Such as:
'INSERT INTO HISTORYLOG (SESSIONID, TYPE, REVS, NAME) VALUES
(@sessionid, @type, @revs, @name)'


HTH

/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