info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cvs -n update -r TAG <- Can I get the version?


From: Peter Toft
Subject: Re: cvs -n update -r TAG <- Can I get the version?
Date: Sun, 12 Mar 2006 20:50:22 +0100 (CET)

On Thu, 9 Mar 2006, Jim Hyslop wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Peter Toft wrote:
> > Often I use "cvs -n update -r TAG" to see which files will be updated
> > when I update from the current version of my files to the release tag "TAG".
> > What I do need also are the version numbers of the files.
> [...]
> > Any clues on how to get near my wish?
> 
> 'cvs di -r TAG --brief' will give the revisions used:
> 
> $ cvs di -rHEAD --brief
> Index: test.txt
> ===================================================================
> RCS file: /cvs/cvs-test/test.txt,v
> retrieving revision 1.12
> retrieving revision 1.11
> diff -u --brief -r1.12 -r1.11
> Files /tmp/cvsOhGtSK and /tmp/cvsrSlA6W differ
> 
> You may want to write a script to make the output more concise.

And thats what I did - thanx a lot!!!

#!/bin/bash
if [ $# == "0" ]; then
  echo "You can supply a version number to this command...";
  export rev="HEAD";
else
  export rev=$1;
fi
echo "From the current version of your files and to revision $rev"
echo "the following files will be changes:"
echo
"----------------------------------------------------------------------------------"
echo -n "FILENAME OLDVER NEWVER" |gawk '{ printf "%-65s %6s  %6s\n", $1, $2, $3 
}'
rm -f ~/.tmpfile
( cvs di -r $rev --brief > ~/.tmpfile) >& /dev/null
cat ~/.tmpfile | grep -v "RCS file:" | grep -v ^Files | grep -v ^diff | grep -v 
===== | \
grep -v \? | sed -e 's/retrieving revision //g' | xargs | sed -e 's/Index: 
/\n/g' | \
gawk '{ printf "%-65s %6s  %6s\n", $1, $2, $3 }' > ~/.cvs2what
cat ~/.cvs2what
echo 
"----------------------------------------------------------------------------------"
echo "This is saved in ~/.cvs2what"

Best Peter

> 
> Note that TAG should be a branch tag or HEAD in order for this to work
> properly.
> 
> - --
> Jim Hyslop
> Dreampossible: Better software. Simply.     http://www.dreampossible.ca
>                  Consulting * Mentoring * Training in
>     C/C++ * OOD * SW Development & Practices * Version Management
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2 (MingW32)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
> 
> iD8DBQFEEC2XLdDyDwyJw+MRAvIQAJ9LBgqvNwWB2C1zQPS+F0FKvYfKFwCgzxBs
> Ob2MlbaYPmq4CIHLvhLidlQ=
> =SqD0
> -----END PGP SIGNATURE-----
> 
> 

Peter Toft, Ph.D. address@hidden http://pto.linux.dk

LinuxForum 2007 - du skal med igen 2. + 3. marts 2007.
http://www.linuxforum.dk




reply via email to

[Prev in Thread] Current Thread [Next in Thread]