[ic] diffing IC with cvs?

Mike Heins interchange-users@icdevgroup.org
Sat Oct 26 18:43:00 2002


--4Ckj6UjgE2iN1+kY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Quoting Rene Hertell (interchange-users@hertell.com):
> Hi,
> 
> I somehow don't understand the procedure in how to check the DIFFerence
> between my local cvs-directory and that the development version.
> 
> I have downloaded the cvs-version with "cvs -z3 -d
> :pserver:cvs@cvs.icdevgroup.org:/var/cvs checkout -P interchange" and
> installed successfully the dev-version of IC.
> 
> Now, how do I check the difference between my interchange cvs-directory and
> the version that is at icdevgroup.org? Running "cvs  diff -u" as described
> on the download page, I just get this:
> 
> cvs server: Diffing .
> Index: MANIFEST
> ===================================================================
> RCS file: /var/cvs/interchange/MANIFEST,v
> retrieving revision 2.70
> diff -u -r2.70 MANIFEST
> --- MANIFEST    17 Oct 2002 04:46:23 -0000      2.70
> +++ MANIFEST    26 Oct 2002 20:29:04 -0000
> @@ -1,5 +1,5 @@
>  LICENSE
> -MANIFEST                       This list of files
> +MANIFEST
>  MANIFEST.SKIP
>  Makefile.PL
>  README
> cvs server: Diffing SPECS
> cvs server: Diffing code
> etc.
> etc.
> 
> I know that running "cvs update -dP" updates my local cvs-files, but that
> does not show me the code that has been changed. I would be happy if someone
> could give me a clue what I'm doing wrong.
> 

You can browse the interchange-cvs archives, or use cvsweb to look
at individual modules. I have a script command I use called "cvb",
which opens a web browser for the named file (or directory) when
I am in it. It is attached...I am not sure if it uses "netscape -remote" or
my own URL-opener, but that would be easy to change.

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <mike@perusion.com>

How far can you open your mind before your brains fall out?

--4Ckj6UjgE2iN1+kY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=cvb

#!/usr/bin/perl

use strict;
use File::Basename;
use Cwd;
use Getopt::Std;

my $CMD;
for (qq{$ENV{HOME}/bin/url}, '/usr/local/bin/url') {
	($CMD = $_, last) if -x $_;
}
$CMD ||= 'lynx';

my $DEFAULT_REPOS  = 'interchange';
my $DEFAULT_BRANCH = 'DEV_4_7_0';
my $BASEURL = 'http://interchange.redhat.com/cgi-bin/cvsweb';

my $USAGE = <<EOF;
cvb -- browse CVS tree

usage: cvb [-hl] [-b url] [-r tag] [file]

options:

    -b baseurl   Base URL (default $BASEURL)
    -h           Dislay this message
    -l           Use Lynx as browser instead of default $CMD
    -L           Use Links as browser instead of default $CMD
    -r TAG       Use TAG (defaults to tag used at CVS checkout time;
                 use -r "" for none)
    -R repos     Use "repos" for fallback repository anchor
                 instead of $DEFAULT_REPOS

If no file is specified, browses the directory. If there is a file
specified, goes to the CVS log for that file.
EOF

use vars qw/$opt_b $opt_h $opt_l $opt_L $opt_r $opt_R $opt_D/;
getopts('b:DhlLr:R') 
	or die $USAGE;

$DEFAULT_REPOS = $opt_R if $opt_R;
if($opt_h) {
	print $USAGE;
	exit 2;
}

$CMD = 'links' if $opt_L;
$CMD = 'lynx' if $opt_l;

my $Repository;
my $Tag;
my $curdir = cwd();
my $path;
my ($file, $passed_dir, $dir);
if($path = shift) {
	$path =~ s://+:/:g;
	($file, $passed_dir) = fileparse($path);
}

$dir = $passed_dir || $curdir;
$dir .= '/' unless substr($dir, -1, 1) eq '/';

print <<EOF if $opt_D;
Before repository determination:
	curdir=$curdir
	dir=$dir
	file=$file
EOF

REPOS: {
	open CVS, "<${dir}CVS/Repository"
		or last REPOS;
	chomp ($Repository = <CVS>);
	close CVS;

	if (! defined $opt_r) {
		if (open CVS, "<${dir}CVS/Tag") {
			chomp ($Tag = <CVS>);
			close CVS;
			$Tag =~ s/^T//;
		}
	}
}

if(! $Repository) {
	$curdir =~ m{.*?/$DEFAULT_REPOS(/|$)(.*)}
		or die "Cannot resolve repository for $curdir";
	my $tdir = $2;
	$Repository = $DEFAULT_REPOS;
	$Tag = $DEFAULT_BRANCH;
	if($passed_dir) {
		$file = "$passed_dir/$file"; 
	}
	elsif ($file) {
		$file = "$tdir/$file"; 
	}
	else {
		$file = $tdir;
	}
}

$Tag = $opt_r if defined $opt_r;



print <<EOF if $opt_D;
After repository determination:
	curdir=$curdir
	dir=$dir
	file=$file
	Tag=$Tag
	Repository=$Repository
EOF

$BASEURL  = $opt_b if $opt_b;
$BASEURL  = "$BASEURL/$Repository/";
$BASEURL .= $file if $file;
$BASEURL .= "?only_with_tag=" . $Tag if $Tag;

if($opt_D) {
	print "Press <RETURN> to run '$CMD $BASEURL'\n";
	my $junk = <STDIN>;
}

exec ($CMD, $BASEURL);

--4Ckj6UjgE2iN1+kY--