[Cvsnt] How can checkout CVSROOT/modules

Jo.Kilian at gmx.de Jo.Kilian at gmx.de
Mon Feb 11 09:01:42 GMT 2002


Community technical support mailing list was retired 2010 and replaced with a professional technical support team. For assistance please contact: Pre-sales Technical support via email to sales@march-hare.com.


>I'm not a WinCVS user (I prefer the command-line tool),
>but all you will probably need is to convert:
>
>    cvs history -c -a -l | awk '{sub(/[/].*/,"",$8); print $8;}' | sort -u
>
>to Python.  All the above does is:
>  a) collect the output of the cvs history
>  b) strip field 8 (delimited by spaces/tabs) of all
>     characters following the first '/' character
>  c) prints _only_ field 8 (throws away all other fields)
>  d) perform a unique sort (throwaway duplicates) of
>     the result.
>
>I imagine that would be quite easy in Python.


It's qite easy in Perl too ... ;-)

Johannes



cvsmodules.pl:
-------------------------------------------------------
#!/usr/bin/perl -w
#
# cvsmodules - List all modules in repository
#
# by Johannes Kilian (jo.kilian at gmx,de)
#
use strict;

use vars qw($VERSION);

$VERSION = '1.000';

open LOG, "cvs history -c -a -l |";

my %modules;

while (<LOG>) {
  # Replace all tabs with space
  $_ =~ s/\t+/ /g;
  # Replace all multiple spaces with single space
  $_ =~ s/ +/ /g;
  # Split the line into words (word separator: space)
  my @words = split(/ /, $_);

  # Build a hash containing only the module names
  $modules{$words[7]}="";
}

# Print out a sorted list of all the modules
print "$_\n" for sort { lc $a cmp lc $b } keys(%modules);

exit 0;

__END__

=head1 NAME

cvsmodules - List CVS modules

=head1 SYNOPSIS

B<cvsmodules>

=head1 DESCRIPTION

Use B<cvsmodules> to determine all the modules defined in the
current CVS repository. The CVS repository can be set, using
the environmenet variable CVSROOT.

As a prerequisite, the history feature of CVS has to be turned
on. To do this, you will need to make a file called history
in <cvs-repository>/CVSROOT.  Changes to the repository are
recorded in that file.

=head1 OPTIONS

None.

=head1 AUTHOR

Johannes Kilian <jo.kilian at gmx.de> (based on a suggestion from
Andrew Hamilton-Wright )

=cut

#
# End of file.
#
----------------------------------------------------------

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net

_______________________________________________
Cvsnt mailing list
Cvsnt at cvsnt.org
http://www.cvsnt.org/cgi-bin/mailman/listinfo/cvsnt https://www.march-hare.com/cvspro/en.asp#downcvs



More information about the cvsnt mailing list
Download the latest CVSNT, TortosieCVS, WinCVS etc. for Windows 8 etc.
@CVSNT on Twitter   CVSNT on Facebook