Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Nov 2004 10:27:35 +0100
From:      Chris Straessle <chris@tac.ch>
To:        freebsd-cvsweb@FreeBSD.org
Subject:   cvsweb patch (supports now annotate for binaries)
Message-ID:  <20041112092735.GA28354@terreactive.ch>

next in thread | raw e-mail | index | archive | help

--KsGdsel6WgEHnImy
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

hello,

I've needed annotate support also for binaries. the reason:
I make backups from several systems with cvs, but i alwas set
the 'b' flag when i check in the files, beucase if I backup a
script file, or any files with a cvs header, i don't wan't
cvs to change the $id$ field. (is not really a change, its
just a backup)

if I wanna watch these files with the fine webinterface,
cvsweb I can't get an annotate... so I've written a small
patch for it. maybe you like it too and implement this in the
next release of cvsweb. :-)

have a nice day,

chris straessle


-- 
-------------------------------------------------------------
addr://Rathausgasse 31, CH-5001 Aarau  Tel://++41 62 823 9355
http://www.terreactive.com             Fax://++41 62 823 9356
-------------------------------------------------------------
terreActive AG                      Wir sichern Ihren Erfolg.
-------------------------------------------------------------

--KsGdsel6WgEHnImy
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="cvsweb-3.0.4-annotate.diff"

--- cvsweb-3.0.4-orig/cvsweb.cgi	2004-11-12 10:21:20.000000000 +0100
+++ cvsweb-3.0.4/cvsweb.cgi	2004-11-12 10:25:32.000000000 +0100
@@ -1080,6 +1080,8 @@
       my ($rev, $date, $log, $author, $filename, $keywordsubst) =
         @{$fileinfo{$file}};
       my $isbinary = $keywordsubst eq 'b' ? 1 : 0;
+      $isbinary = 0; # annotate support for binary files
+                     # 041112/chris
       $filesfound++;
 
       printf "<tr class=\"%s\">\n", ($dirrow % 2) ? 'even' : 'odd';
@@ -1856,6 +1858,7 @@
   # Don't worry about sending valid-requests, the server just needs to
   # support "annotate" and if it doesn't, there isn't anything to be done.
   print CVS_IN "UseUnchanged\n";
+  print CVS_IN "Argument -F\n"; # to support annotate for binaries
   print CVS_IN "Argument -r\n";
   print CVS_IN "Argument $rev\n";
   print CVS_IN "Argument $where\n";
@@ -2090,6 +2093,7 @@
 
   # Last checks whether we'll do markup or not.
   my $isbin = $keywordsubstitution && $keywordsubstitution =~ /b/;
+  $isbin = 0; # support markup, also for bin files.
   my $mimetype = getMimeType($fullname, $isbin);
 
   # If we still are not sure whether to do markup or not:
@@ -3167,6 +3171,7 @@
   }
 
   my $isbin = $keywordsubstitution =~ /b/;
+  $isbin = 0; # why not privide bin files ...
   my $mimetype = getMimeType($filename, $isbin);
 
   print "<p>\n ";

--KsGdsel6WgEHnImy--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041112092735.GA28354>