info-cvs
[Top][All Lists]
Advanced

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

Re: [Fwd: Q on keyword substitution]


From: Todd Denniston
Subject: Re: [Fwd: Q on keyword substitution]
Date: Fri, 07 Jan 2005 12:31:38 -0500

jsWalter wrote:
> 
<SNIP>
> For @version, yes.
> 
> This "label' should not be changed at each iteration, as VERSION will be.
> 
> But not for @since.
> 
> It is a way of knowing when something was addedd or removed from a file
> based upon the CVS tracking version number
> 
> Walter
CVS might not do it for you, but you might be able to get some where in
between with a combination of $Version: $, commitinfo and a perl (or your
favorite scripting language).

put @since $Version: $ in your document.
check it in, and commitinfo should let it pass.

next time you go to commit it would read something like
@since $Version: 1.250 $

and commitinfo would deny the commit because there is a number between the
$'s.
if grep "address@hidden" $1 | grep [0-9] >> /dev/null
then
   echo "hey, you were supposed to run cleanup.pl on $1" 
   exit 5
fi
(the above is not tested, and I am going from the way verifymsg works, so
YMMV)

and have the user run cleanup.pl to go into the file and change all
@since $Version: 1.250 $
to
@since 1.250

then add a target in your Makefile(s) to run cleanup.pl as needed.
Or if you wanted to do something you might later regret, you could have
commitinfo run cleanup.pl, however changing files in-transit between the
user sandbox and the repository is usually a recipe for trouble.
-- 
Todd Denniston
Crane Division, Naval Surface Warfare Center (NSWC Crane) 
Harnessing the Power of Technology for the Warfighter




reply via email to

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