info-cvs
[Top][All Lists]
Advanced

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

Re: cvs_keyword_set_to_initial_version


From: Jim Hyslop
Subject: Re: cvs_keyword_set_to_initial_version
Date: Thu, 10 Apr 2014 00:11:24 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 14-04-09 10:47 AM, Arun K. Varghese wrote:
> Now when I am checking out , I can see that the keywords are
> changed & it shows the name of the last person who have checked in
> that file. I have tried with CVS -ko flag, which will only able to
> go back to just previous check in detail.

That's how keywords are supposed to work. They are modified each time
you check them in. As you have discovered, if you want to maintain
information across versions, don't use keyword substitution :)

> So is there any way to replace the current CVS keyword information 
> with the original one, that is the first checked in file's cvs 
> keyword information.

A shell script containing something like this should do it:

AUTHOR=`cvs -q up -p -r 1.1 $1 | grep '\$Author' | sed
's/[^$]*\\$//;s/\$.*//'`
sed -i "s/\$Author.*\$/$AUTHOR/" $1

The '-r1.1' option tells CVS to retrieve revision 1.1 from the
repository, and the '-p' option tells CVS to pipe the output to stdout.

If you were the author who first checked it in, and I was the latest
person to modify it and check it in, then the file would change from:

/* $Author: jim $ */

to:

/* Author: arun */

I'm sure someone with more shell scripting experience can come up with
something more elegant, but that should do the job. I'm assuming that
your shell scripting skills are enough that you can understand what
the sed and grep commands are doing; if not, let me know and I'll
break it down in more detail for you.

- -- 
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.8 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlNGGewACgkQLdDyDwyJw+OzpwCdH7zhx23oIHPgwZG7c5RYxVm/
bGkAoNifZ/RPhgstZLc5NYo0FjC7HSDB
=ee/5
-----END PGP SIGNATURE-----



reply via email to

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