in last 10 minutes
Using CVS with OpenACS
http://openacs.org/doc/openacs-5-1/cvs-guidelines.html
Working with OpenACS and CVS
by Pascal Scheffers (and Jade Rubick, a little bit)
Introduction
I keep forgetting how to do this stuff. Nuff Said. If you want to know all about CVS, go to the CVSHome.org manual. Oh, by the way: I am not a CVS export. There are absolutely no warranties, like everything else on this site.Environment
I use OpenACS.org most often, so I have setup my CVSROOT environment variable to reflect that. This makes most cvs commands that much shorter: Edit ~/.bash_profile or ~/.profile and add:Next time you login you do not need to specifyexport CVSROOT=:ext:your_user@opeancs.org:/cvsroot export CVS_RSH=ssh
cvs -d:ext:your_user@openacs.org:/cvsroot
, just cvs co something
will do.
CVS will now always ask for your password, if you don't want this: start using RSA based authentication with SSH. See the manual page for that (ssh-keygen(1)).
Note: If you have both ssh 1.x and ssh 2.x (>2.3) installed, you may need to specify ssh1 as the OpenACS.org has an older version of SSH installed that doesn't like some newer features. Just try to login ssh2 -l loginname openacs.org
. If you get a MAC error or something, try ssh1.
Login
If you are using :pserver:anonymous@... you need to login first:You'll get a password prompt. The password is blank for openacs and sourceforge, so just press enter. You'll only need to do this once.# cvs login -d:pserver:anonymous@openacs.org/cvsroot
Fetching packages
To fetch a package:You will end up with# cd /web # cvs -z3 -d:pserver:anonymous@openacs.org:/cvsroot co acs-core
/web/openacs-4
. The '-z3' sets the compression to level 3, as CVS is mostly sending text, this will speed up things considerably - even on a fast connection.
Fetching a module
You can do this in two or three ways, just use what is most convenient for you:- Use the full path:
If you do it like this you need to specify -d:pserver:... or have CVSROOT set.# cd /web # cvs -z3 -d:pserver:anonymous@openacs.org:/cvsroot co openacs-4/packages/modulename
- Go to the subdirectory first
This works because CVS creates a ./CVS directory in each checked-out directory.# cd /web/openacs-4/packages # cvs -z3 modulename
Updating a checked out package
Update resynchronizes your previously checked out tree with the CVS server version. It will merge local changes with remote changes.So:
'-P' will remove empty directories.# cd /web/openacs-4/packages/modulename # cvs -z3 update -P -d
'-d' will make update checkout new directories.
Creating a Patch
If you don't have commit access, you need to create a patch and post it on the bug-tracker on openacs.orgs.To do a patch on one file, do:
A simple patch command is:cvs diff filenames -Nu > patchfile
This will create foo.diff with differences between the CVS version and your fixes. It will NOT add new files to the patch. If you want to add new files, please make sure that there are no 'foo.tcl~' backup files in your new dir. Specify this command to add them:# cd /web # diff -urb openacs-4/package/foo 4work/package/foo > foo.diff
diff -Nurb openacs-4/package/foo 4work/package/foo > foo.diff
Sharing code with everyone else
The best reference is here Patch submission instructionsIf you have a new package you'd like to add to the CVS repository, you do an "import". Note that we have put the new package in the OpenACS contrib directory. In this example, the package name is project-manager
.
I wasn't able to get this working quite right. You should be able to do an "import", which will upload all your code so you can share it with everyone else. I couldn't get it to import into the right place -- it kept importing into the /cvsroot directory.
Here's what I did.
First of all, we download a fresh copy of the OpenACS packages and so on. This is the only was I was able to put the package where I wanted it, in the contrib
directory. A smarter CVS developer might be able to do this another way.
In the above example,$ export CVS_RSH=ssh $ cd /tmp $ cvs -z3 co openacs-4 $ mv openacs-4/ openacs-head $ cd openacs-head/contrib/packages/ $ cp -a /path/to/package/project-manager/ . $ cd project-manager $ cvs import -m "Initial import of project-manager" openacs-4/contrib/packages/project-manager jade start username@openacs.org's password: N project-manager/filename ... No conflicts created by this import
project-manager
is the module name you're adding, jade
is what is called the vendor-tag. I used my own name there, but you could use your company name. I'm not totally clear on what start
means.
Checking in New files and committing
CVS committers know who they are, only committers can use these commands.I haven't tried this much yet Suppose you have just copied the sql dirs from oracle to postgresql and want to check them in (to define your directory structure or something, you could also port them first and then add them, of course.)
Congratulations, you've just made your first public appearance.# cd /web/openacs-4/packages/foo/sql # mkdir postgresql # cp oracle/* postgresql # cvs add postgresql # cd postgresql # cvs add *.sql # cvs commit -m '(please create a meaningful comment, that always helps)'
Commit
if you have changed files you cancvs commit -m "comments" [file(s)]
in the directory you are in. If you do not specify a file cvs will scan the current and all subdirectories for changes and commit them. You can also specify a bunch of files (like '*') or '-l' to prevent it from scanning the subdirectories. It's probably better to commit one file at a time at first, though.
Appendix I - File locations
todo...Other references
- http://openacs.org/4/checkout
- Using CVS vendor tags and branching - this document is for dotLRN, but the concepts are generally applicable.
- Great post by Richard Hamilton explaining how vendor tags work
- CVS guidelines for committers to OpenACS