[sllug-members]: Removing sticky tag 'HEAD' in cvs

zeta zeta@lanthera.net
Tue, 03 Jun 2003 08:07:04 -0600

The problem is that you're checking out branch-2 of a file and trying to 
put that file into another branch, you need to take your merged file and 
commit it into the original tree, which is what you specified when you 
first created the cvs module
it'll be something like this:
cvs commit -r MYORIGINALBRANCH foo.c
the other alternative (and sometimes less painful), is to move the file 
to another location or change its name, checkout a fresh version of the 
file you want from the right branch, override/manually merge the moved 
file to the new file and recommit. (sometimes this is easier than 
dealing with the oddities of cvs).

Also you can't commit HEAD back into a repository even though thats the 
head, check out the latest -r, you could try it with something like...
cvs -q update -d -D 2 hours ago foo.c

hope this helps

Elijah P Newren wrote:

>This probably sounds weird, but I managed to somehow get a sticky tag of
>'HEAD' attached to several of my files which I don't know how to remove
>and which causes an obvious conflict.  Does anyone that know how to
>remove this? (for those that want to fire off a quick response before
>reading the rest of this email--'cvs update -A' doesn't work) 
>Specifically, what I did is the following:
>[Note that this is an individual project with the cvs repository
>residing somewhere under my home directory.]  
>At some point, I created a branch off the main development in cvs called
>branch-2.  I made a bunch of changes and then wanted to merge these all
>back to the head of development.  So I went to my sandbox (which was
>currently on branch-2 with all changes commited) and ran the following:
>   # Move sandbox back to CVS HEAD
>   cvs update -r HEAD   # I believe I should have used 'cvs update -A'
>   # Merge in the differences between HEAD and branch-2
>   cvs update -j branch-2
>   # Try to commit the changes
>   cvs commit -m "Merged changes from branch-2"
>At that point, I got a lot of errors saying that I had a sticky tag on
>my files.  So I ran
>   cvs update -A
>and retried the cvs commit.  It worked on all files which existed on
>HEAD before the merge from branch-2.  However, all new files from
>branch-2 (of which there are half a dozen or so) still fail.  The
>following is what I'm seeing at the command line with those:
>1017 newren@amr:research/fluid$ cvs status steps.txt | grep Tag
>   Sticky Tag:          HEAD (revision: 1.1)
>1018 newren@amr:research/fluid$ cvs commit -m "Merged from branch-2"
>cvs commit: Attempt to add reserved tag name HEAD
>cvs commit: could not stub branch HEAD for
>1019 newren@amr:research/fluid$ cvs update -A steps.txt
>A steps.txt
>1020 newren@amr:research/fluid$ cvs status steps.txt | grep Tag
>   Sticky Tag:          HEAD (revision: 1.1)
>For comparison, with main.C (which is not a new file from branch-2), I
>used to get the same Sticky Tag but a 'cvs update -A' changes things so
>that I get the following:
>1021 newren@amr:research/fluid$ cvs status main.C | grep Tag
>   Sticky Tag:          (none)
>I happen to have a backup of my entire home directory as of 2 a.m.
>(rsync rocks), so I could simply restore the repository from before any
>of these changes--but I'd like to know how to work with CVS, rather than
>working around it.