Thread: [Codestriker-commits] CVS update: codestriker/template/en/default viewtopicproperties.html.tmpl
                
                Brought to you by:
                
                    sits
                    
                
            
            
        
        
        
    | 
      
      
      From: <si...@us...> - 2006-06-21 04:58:52
       | 
|   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:sits@localhost: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:password@localhost: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>
  
  
  
 | 
| 
      
      
      From: <si...@us...> - 2008-02-23 02:22:02
       | 
|   User: sits    
  Date: 08/02/22 18:21:58
  Modified:    template/en/default viewtopicproperties.html.tmpl
  Log:
  From Rob: don't allow bug id field to be changed if used to create topic.
  
  
  
  Index: viewtopicproperties.html.tmpl
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/template/en/default/viewtopicproperties.html.tmpl,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- viewtopicproperties.html.tmpl	10 Aug 2006 11:29:05 -0000	1.24
  +++ viewtopicproperties.html.tmpl	23 Feb 2008 02:21:57 -0000	1.25
  @@ -78,8 +78,9 @@
   <tr class="tt1">
     <td>Bug IDs:</td>
     <td>
  +    [%# Set to readonly if topic generated from BugIDs #%]
       <input type="text" name="bug_ids" value="[% bug_ids %]"
  -           size="30" maxlength="50" [% IF topic_readonly != 0 %]readonly[% END %] />
  +           size="30" maxlength="50" [% IF topic_readonly != 0 || (start_tag == '' && end_tag == '' && module == '') %]readonly[% END %] />
       Links:
       [% FOREACH bug = bug_id_array %]
           [% IF loop.count() != 1 %], [% END %]
  
  
  
 | 
| 
      
      
      From: <si...@us...> - 2008-02-23 02:28:27
       | 
|   User: sits    
  Date: 08/02/22 18:28:09
  Modified:    lib/Codestriker/Action ListTopics.pm
               template/en/default viewtopicproperties.html.tmpl
  Log:
  Handle situation where bugs have been associated with a topic, but
  $Codestriker::bugtracker has not been defined.  From Rob.
  
  
  
  Index: ListTopics.pm
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/ListTopics.pm,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- ListTopics.pm	21 Dec 2004 23:02:55 -0000	1.30
  +++ ListTopics.pm	23 Feb 2008 02:28:09 -0000	1.31
  @@ -146,10 +146,14 @@
   
           # bug ids
   	my @accum_bugs = split /, /, $topic->{bug_ids};
  -	for ( my $index = 0; $index < scalar(@accum_bugs); ++$index) {
  -	    $accum_bugs[$index] =
  -		$query->a({href=>"$Codestriker::bugtracker$accum_bugs[$index]"},
  -                    $accum_bugs[$index]);
  +	for (my $index = 0; $index < scalar(@accum_bugs); ++$index) {
  +	    # Allow for no direct web link to a bug.
  +	    if (defined $Codestriker::bugtracker &&
  +                $Codestriker::bugtracker ne '') {
  +	        $accum_bugs[$index] =
  +		    $query->a({href=>"$Codestriker::bugtracker$accum_bugs[$index]"},
  +      	                      $accum_bugs[$index]);
  +	    }
   	}
   	$template_topic->{'bugids'} = join ', ', @accum_bugs;
   
  
  
  
  
  
  Index: viewtopicproperties.html.tmpl
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/template/en/default/viewtopicproperties.html.tmpl,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- viewtopicproperties.html.tmpl	23 Feb 2008 02:21:57 -0000	1.25
  +++ viewtopicproperties.html.tmpl	23 Feb 2008 02:28:09 -0000	1.26
  @@ -84,7 +84,11 @@
       Links:
       [% FOREACH bug = bug_id_array %]
           [% IF loop.count() != 1 %], [% END %]
  -        <a href="[% bugtracker %][% bug %]">Bug [% bug %]</a>
  +	    [% IF bugtracker != "" %]
  +            	<a href="[% bugtracker %][% bug %]">Bug [% bug %]</a>
  +	    [% ELSE %]
  +            	Bug [% bug %]
  +	    [% END %]
       [% END %]
     </td>
   </tr>
  
  
  
 |