info-cvs
[Top][All Lists]
Advanced

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

Re: Problem with partially lost branch information


From: Karl-König Königsson
Subject: Re: Problem with partially lost branch information
Date: Wed, 27 Nov 2002 16:52:10 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2) Gecko/20021126

Eric Siegerman wrote:

On Mon, Nov 25, 2002 at 02:05:00PM +0100, Karl-König Königsson wrote:
That's just the approach I'd have taken; but ouch!  I bet it took
a *long* time.  Try it this way instead:
        cvs log | egrep '^Working file:|forv_ver1_020311-branch'
[...]

"cvs log" is a wrapper for "rlog".  So it'd be something like:
        find $CVSROOT/itp -type f -name "*,v" | xargs rlog | egrep ...
Be warned that this will fail for pathnames containing shell
metacharacters, including spaces (those won't be a problem for
either your original approach or for my "cvs log | grep" one).
You can either work around that manually, or use GNU findutils as
I've described here recently (search the archives for "-print0"
[sic]).
I used your excellent idea to find the directories in which I had files
with erroneous revision tags. I then used this large-axe-approach:

    $ cvs log -l | egrep '^Working' | while read a b c
    >do
    >cvs tag -d forv_ver1_020311-branch $c
    >done

First I get the log for all files that ever existed in the current
directory (the -l switch). I then grep for "Working" thus getting a
string with contains, amongst others, the file name. This string is a
bit hairy and I was to lazy to fiddle with cut so I resorted to feeding
everything to read: a is always set to "Working", b to "file:" and c to
the current file name.

I then delete the tag from the file (cvs tag -d). Since the file does
not exist in the branch and has the branch tag as a revision tag is this
safe to do. Furthermore: all files that are correctly tagged with the
branch tag will survive this assault with an error message instead.

Thus: all files with the branch tag as revision tag got it removed; all
other files are left untouched. QED.

Scary, but it worked. Nothing for the faint of heart :-)

Thanks, everyone!

    Karl-Koenig Koenigsson

--
GLASGOW (n.)
The feeling of infinite sadness engendered when walking through a place
filled with happy people fifteen years younger than yourself.
(The Meaning of Liff, Douglas Adams)







reply via email to

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