cvs: shortcut to diff with previous version?

1

1

What I want to achieve is this: after I do a

cvs -q up

I can pick out those files that are updated and use a command to quickly check what has changed.

In svn, I know I can do

svn diff -r BASE:PREV file 

But is there such a shortcut for CVS?

lang2

Posted 2013-09-18T01:59:39.247

Reputation: 1 830

Answers

0

I use a simple stupid script for this, no error handling or anything, so far works

#!/bin/bash
filepath=$1
latest=$(cvs status -v $filepath | grep "Working revision" | cut -d ':' -f2 | tr -d [:blank:])
minor=$(echo $latest | cut -d '.' -f2)
major=$(echo $latest | cut -d '.' -f1)
minorminusone=$(expr $minor - 1)
cvs diff -r $major.$minorminusone -r $major.$minor $filepath

Usage:

[user@server cvsmy]$ ./showlastdiff.sh ./filetoshowdiffon.pl
Index: ./filetoshowdiffon.pl
===================================================================   
RCS file: /var/cvs/filetoshowdiffon.pl,v
retrieving revision 1.68
retrieving revision 1.69
diff -r1.68 -r1.69
49c49
<     my $db = 'DATABASE';
---
>     my $db = "DATABASE2";

orwik

Posted 2013-09-18T01:59:39.247

Reputation: 1