Hi Kristis,
              Following is a code snippet with the changes that I made
towards attempting to write the output of that command to the log file. I am
not sure if this is the right way to go about it. I have cordoned off the
changes I made with hash lines.

sub prepare_activity_verify_or_commit
{
    my $self = shift;
    my ( $svn_repository, $svn_txn, $svn_tools_argument ) = ( @_ );
    my $line;
    my $old_version;

    #####################

    my $reader;

    #####################
    # Set the repository
    $self->activity()->repository( $svn_repository );
    # Find some information about this activity
    $logger->info( "Calling 'svnlook.exe info' to collect activity
information\n" );


#################################################################################################

    open ( SVNLOOK_INFO, "svnlook.exe info " . $svn_tools_argument . "
$svn_txn $svn_repository |" ) || log_fatal_error(
$GLUE_ERROR_CANNOT_EXECUTE_SVNLOOK_INFO, "Cannot execute 'svnlook.exe info':
$!\n"); ## I tried encompassing $svn_tools_argument inside double quotes,
but that didn't help either.

    while ($reader = <SVNLOOK_INFO> ) {

    logger->info( "$reader \n" );      ## I also tried this without double
quotations and no newline, got the same result as shown below.

       }

    close(SVNLOOK_INFO);
    $logger->info( "Some information\n" ); # Just some comment to identify
this point in the program.



#################################################################################################

    $logger->info( "Calling 'svnlook.exe info' to collect activity
information\n" );
    open ( SVNLOOK_INFO, "svnlook.exe info " . $svn_tools_argument . "
$svn_txn $svn_repository |" ) || log_fatal_error(
$GLUE_ERROR_CANNOT_EXECUTE_SVNLOOK_INFO, "Cannot execute 'svnlook.exe info':
$!\n");
    # Cygwin has a problem with newlines
    binmode( SVNLOOK_INFO, ":crlf" );
    # First line is the username
    $line = <SVNLOOK_INFO>;
    $line =~ s/\n$//g;
    $self->activity()->user( $line );
    # Second line is the date. Ignore it
    $line = <SVNLOOK_INFO>;
    # Third line is the log message size. Ignore it
    $line = <SVNLOOK_INFO>;
    $logger->info( "Reading the log message\n" );
    my $original_log_message = "";
    # Rest of the lines are the log message
    while ( $line = <SVNLOOK_INFO> ) {
 $original_log_message .= $line;
    }
    $self->activity()->original_log_message( $original_log_message );
    close ( SVNLOOK_INFO );
-----------------------------------------
The result in the logfile was:
-----------------------------------------

2009/02/26 04:33:08 Scmbug WARN> Glue.pm:109:Scmbug::Glue::Glue::process -
---------------------------------------------------------
2009/02/26 04:33:08 Scmbug INFO> Glue.pm:110:Scmbug::Glue::Glue::process -
Read configuration file 'C:\Repos\repo1/hooks/etc/scmbug/glue.conf'
2009/02/26 04:33:08 Scmbug INFO>
Glue.pm:206:Scmbug::Glue::Glue::check_configuration - Checking configuration
2009/02/26 04:33:11 Scmbug INFO>
Subversion.pm:100:Scmbug::Glue::Subversion::detect_version - Detected
Subversion version
2009/02/26 04:33:11 Scmbug WARN>
SCM.pm:307:Scmbug::Glue::SCM::prepare_activity - Preparing for VERIFICATION
2009/02/26 04:33:11 Scmbug INFO>
Subversion.pm:205:Scmbug::Glue::Subversion::prepare_activity_verify_or_commit
- Calling 'svnlook.exe info' to collect activity information
2009/02/26 04:33:14 Scmbug INFO>
Subversion.pm:223:Scmbug::Glue::Subversion::prepare_activity_verify_or_commit
- Some information
2009/02/26 04:33:14 Scmbug INFO>
Subversion.pm:225:Scmbug::Glue::Subversion::prepare_activity_verify_or_commit
- Calling 'svnlook.exe info' to collect activity information
2009/02/26 04:33:17 Scmbug INFO>
Subversion.pm:241:Scmbug::Glue::Subversion::prepare_activity_verify_or_commit
- Reading the log message
2009/02/26 04:33:17 Scmbug INFO>
Subversion.pm:262:Scmbug::Glue::Subversion::prepare_activity_verify_or_commit
- This is a commit activity, and we must find the new version number using
transaction number '4-t'
2009/02/26 04:33:17 Scmbug INFO>
Subversion.pm:263:Scmbug::Glue::Subversion::prepare_activity_verify_or_commit
- Calling 'svnlook.exe youngest' to find the current repository revision
2009/02/26 04:33:21 Scmbug INFO>
Subversion.pm:275:Scmbug::Glue::Subversion::prepare_activity_verify_or_commit
- Calling 'svnlook.exe changed' to find the list of affected files
2009/02/26 04:33:24 Scmbug DEBUG>
SCM.pm:339:Scmbug::Glue::SCM::prepare_final_log_message -
presence_of_bug_ids is 'required'.
2009/02/26 04:33:24 Scmbug INFO>
SCM.pm:347:Scmbug::Glue::SCM::prepare_final_log_message - Searching for
resolution bug ids
2009/02/26 04:33:24 Scmbug INFO>
SCM.pm:476:Scmbug::Glue::SCM::prepare_final_log_message - Searching for log
bug ids
2009/02/26 04:33:24 Scmbug DEBUG>
SCM.pm:511:Scmbug::Glue::SCM::prepare_final_log_message - The log message
with the resolution removed is ''
2009/02/26 04:33:24 Scmbug ERROR>
SCM.pm:528:Scmbug::Glue::SCM::prepare_final_log_message -
*******************************************
**
**
** Scmbug error 3: No list of bug ids was found that matches the
log_bugid_regex '^\s*bug\s*([\d|\s|,|#]*?):' and log_bugid_split_regex
',\s?#|\s?#|,|\s+' in the log message ''.
**
**
*******************************************
---------------------------------------------------------------------------------------------------------------------------------

Apparently, I have not done it the right way. Please let me what changes
need to be done.

Also, I ran the following command off the command line (to replicate what is
being run in the program) while the transaction was in progress:

svnlook info -t 4-t C:/Repos/Repo1

Output:
-----------
jaydeep
2009-02-26 04:33:07 -0800 (Thu, 26 Feb 2009)
26
bug 1:hsjhbfjbvhjdfkbvfgdb

I am guessing that for some odd reason, the line in the program

open ( SVNLOOK_INFO, "svnlook.exe info " . $svn_tools_argument . " $svn_txn
$svn_repository |" ) ...

is not giving the desired output. But I can only speculate.
Hope this info helps.

Regards,
Jaydeep.
On Wed, Feb 25, 2009 at 8:45 PM, Kristis Makris <[email protected]>wrote:

> Hi Jaydeep,
>
>
> On Wed, 2009-02-25 at 19:40 +0530, Jaydeep Ghurye wrote:
> >
> Subversion.pm:215:Scmbug::Glue::Subversion::prepare_activity_verify_or_commit
> - Reading the log message
>
> Could you output in the debugging file the log message read ?
>
>
> >         I tried running the command in this line manually, like this:
> >
> >         svnlook info -t 4-k C:/Repos/Repo1
> >
> >         and got the output:
> >
> >         svnlook: No such transaction
> >
> >         Apparently, the "-t" option is what causes the problem. I
> >         found
>
> No. The "-t" option works inside a Subversion transaction. Instead, you
> executed 'svnlook info' *after* the transaction finished (the commit
> finished) by manually issuing this command on the command-line. This is
> not the same.
>
> BUT, do you think you could add debugging statements there to output to
> the log file the output of the 'svnlook info' command (in
> Subversion.pm) ? I suspect that the output format of svnlook info might
> have changed.
>
>
>
>
_______________________________________________
scmbug-users mailing list
[email protected]
http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users

Reply via email to