Whole document tree
13. Tracking third-party sourcesIf you modify a program to better fit your site, you probably want to include your modifications when the next release of the program arrives. CVS can help you with this task. In the terminology used in CVS, the supplier of the program is called a vendor. The unmodified distribution from the vendor is checked in on its own branch, the vendor branch. CVS reserves branch 1.1.1 for this use. When you modify the source and commit it, your revision will end up on the main trunk. When a new release is made by the vendor, you commit it on the vendor branch and copy the modifications onto the main trunk.
Use the
13.1 Importing for the first time
Use the
Note that
Suppose you have the sources to a program called
The vendor tag is named `FSF_DIST' in the above example, and the only release tag assigned is `WDIFF_0_04'.
13.2 Updating with the import command
When a new release of the source arrives, you import it into the
repository with the same
For files that have not been modified locally, the newly created
revision becomes the head revision. If you have made local
changes,
The above command will check out the latest revision of `wdiff', merging the changes made on the vendor branch `FSF_DIST' since yesterday into the working copy. If any conflicts arise during the merge they should be resolved in the normal way (see section 10.3 Conflicts example). Then, the modified files may be committed. Using a date, as suggested above, assumes that you do not import more than one release of a product per day. If you do, you can always use something like this instead:
In this case, the two above commands are equivalent.
13.3 Reverting to the latest vendor releaseYou can also revert local changes completely and return to the latest vendor release by changing the `head' revision back to the vendor branch on all files. For example, if you have a checked-out copy of the sources in `~/work.d/wdiff', and you want to revert to the vendor's version for all the files in that directory, you would type:
You must specify the `-bWDIFF' without any space after the `-b'. See section A.6.1 admin options.
13.4 How to handle binary files with cvs importUse the `-k' wrapper option to tell import which files are binary. See section C.2 The cvswrappers file.
13.5 How to handle keyword substitution with cvs importThe sources which you are importing may contain keywords (see section 12. Keyword substitution). For example, the vendor may use CVS or some other system which uses similar keyword expansion syntax. If you just import the files in the default fashion, then the keyword expansions supplied by the vendor will be replaced by keyword expansions supplied by your own copy of CVS. It may be more convenient to maintain the expansions supplied by the vendor, so that this information can supply information about the sources that you imported from the vendor.
To maintain the keyword expansions supplied by the
vendor, supply the `-ko' option to
13.6 Multiple vendor branchesAll the examples so far assume that there is only one vendor from which you are getting sources. In some situations you might get sources from a variety of places. For example, suppose that you are dealing with a project where many different people and teams are modifying the software. There are a variety of ways to handle this, but in some cases you have a bunch of source trees lying around and what you want to do more than anything else is just to all put them in CVS so that you at least have them in one place.
For handling situations in which there may be more than
one vendor, you may specify the `-b' option to
For example, suppose that there are two teams, the red team and the blue team, that are sending you sources. You want to import the red team's efforts to branch 1.1.1 and use the vendor tag RED. You want to import the blue team's efforts to branch 1.1.3 and use the vendor tag BLUE. So the commands you might use are:
Note that if your vendor tag does not match your `-b' option, CVS will not detect this case! For example,
Be careful; this kind of mismatch is sure to sow confusion or worse. I can't think of a useful purpose for the ability to specify a mismatch here, but if you discover such a use, don't. CVS is likely to make this an error in some future release.
This document was generated on September, 1 2005 using texi2html |