bug-cvs
[Top][All Lists]
Advanced

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

Re: cvs add (resurrect) incompatibilities


From: Mark D. Baushke
Subject: Re: cvs add (resurrect) incompatibilities
Date: Thu, 21 Oct 2004 11:26:54 -0700

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

Hi Frank,

Frank Hemer <address@hidden> writes:

> I just discovered a bug when running cvs add on a file that was previously 
> removed but not jet commited. This only happens in :ext: and :pserver: mode.
> 
> The bug was introduced with the change of add.c from version 1.80.2.12 to 
> 1.80.2.13, it appears to be a side effect of using write_letter.
>
> Startup with:
> 
> cvs -d :ext/pserver:address@hidden:/CVSROOT -r co test
> cd test
> cvs remove -f test.txt
> cvs add test.txt
> 
> When running cvs on a local repository, the server response looks 
> like:
> U test.txt
> cvs add: test.txt, version 1.1.1.1.2.1, resurrected
> 
> When running via :ext: or :pserver:, the response looks like:
> cvs add: test.txt, version 1.1.1.1.2.1, resurrected
> U test.txt

I would rather let Derek deal with any changes to write_letter(), but I
would guess that what you really want if for error (0, 0, ...) messages
to flush any pending MT or T messages before writing their 'error'
output in client/server mode?

If Derek does fix it, then just using a dotest instead of a dotest_sort
for the resurrection-6 test should be a way to test it.
 
> An ugly side effect is that resurrect will re-add the file in rw-mode while 
> previous cvs-versions properly re-added it in ro-mode (provided it was 
> formerly checked out ro).

Actually, that is not an ugly side-effect. You should need to specify
the -r flag on the 'cvs add' command for it to take effect. The 'remove
- -f' has removed the file and that is where the state of any previous
'-r' capabilites lives as to how the file was previously checked out.

Also, if the file is being resurrected from a dead committed version, I
would suggest that it will need to be committed as a change and that
should imply being in write mode as well.

However, your message does point out a bug in 'cvs add' which the
following patch will probably address.

        -- Mark

 2004-10-21  Mark D. Baushke  <address@hidden>
 
        * add.c (add): Pay attention to cvswrite mode when resurrecting a
        file.
        (Report from Frank Hemer <address@hidden>.)
        * sanity.sh (resurrection): Add new tests to deal with read-only
        mode on a cvs add durring a resurrection.
 
 Index: src/add.c
 ===================================================================
 RCS file: /cvs/ccvs/src/add.c,v
 retrieving revision 1.111
 diff -u -p -r1.111 add.c
 --- src/add.c  21 Oct 2004 03:51:23 -0000      1.111
 +++ src/add.c  21 Oct 2004 18:19:01 -0000
 @@ -611,7 +611,7 @@ add (int argc, char **argv)
                                           vers->vn_user, vers->tag,
                                           vers->options, RUN_TTY,
                                           NULL, NULL);
 -                  xchmod (finfo.file, 1);
 +                  xchmod (finfo.file, cvswrite);
                    if (status != 0)
                    {
                        error (0, 0, "Failed to resurrect revision %s.",
 Index: src/sanity.sh
 ===================================================================
 RCS file: /cvs/ccvs/src/sanity.sh,v
 retrieving revision 1.983
 diff -u -p -r1.983 sanity.sh
 --- src/sanity.sh      21 Oct 2004 15:23:57 -0000      1.983
 +++ src/sanity.sh      21 Oct 2004 18:19:01 -0000
 @@ -6566,11 +6566,15 @@ new revision: 1\.3; previous revision: 1
  
          # The next test is that CVS will resurrect a committed removal to a
          # branch.
 -        dotest_sort resurrection-6 "$testcvs add file1" \
 +        dotest_sort resurrection-6 "$testcvs -r add file1" \
  "U file1
  $SPROG add: Re-adding file \`file1' on branch \`resurrection' after dead 
revision 1\.1\.2\.1\.
  $SPROG add: Resurrecting file \`file1' from revision 1\.1\.
  $SPROG add: use \`$SPROG commit' to add this file permanently"
 +        # If the file is modified, it had better be read-write
 +        # regardless of what the user has requested with the CVSREAD
 +        # environment variable or the global -r switch
 +          dotest resurrection-6b 'test -w file1' ''
          dotest resurrection-7 "$testcvs -Q diff -r1.1 file1" ""
          dotest resurrection-8 "$testcvs -q ci -mreadd" \
  "$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
 @@ -6587,9 +6591,16 @@ new revision: 1\.1\.2\.2; previous revis
          dotest resurrection-12 "$testcvs add file2" \
  "$SPROG add: File \`file2' has no previous revision to resurrect\."
  
 +        # Check what 'cvs -r add' does with resurrected files.
 +        dotest resurrection-13 "$testcvs -Q rm -f file1"
 +        dotest_sort resurrection-14 "$testcvs -r add file1" \
 +"U file1
 +$SPROG add: \`file1', version 1\.3, resurrected"
 +        dotest_fail resurrection-15 'test -w file1' ''
 +
          dokeep
          cd ../..
 -        rm -r 1
 +        rm -rf 1
          modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
          ;;
  
 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQFBd/9u3x41pRYZE/gRAuq4AKCb37/ndkgTgbRoEKufTW0fzyJHfQCfeghH
I7RMvDHiD7HKLxMgrOOgtbI=
=FdvI
-----END PGP SIGNATURE-----




reply via email to

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