FAQ Answerpage
QUESTION:
How do I tag changes for a new release when the CVS HEAD is not ready for tagging a new version?
ANSWER:
Sometimes a package coordinator gets caught between a rock and a hard place, because there are changes to files at the HEAD of CVS that are not yet ready for tagging in a new version, but other urgent changes need to be tagged for a new release.
There is a way of using CVS to handle this rather transparently, but first let me remind you that CVS branches are NOT to be used to handle this situation. Branching a package in CVS, although technically manageable, makes development
essentially impossible for anybody other than the package coordinator, and causes great difficulty in determining exactly what code was contained in a particular production release. This is because of the special properties of "branch tags", which do not
point to a time-invariant snapshot of the code.
DO NOT CREATE BRANCHES IN THE CVS REPOSITORY TO HANDLE TEMPORARY PROBLEMS WITH THE STATE OF YOUR PACKAGE.
Instead, you can use CVS's memory of the exact changes made to unmake, and later remake, the problematic changes. This is covered in the CVS man page, in the part on the update command.
As an example, assume package pkg was OK at tag V00-00-10, but that changes have been committed since then that are NFG (no good). You want to produce a new tag of the package that has some new changes, but is otherwise the
same as V00-00-10.
addpkg -h pkg
cd pkg
cvs tag V00-00-11
cvs update -jV00-00-11 -jV00-00-10
cvs commit -m"undo XXs changes temporarily"
cvs tag V00-00-12
(edit your changes, compile, test, etc)
cvs commit
cvs tag V00-00-13
Note that there was NO cvs update -A. The command cvs update -jV00-00-11 -jV00-00-10 asks CVS to remove all changes recorded between now ( V00-00-11 ) and the V00-00-10 tag. After that, the directory will contain the
exact same contents as if you had done the command addpkg pkg V00-00-10 (i.e. the contents of the V00-00-10 tag), but it will also have CVS status information that says its ready to be committed back as the new HEAD revision. You
therefore commit this onto the head, make your changes, and commit them. (The reason for the seemingly extra commit and tags is explained below)
If you only want to remove some changes, you can do the cvs update a file at a time. In that case, you can also use revision numbers instead of tags in the -j option. (If you don't understand what a revision number is,
including why you'd want to use them, DO NOT attempt this. Ask for help.)
So after all that, the head of CVS contains only desired changes, and has been tagged. The V00-00-13 tag can safely be announced. Now you want to get those not-quite-ready yet changes that used to be at the head of CVS, without having to redo
the edits. This can be done since CVS has not forgotten the changes previously made. Rather, when you committed for the first time above, it recorded "anti-changes" that undid the bad ones, as if you had undone them manually. To get them back in the head
of CVS, you use the V00-00-11 and V00-00-12 tags that would otherwise seem redundant. Its the same trick again; you ask CVS to undo the changes between V00-00-11 and V00-00-12, which are the changes that undid the
previous ones (this is also why you did two commits above).
(in the same directory as above, or do addpkg pkg V00-00-13)
cvs update -jV00-00-12 -jV00-00-11
cvs update -A
cvs commit
This will put the changes back on the HEAD of CVS. You can then continue develpment on those changes, but note that the ones you needed to make inbetween V00-00-12 and V00-00-13 are still present. In general, any of these update steps
can cause conflicts which CVS will catch and label in the usual way - its up to you to fix it.
To view the most up-to-date version of the documents for the machine you are using, you can access the cvs manual.
At a unix prompt, type the command:
man cvs
This will put you into the online cvs manual. You will want to look under the section regarding the command update. To scroll down one screen at a time, type the command:
Ctrl-v
To scroll up [back] one screen at a time, type the command:
Ctrl-b
To end the session, simply type:
q
(Last updated 7/10/98)
[SLAC Homepage] [Search] [FAQ Homepage]
If you have a FAQ (with or WITHOUT an answer), use our prototype submission form.
If you have comments or suggestions, email me at sison@slac.stanford.edu
|