Option --show-tag

From: Bernd Kuemmerlen <bkuemmer@gmx.net>
Date: Tue Jan 28 2003 - 08:16:01 GMT

Hello Martyn,

we recently needed a --show-tag option which works contrary to the
--ignore-tag option, i.e. which displays only revisions with a certain
tag. We need this because of our product release policy where we tag a
release and during the testing phase move tags on files which had bug
fixes. So we want to see only revisions which have been changed after a
certain date and which have a certain tag. With "cvs log" options alone
this is not possible because new files (which do not have the tag at
all) still get displayed.

So I hacked together a small patch, based on your --ignore-tag option,
which does what we want. I am not sure if this works under all
circumstances, at least it works for us. Maybe this could be included
(with a little cleanup of course, the --ignore-tag and --show-tag option
contradict themselves IMO etc...) in cvs2cl.pl

But anyway, keep up the good work
Cheers
        Bernd

--- cvs2cl.pl.orig 2003-01-28 09:07:18.000000000 +0100
+++ cvs2cl.pl 2003-01-27 15:37:34.000000000 +0100
@@ -114,6 +114,9 @@
 # Tags of which not to output
 my @ignore_tags;
 
+# Show only revisions with Tags
+my $show_tag = "";
+
 # Don't call Text::Wrap on the body of the message
 my $No_Wrap = 0;
 
@@ -837,11 +840,19 @@
           ## MJP: 19.xii.01 : Exclude @ignore_tags
           for my $ignore_tag (@ignore_tags) {
             next FOOBIE
- if grep $_ eq $ignore_tag, map(@{$_->{tags}},
+ if grep($_ eq $ignore_tag, map(@{$_->{tags}},
                                              grep(defined $_->{tags},
- @$qunklist));
+ @$qunklist)));
           }
           ## MJP: 19.xii.01 : End exclude @ignore_tags
+
+ # show only files with tag --show-tag $show_tag
+ if ($show_tag) {
+ next FOOBIE
+ if !grep($_ eq $show_tag, map(@{$_->{tags}},
+ grep(defined $_->{tags},
+ @$qunklist)));
+ }
 
           my $files = &pretty_file_list ($qunklist);
           my $header_line; # date and author
@@ -1038,6 +1049,12 @@
         if grep $_ eq $ignore_tag, @{$$qunkref{'tags'}};
     }
     ## MJP: 19.xii.01 : End exclude @ignore_tags
+
+ if ($show_tag) {
+ next QUNKREF
+ if !grep($_ eq $show_tag, @{$$qunkref{'tags'}});
+ }
+
 
     # Keep track of whether all the files in this commit were in the
     # same directory, and memorize it if so. We can make the output a
@@ -1736,6 +1753,10 @@
         unless @ARGV;
       push @ignore_tags, shift @ARGV;
     }
+ elsif ($arg =~ /^--show-tag$/ ) {
+ my $narg = shift (@ARGV) || die "$arg needs argument.\n";
+ $show_tag = $narg;
+ }
     else {
       # Just add a filename as argument to the log command
       $Log_Source_Command .= " '$arg'";
Received on Tue Jan 28 08:54:25 2003

This archive was generated by hypermail 2.1.8 : Wed Jan 21 2004 - 16:25:34 GMT