CVS removes sticky tag without updating

CVS is really driving me crazy!

Is there a trick to removing sticky tags without updating the contents of the file? I know "cvs up -A", but it also modifies my files.

Or vice versa: Is there a way to update the full catalog to the previous date without installing sticky tags in the first place?

Background: I am using a working copy that has both CVS and HG versions, and I messed it up, so I won’t go back to the last point where it was synchronized, and then check what happens with CVS.

Thank you and welcome.

+7
cvs
source share
3 answers

This may depend on your version of CVS and comes with a warning that is not supported, but I manually removed the sticky tag from the CVS / Entries file. I did this a lot when I wanted to drop my working version into a previous version, but I avoid the sticky tag so that I can update normally when I'm ready.

First, just upgrade the file to the version you want to get from the repository. For cleanliness, I was in the habit of first deleting my local copy.

rm myfile cvs update -r 1.20 myfile 

This, of course, will leave you with a sticky tag.

 cvs status myfile =================================================================== File: myfile Status: Up-to-date Working revision: 1.20 Repository revision: 1.20 /cvsroot/myproject/myfile,v Sticky Tag: 1.20 Sticky Date: (none) Sticky Options: (none) 

The sticky tag is stored in the CVS / Entries file in the last field. If you look at CVS / Entries with a text editor and search for the file name, you will find the following:

 /myfile/1.20/Thu Nov 6 18:22:05 2014//T1.20 

T1.20 at the end is a sticky tag. You can simply delete it by leaving the line:

 /myfile/1.20/Thu Nov 6 18:22:05 2014// 

Now the sticky tag has disappeared. You are in the same state that you will be in if someone checked the new version, and you just have not updated it yet.

 cvs status myfile =================================================================== File: myfile Status: Needs Patch Working revision: 1.20 Repository revision: 1.21 /cvsroot/myproject/myfile,v Sticky Tag: (none) Sticky Date: (none) Sticky Options: (none) 

Once you confirm that it works in one file and becomes brave, you can make the whole directory at once, if you want, using your favorite tool (perl, awk, etc.) to change each file in CVS / Records (or only the lines you want to change). Of course, caution should be exercised. I use perl and save .backup to return in case of any problems:

 perl -pi.backup -e 's|//T[\.0-9]+$|//|' CVS/Entries 
+11
source share

You can use the -p option for "cvs up" to write to standard output, which you can redirect to the source file using ">". This avoids stickiness.

+1
source share

Or vice versa: is there a way to update directories to a previous date without installing sticky tags in the first place?

The sticky tag should remember that you are not in HEAD. If you make changes, then they will not go there. And simply removing the sticky tag can be dangerous in normal situations.

I think the best way is to create a patch from the date that the repositories were synchronized with the updated copy. Then apply the patch fix. Create a patch with the modified changes and apply it to another repository.

On a clean (but not synchronized repo):

$ cvs diff -R -D date_when_synced >patchfile

$ patch -R -pNUM <patchfile

Then, in the repo, you made changes that you do not want to lose with cvs up -A :

$ cvs diff -R >patchfile2

Then apply the patch in a "clean" repository:

$ patch -pNUM <patchfile2

I think this could do what you want if I understood it correctly.

0
source share

All Articles