bug-rcs
[Top][All Lists]
Advanced

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

corruption upon checkin?


From: Chris Moore
Subject: corruption upon checkin?
Date: Thu, 20 Feb 2003 02:40:08 +0100

Hi.

I am using RCS under Windows XP and occasionally have a problem with the
,v file getting corrupted when I do a check in.  Usually about 600 extra
lines get inserted into the ,v file, making all but the most recent
checkin irretrievable.

Consequently I made a copy of the ,v file after each checkin, and number
then, much like how I used to do config management before I discovered
there were programs like RCS.

I reproduce below quite a lot of shell interaction.  'cp' is the djgpp
'cp', but I doubt if it makes any difference.

I have a copy of the ,v file called 'unlocked,v', which isn't locked by
anyone.  I copy it to file,v so I can play with it without damanging it:

        ? cp unlocked,v file,v

I check it out:

        ? co -l file,v
        file,v  -->  file
        revision 1.111 (locked)
        done

And check that the checked out file is as it should be.  I have a copy
of what revision 1.111 looked like before it was checked in stored in a
file called 'old'.  I was working with it off-site for a long time - as
you can see, it was originally version 1.94.  I just brought 30 or so
versions back on site, and managed to check them in in turn to create a
new 1.95, 1.96, ... and so on.  This went file up to and including
making version 1.111, for as we see, the diff shows there to be no
differences other than the Id keyword:

        ? diff file old
        3c3
        < # $Id: file,v 1.111 2003/02/20 01:01:16 Chris Exp Chris $
        ---
        > # $Id: file,v 1.94 2002/11/21 13:32:28 Chris Exp Chris $

I then overwrite 'file' with the contents of 'new'.  'new' the next
version of the file from off-site.  I want it to become version 1.112 of
file,v:

        ? cp new file

The diffs between old and new are only around a hundred lines:

        ? diff new old | wc -l
            122

And 'rcsdiff' reports only around a hundred lines of differences, too,
as you would expect (in fact the 4 extra lines of diffs it finds are the
same as the 4 lines output by the 'diff file old' command above, so
everything is still as we would expect:

        ? rcsdiff file | wc -l
        
===================================================================
        RCS file: file,v
        retrieving revision 1.111
        diff -r1.111 file
            126

Before we do anything else, let's check the size of versions 1.1, 1.11
and 1.111:

        ? co -p -r1.1 file | wc
        file,v  -->  standard output
        revision 1.1
           5531   21787  172335

        ? co -p -r1.11 file | wc
        file,v  -->  standard output
        revision 1.11
           6406   25811  204082

        ? co -p -r1.111 file | wc
        file,v  -->  standard output
        revision 1.111
           5257   20522  164055

So I check the file in, making new version 1.112:

        ? ci file
        file,v  <--  file
        new revision: 1.112; previous revision: 1.111
        .
        done

But now, looking at 'rlog' we start to see things have gone wrong:

        ? rlog file | head -20

        RCS file: file,v
        Working file: file
        head: 1.112
        branch:
        locks: strict
        access list:
        symbolic names:
        keyword substitution: kv
        total revisions: 112;   selected revisions: 112
        description:
        .
        ----------------------------
        revision 1.112
        date: 2003/02/20 01:33:28;  author: Chris;  state: Exp;  lines:
+21 -   611
        .
        ----------------------------
        revision 1.111
        date: 2003/02/20 01:01:16;  author: Chris;  state: Exp;  lines:
+4 -0
        comment to be supplied later?

What's that with version 1.112?  611 lines were deleted?  So version
1.112 must have been corrupted then - let's check:

        ? co -p -r1.112 file | diff - new
        file,v  -->  standard output
        revision 1.112
        3c3
        < # $Id: file,v 1.112 2003/02/20 02:04:54 Chris Exp $
        ---
        > # $Id: file,v 1.94 2002/11/21 13:32:28 Chris Exp Chris $

Nope - it seems to be fine.  So where are those extra 600 lines?

        ? co -p -r1.1 file | wc
        file,v  -->  standard output
        revision 1.1
           6142   23951  190584                 [ was 5531   21787
172335 ]

        ? co -p -r1.11 file | wc
        file,v  -->  standard output
        revision 1.11
           7017   27952  221978                 [ was 6406   25811
204082 ]

        ? co -p -r1.111 file | wc
        file,v  -->  standard output
        revision 1.111
           5868   22701  181155                 [ was 5257   20522
164055  ]

Notice each of 1.1, 1.11 and 1.111 are now 611 lines longer than they
were, and than they should be!

File 'new' should be the same length as revision 1.112, and is:

        ? wc -l new
           5278 new

        ? co -p -r1.112 file | wc -l
        file,v  -->  standard output
        revision 1.112
           5278

File 'old' should be the same length as revision 1.111, but isn't:

        ? wc -l old
           5257 old

        ? co -p -r1.111 file | wc -l
        file,v  -->  standard output
        revision 1.111
           5868

These are the version strings:

        ? rcs -V
        RCS version 5.7 (RCS_SOFTLINKS patch 11)

        ? ci -V
        RCS version 5.7 (RCS_SOFTLINKS patch 11)

        ? co -V
        RCS version 5.7 (RCS_SOFTLINKS patch 11)

        diff -v
        Copyright 1988, 89, 92, 93, 94, 96, 1998 Free Software
Foundation, Inc.

        This program comes with NO WARRANTY, to the extent permitted by
law.
        You may redistribute copies of this program
        under the terms of the GNU General Public License.
        For more information about these matters, see the file named
COPYING.

        Written by Paul Eggert, Mike Haertel, David Hayes,
        Richard Stallman, and Len Tower.

Any ideas why this happens occasionally?  It is entirely reproducible.

Thanks.

Chris.
-- 
address@hidden






reply via email to

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