bug-cvs
[Top][All Lists]
Advanced

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

removing file with sticky tag - patch


From: Marnie_Shore
Subject: removing file with sticky tag - patch
Date: Thu, 3 Apr 2003 12:13:17 -0500

I have seen posts regarding the "misfeature" where CVS treats a request to
remove a file with a sticky tag as a request to remove the tag from the
file. Generally the posters are surprised that the tag has been removed.

CVSNT fixes this problem with the following small patches to commit.c and
remove.c (sorry, not against official sources):

Index: commit.c
===================================================================
RCS file: /.../commit.c,v
retrieving revision 1.1
retrieving revision 1.4
diff -c -w -r1.1 -r1.4
*** commit.c      17 Mar 2003 19:27:06 -0000    1.1
--- commit.c      19 Mar 2003 17:50:31 -0000    1.4
***************
*** 913,920 ****
          }
          if (status == T_REMOVED
!           && vers->tag
!           && isdigit ((unsigned char) *vers->tag))
          {
            /* Remove also tries to forbid this, but we should check
               here.  I'm only _sure_ about somewhat obscure cases
--- 913,921 ----
          }

          if (status == T_REMOVED
!           && vers->tag &&
!           (isdigit ((unsigned char) *vers->tag) ||
!           !RCS_isbranch (finfo->rcs, vers->tag)))
          {
            /* Remove also tries to forbid this, but we should check
               here.  I'm only _sure_ about somewhat obscure cases
***************
*** 922,928 ****
               CVS for the remove and a new one for the commit), but
               there might be other cases.  */
            error (0, 0,
!     "cannot remove file `%s' which has a numeric sticky tag of `%s'",
                     finfo->fullname, vers->tag);
            freevers_ts (&vers);
            return (1);
--- 923,929 ----
               CVS for the remove and a new one for the commit), but
               there might be other cases.  */
            error (0, 0,
!     "cannot remove file `%s' which has a sticky tag of `%s'",
                     finfo->fullname, vers->tag);
            freevers_ts (&vers);
            return (1);



Index: remove.c
===================================================================
RCS file: /.../remove.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -c -w -r1.1 -r1.2
*** remove.c      19 Mar 2003 19:52:04 -0000    1.1
--- remove.c      19 Mar 2003 20:08:12 -0000    1.2
***************
*** 220,239 ****
          error (0, 0, "file `%s' already scheduled for removal",
               finfo->fullname);
      }
!     else if (vers->tag != NULL && isdigit ((unsigned char) *vers->tag))
      {
      /* Commit will just give an error, and so there seems to be
         little reason to allow the remove.  I mean, conflicts that
         arise out of parallel development are one thing, but conflicts
!        that arise from sticky tags are quite another.
!
!        I would have thought that non-branch sticky tags should be the
!        same but at least now, removing a file with a non-branch sticky
!        tag means to delete the tag from the file.  I'm not sure that
!        is a good behavior, but until it is changed, we need to allow
!        it.  */
      error (0, 0, "\
! cannot remove file `%s' which has a numeric sticky tag of `%s'",
             finfo->fullname, vers->tag);
      }
      else if (vers->date != NULL)
--- 220,233 ----
          error (0, 0, "file `%s' already scheduled for removal",
               finfo->fullname);
      }
!     else if (vers->tag != NULL && ((isdigit ((unsigned char) *vers->tag))
|| !RCS_isbranch(finfo->rcs, vers->tag)))
      {
      /* Commit will just give an error, and so there seems to be
         little reason to allow the remove.  I mean, conflicts that
         arise out of parallel development are one thing, but conflicts
!        that arise from sticky tags are quite another.  */
      error (0, 0, "\
! cannot remove file `%s' which has a sticky tag of `%s'",
             finfo->fullname, vers->tag);
      }
      else if (vers->date != NULL)


In the sanity.sh test script, tests sticky-17 through sticky-20 will have
to be changed.

Attachments containing patches:    (See attached file: commit.diff)    (See
attached file: remove.diff)

I hope this helps,
Marnie Shore

Attachment: commit.diff
Description: Binary data

Attachment: remove.diff
Description: Binary data


reply via email to

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