User: sits    
  Date: 06/06/20 21:58:49

  Modified:    .        codestriker.conf
               doc      codestriker.sgml
               lib/Codestriker/FileParser CvsUnidiff.pm
               lib/Codestriker/Model Topic.pm
               lib/Codestriker/Repository ClearCaseDynamic.pm
               template/en/default viewtopicproperties.html.tmpl
  Log:
  * Handle CVS diff files which contain deltas containing extra blank
    lines.
  
  * Better error logging support for ClearCaseDynamic module.
  
  * HistoryRecorder was failing for topics which contained non-ASCII
    characters in the title.  This has now been fixed.
  
  
  
  Index: codestriker.conf
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/codestriker.conf,v
  retrieving revision 1.83
  retrieving revision 1.84
  diff -u -r1.83 -r1.84
  --- codestriker.conf  11 Jun 2006 06:34:29 -0000      1.83
  +++ codestriker.conf  21 Jun 2006 04:58:48 -0000      1.84
  @@ -164,11 +164,11 @@
        # Same as previous example, but with no password specified.
        'perforce:[EMAIL PROTECTED]:1666',
   
  -     # The final example is a ClearCase repository, where the path is
  +     # The next example is a ClearCase repository, where the path is
        # the location of a shared snapshot view.  From this view, it
        # should be  possible to a file of any version can be 
        # retrieved from the vob using the "cleartool get" command.  It
  -     # is important that this snapshot view is accessible with  the
  +     # is important that this snapshot view is accessible with the
        # same path specification for all developers.  This is because
        # a diff file created by a developer will refer to the snapshot
        # view, and will allow Codestriker to retrieve specific files
  @@ -176,7 +176,10 @@
        # It is also important that the user account running the
        # webserver process has permission to access to the snapshot
        # view.
  -     'clearcase:c:\\stuff\\view_name\\vob_name'
  +     'clearcase:c:\\stuff\\view_name\\vob_name',
  +
  +     # The next example is a repository based off a ClearCase dynamic view.
  +     'clearcase:dyn:c:\\stuff\\dynamic_view_name\\vob_name'
       );
   
   # A mapping of repository URLs to names.  In any screen where a
  
  
  
  
  
  Index: codestriker.sgml
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/doc/codestriker.sgml,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- codestriker.sgml  12 Jun 2006 23:04:36 -0000      1.57
  +++ codestriker.sgml  21 Jun 2006 04:58:49 -0000      1.58
  @@ -529,11 +529,11 @@
        # the Perforce server.
        'perforce:sits:[EMAIL PROTECTED]:1666',
   
  -     # The final example is a ClearCase repository, where the path is
  +     # The next example is a ClearCase repository, where the path is
        # the location of a shared snapshot view.  From this view, it
        # should be  possible to a file of any version can be 
        # retrieved from the vob using the "cleartool get" command.  It
  -     # is important that this snapshot view is accessible with  the
  +     # is important that this snapshot view is accessible with the
        # same path specification for all developers.  This is because
        # a diff file created by a developer will refer to the snapshot
        # view, and will allow Codestriker to retrieve specific files
  @@ -541,7 +541,10 @@
        # It is also important that the user account running the
        # webserver process has permission to access to the snapshot
        # view.
  -     'clearcase:c:\\stuff\\view_name\\vob_name'
  +     'clearcase:c:\\stuff\\view_name\\vob_name',
  +
  +     # The next example is a repository based off a ClearCase dynamic view.
  +     'clearcase:dyn:c:\\stuff\\dynamic_view_name\\vob_name'
       );
           </programlisting>
           </para>
  
  
  
  
  
  Index: CvsUnidiff.pm
  ===================================================================
  RCS file: 
/cvsroot/codestriker/codestriker/lib/Codestriker/FileParser/CvsUnidiff.pm,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- CvsUnidiff.pm     7 Jun 2006 00:00:57 -0000       1.13
  +++ CvsUnidiff.pm     21 Jun 2006 04:58:49 -0000      1.14
  @@ -112,12 +112,14 @@
        $line = <$fh>;
        return () unless defined $line;
   
  -
        # If the diff is empty (since we may have used the -b flag), continue
        # processing the next diff header back around this loop.  Note this is
        # only an issue with cvs diffs.  Ordinary diffs just don't include
        # a diff section if it is blank.
  -     next if ($line =~ /^Index:/o);
  +     while (defined $line && $line =~ /^\s*$/o) {
  +         $line = <$fh>;
  +     }
  +     next if (! defined $line) || ($line =~ /^Index:/o);
   
        # Check for binary files being added, changed or removed.
        if ($line =~ /^Binary files \/dev\/null and (.*) differ$/o) {
  
  
  
  
  
  Index: Topic.pm
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Model/Topic.pm,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- Topic.pm  26 May 2006 05:42:49 -0000      1.45
  +++ Topic.pm  21 Jun 2006 04:58:49 -0000      1.46
  @@ -635,11 +635,11 @@
       }
   
       # Update the topic object's properties.
  -    $self->{title} = decode_utf8($new_title);
  +    $self->{title} = $new_title;
       $self->{author} = $new_author;
       $self->{repository} = $new_repository;
       $self->{project_id} = $new_projectid;
  -    $self->{description} = decode_utf8($new_description);
  +    $self->{description} = $new_description;
       $self->{modified_ts} = $modified_ts;
       $self->{topic_state} = $new_state;
       $self->{topic_state_id} = $new_stateid;
  
  
  
  
  
  Index: ClearCaseDynamic.pm
  ===================================================================
  RCS file: 
/cvsroot/codestriker/codestriker/lib/Codestriker/Repository/ClearCaseDynamic.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ClearCaseDynamic.pm       15 Jun 2006 06:46:18 -0000      1.1
  +++ ClearCaseDynamic.pm       21 Jun 2006 04:58:49 -0000      1.2
  @@ -18,10 +18,10 @@
   eval("use ClearCase::CtCmd");
   
   # Constructor.
  -#   - viewname:vobs_dir - absolute path to the vobs dir (mount point on 
unix/drive letter on windows)
  -#                This dynamic view should be mounted on the same host on 
which CodeStriker is
  -#                running
  -#     
  +# viewname:vobs_dir - absolute path to the vobs dir
  +#                     (mount point on unix/drive letter on windows)
  +# This dynamic view should be mounted on the same host on which Codestriker
  +# is running.
   sub new ($$)
   {
       my ($type, $url) = @_;
  @@ -41,44 +41,56 @@
   sub retrieve ($$$\$)
   {
       my ($self, $filename, $revision, $content_array_ref) = @_;
  -    my $full_element_name = File::Spec->catfile($self->{vobs_dir}, 
$filename);
   
  -    if (defined($revision) && length($revision) > 0) {
  -        $full_element_name = $full_element_name . '@@' . $revision;
  +    # Set the current view to the repository's dynamic view name.
  +    my $clearcase = ClearCase::CtCmd->new();
  +    (my $status, my $stdout, my $error_msg) =
  +     $clearcase->exec('setview', $self->{dynamic_view_name});
  +
  +    # Check the result of the setview command.
  +    if ($status) {
  +     $error_msg = "Failed to open view: " . $self->{dynamic_view_name} .
  +         ": $error_msg\n";
  +     print STDERR "$error_msg\n";
  +     return $error_msg;
       }
   
  -    my $error_msg;
  -    my $clearcase = ClearCase::CtCmd->new();
  -    if ($clearcase->exec('setview', $self->{dynamic_view_name})) {
  +    # Execute the remaining code in an eval block to ensure the endview
  +    # command is always called.
  +    eval {
  +     # Construct the filename in the view, based on its path and
  +     # revision.
  +     my $full_element_name = File::Spec->catfile($self->{vobs_dir},
  +                                                 $filename);
  +     if (defined($revision) && length($revision) > 0) {
  +         $full_element_name = $full_element_name . '@@' . $revision;
  +     }
   
  -     # If setview works, put the remaining code in an eval block
  -     # to ensure the endview command is called.
  -     eval {
  -         # Load the file into the given array.
  -         open CONTENTFILE, "$full_element_name"
  -             || die "Couldn't open file: $full_element_name: $!";
  -         for (my $i = 1; <CONTENTFILE>; $i++) {
  -             chop;
  -             $$content_array_ref[$i] = $_;
  -         }
  -         close CONTENTFILE;
  -     };
  -     if ($@) {
  -         $error_msg = $@;
  +     # Load the file directly into the given array.
  +     open CONTENTFILE, "$full_element_name"
  +         || die "Couldn't open file: $full_element_name: $!";
  +     for (my $i = 1; <CONTENTFILE>; $i++) {
  +         chop;
  +         $$content_array_ref[$i] = $_;
        }
  +     close CONTENTFILE;
  +    };
  +    if ($@) {
  +     # Something went wrong in the above code, record the error message
  +     # and continue to ensure the view is closed.
  +     $error_msg = $@;
  +     print STDERR "$error_msg\n";
  +    }
   
  -     # Close the view.
  +    # Close the view.
  +    ($status, $stdout, $error_msg) =
        $clearcase->exec('endview', $self->{dynamic_view_name});
  -    } else {
  -     $error_msg = "Failed to open view: " . $self->{dynamic_view_name} . 
"\n";
  +    if ($status) {
  +     $error_msg = "Failed to close view: " . $self->{dynamic_view_name} .
  +         ": $error_msg\n";
  +     print STDERR "$error_msg\n";
       }
       
  -
  -    if (defined($error_msg)) {
  -       print STDERR "Error: $error_msg\n";
  -    }
  -
  -    # If there was no error, this will be undefined.
       return $error_msg;
   }
   
  
  
  
  
  
  Index: viewtopicproperties.html.tmpl
  ===================================================================
  RCS file: 
/cvsroot/codestriker/codestriker/template/en/default/viewtopicproperties.html.tmpl,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- viewtopicproperties.html.tmpl     15 Jun 2006 07:12:38 -0000      1.21
  +++ viewtopicproperties.html.tmpl     21 Jun 2006 04:58:49 -0000      1.22
  @@ -33,7 +33,7 @@
   </script>
   
   [%# Create a form to allow the topic's properties to be changed #%]
  -<form method="post" enctype="application/x-www-form-urlencoded" name="form">
  +<form method="post" name="form" enctype="multipart/form-data" 
accept-charset="UTF-8">
   
   <input type="hidden" name="action" value="edit_topic_properties" />
   <input type="hidden" name="topic" value="[% topicid %]" />
  @@ -54,9 +54,7 @@
       <input type="text" name="topic_title" 
              value="[% title | html_entity %]" size="70"
                [%# Check to see if the topic is open or not #%]
  -        [% IF topic_readonly != 0 %]
  -                     readonly
  -             [% END %]
  +             [% IF topic_readonly != 0 %]readonly[% END %]
                    maxlength="70"/>
     </td>
   </tr>
  
  
  


_______________________________________________
Codestriker-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/codestriker-commits

Reply via email to