PROJECTS: BSD STUFF: FreeBSD CVS stuff
Working process
- Pull parts of the FreeBSD CVS tree into /exports/cvsroot/freebsd using cvsup. One of these parts will be the `doc' collection, i.e. the documentation tree.
- Set the CVSROOT environment variable to /exports/cvsroot/freebsd and "check
out" a scratch copy of some document, i.e.:
$ mkdir ~/dev/freebsd-doc ; cd ~/dev/freebsd-doc $ export CVSROOT=/exports/doc $ cvs checkout doc/
- Make your local modifications to the working copy in the scratch area; `~/dev/freebsd-doc' in this case. This does not affect the CVS mirror in /exports/doc yet.
- Run `make` as necessary to generate an HTML-formatted file in the local directory, suitable to previewing changes. Note that the ignored error on `tidy` is normal. To install it to my local HTML mirror, use `make DESTDIR=/exports/www/seekingfire-prod/freebsd-doc/ install`
- Use `cvs diff -u' in the scratch area to obtain a diff of the changes made locally to the files of the scratch area.
- Mail the diff to my mentor (Giorgos Keramidas, keramida@ceid.upatras.gr).
- Get reply, possibly involving some changes in the working files.
- Incorporate changes, repeat steps 4-6.
- Mail a final diff to my mentor.
- Mentor commits the diff to FreeBSD.
- I rerun cvsup to update the mirror files in /exports/doc.
- When the local mirror of /exports/doc is updated with the state of the files in the FreeBSD tree, use `cvs update' to update the scratch area too.
Hints:
- If I need to wipe out a change in my local copy with a fresh copy from CVS, use cvs update -C
- When running `make`, it has to be done from the root of the current doc (handbook/, usually). This sucks, because it takes so long to build.
Alternate Working process
This version, provided by Giorgos, is a bit more complex, but allows for better tracking of local changes and merging.
I usually prefer working in a "local" repository, which gives me a chance to build-test and back-track changes freely. My local repository was initially a CVS repo. Then a Subversion tree, and now I am testing Mercurial as my local version-control system. All these version-control systems are used in the following manner: * I check out a copy of the FreeBSD doc/ tree (not all of it, but just the parts I'm interested in. * This copy of the docs is considered a "read-only" area. I only use it to check out and 'cvs update' the virgin copy of the FreeBSD docs. ,-------------------------------------------------------------------------- | giorgos@gothmog:/home/giorgos$ cd ~/ws/bsd/doc | giorgos@gothmog:/home/giorgos/ws/bsd/doc$ ls -la | total 16 | drwxrwxr-x 6 giorgos giorgos - 512 Jun 9 19:35 . | drwxrwxr-x 5 giorgos giorgos - 512 May 12 16:11 .. | drwxrwxr-x 2 giorgos giorgos - 512 Jun 9 19:34 CVS | -rw-rw-r-- 1 giorgos giorgos - 1645 Apr 28 20:20 Makefile | -rw-rw-r-- 1 giorgos giorgos - 392 Apr 28 20:20 README | drwxrwxr-x 5 giorgos giorgos - 512 Apr 28 20:20 el_GR.ISO8859-7 | drwxrwxr-x 8 giorgos giorgos - 512 Jun 20 22:48 en_US.ISO8859-1 | drwxrwxr-x 12 giorgos giorgos - 512 Apr 28 20:20 share | giorgos@gothmog:/home/giorgos/ws/bsd/doc$ cvs -qR up -APd * | cvs update: warning: directory CVS specified in argument | cvs update: but CVS uses CVS for its own purposes; skipping CVS directory | giorgos@gothmog:/home/giorgos/ws/bsd/doc$ `-------------------------------------------------------------------------- * My normal user account doesn't even have write-access to the mirror of the FreeBSD repository. This prevents me from accidentally committing stuff to the mirror. * Then, I import the new files into a 'vendor repository', which is now kept at ``~/ws/doc-ncvs'' and it uses Mercurial for updates. ,-------------------------------------------------------------------------- | giorgos@gothmog:/home/giorgos/ws/bsd/doc$ find . \! -type d | \ | fgrep -v CVS/ | cpio -p -dmu ~/ws/doc-ncvs | 26261 blocks | giorgos@gothmog:/home/giorgos/ws/bsd/doc$ cd ~/ws/doc-ncvs | giorgos@gothmog:/home/giorgos/ws/doc-ncvs$ hg stat | giorgos@gothmog:/home/giorgos/ws/doc-ncvs$ `-------------------------------------------------------------------------- * Now there are no changes, but if there have been changes in the central FreeBSD repository, they would appear as modified files in the Mercurial repo too. I commit the updates into this Mercurial repo and consider the files in this repository as read-only too. They are my ``FreeBSD doc/ vendor branch'' and I only use this Mercurial tree as a staging area for merges into my own Mercurial repository. * Then I can use normal Mercurial ``hg merge'' commands to pull changes from the ``~/ws/doc-ncvs'' repository into my own workspace area, which is kept at ``~/ws/doc''. This is more complicated than your original process, and it involves quite a few branches, but it is only through this minor complexity that I can successfully track all the local changes and then merge FreeBSD stuff into my own workspaces. This may or may not sound helpful for you too. It's really up to you what level of merging you find comfortable :)
For committers...
> Assuming one had a commit bit, would the process change such that you'd
> forego the "local" CVS repository and just checkout directly?
You can check out from your local CVS tree, make changes and then use
the cvs -d option to commit into the remote repository. That's a trick
I most often use. All it takes is 3 aliases in my .bashrc file:
alias dcvs="cvs -d ':ext:keramida@dcvs.freebsd.org:/home/dcvs'"
alias fcvs="cvs -d ':ext:keramida@ncvs.FreeBSD.org:/home/ncvs'"
alias lcvs="cvs -R -d /home/ncvs"
Then I can change the active directory to a random scratch area, check
out files with `lcvs' (local cvs), make my changes, diff against the
local tree if I want to quickly review the changes I made, test build
the docs and if all goes well, commit to the _real_ repository with
"dcvs commit ...".

