From: Kevin A. <al...@se...> - 2002-02-27 17:54:43
|
If you look at the Concurrent Versions System (cvs) page for the PythonCard project, the instructions probably seem somewhat mysterious. http://sourceforge.net/cvs/?group_id=19015 Here are some instructions for Windows users that want to do anonymous cvs checkouts to keep up with changes in PythonCard rather than waiting for periodic releases. Most of the tutorials I've seen assume Unix/Linux. I haven't found any that walk the user step-by-step through the process for Windows. These instructions use PyCrust and PythonCard as examples, but the same steps apply to other projects you would find on SourceForge. ka --- The set of instructions below is for getting anonymous cvs working on a Windows machine. If you want to be able to checkin files then you'll also need an ssh client, but most people don't need that capability, so I'm not covering it here. The main cvs site is http://www.cvshome.org/ 1. Create a directory to act as your cvs HOME that will hold the cvs.exe and related files. For this discussion, I'm going to use a directory called c:\cvshome. 2. Download the latest command-line client. http://www.cvshome.org/dev/codewindow.html as of 2002-02-10, the latest version was: http://ftp.cvshome.org/win32/cvs1-11-1p1.zip 3. Unzip the file and move cvs.exe into the c:\cvshome directory. 4. Add c:\cvshome to your PATH. Under Windows 95/98 add the directory to the autoexec.bat file. You probably already have a PATH setting in there, so just add ;c:\cvshome to the end. Under Windows NT/2000/XP, open the System control panel, click on the Advanced tab and then the Environment Variables button to set the path. 5. Set the HOME environment variable required by cvs. Under Windows 95/98 you'll need to add this line to your autoexec.bat set HOME=c:\cvshome Under Windows NT/2000/XP you'll need to add HOME as an environment variable. This is done in the same dialog as the PATH environment variable of step 4. 6. Create a file named .cvsrc in the c:\cvshome directory that contains the following three lines: cvs -z6 update -dP diff -c The Windows Explorer won't let you create a file starting with a period (dot), so you'll need to use a text editor and then save .cvsrc as a text file from the editor. You can use the rename command in DOS if your text editor can't save a filename that starts with a period. Open a Command Prompt (DOS shell) and type cd c:\cvshome rename cvsrc.txt .cvsrc [cd is the DOS command to Change the current Directory.] That's assuming you saved the text file as cvsrc.txt. The commands above control the default cvs behavior; I originally got my .cvsrc file from Robin Dunn along with the explanation of what the commands do. cvs will use strong compression (-z6). When doing a cvs update it should create new directories (-d) and prune empty directories (-P). And cvs makes context style diffs (diff -c), which IMO are a little more human readable, instead of whatever the default is called. 7. This is an optional, but recommended step. Create a directory and PYTHONPATH environment variable to simplify working with multiple Python projects checked out from cvs. Rather than keeping packages such as PythonCardPrototype and PyCrust in my c:\python22\lib\site-packages directory, I have a separate directory called c:\python where I keep additional packages that I'm working on. Any package in that directory will override the same package that might have been installed into the c:\python22\lib\site-packages directory. You can use a different directory name if you want. 7a. Under Windows 95/98 add this line to the autoexec.bat file: set PYTHONPATH=c:\python Under Windows NT/2000/XP you'll need to add PYTHONPATH as an environment variable. 8. Now reboot your machine, so that when you restart the machine, the HOME and PATH environment variables are set correctly. To verify they are correct, open a Command Prompt (DOS shell) and type set then press Return. You should see output that includes something like this (the actual PATH will vary depending on what was already set on your box): HOME=C:\cvshome Path=C:\Python22\;C:\cvshome PYTHONPATH=c:\python 9. Test to see if cvs is working. We'll use PyCrust as an example, since it has a relatively small number of files. Open a Command Prompt (DOS shell) and type cd c:\python cvs -z3 -d:pserver:ano...@cv...:/cvsroot/pycrust co PyCrust [The text of the cvs command above should all be on one line, it will probably be wrapped once it goes through your mail program.] Note that the module name such as PyCrust in the line above will be used to create a new directory inside the directory you're currently at. So in the example above, you'll end up with a c:\python\PyCrust directory that contains the checked out files. 10. Now checkout the latest version of PythonCard (the following text should all be on one line) cvs -z3 -d:pserver:ano...@cv...:/cvsroot/pythonc ard co PythonCardPrototype 11. To update a package all you have to do is a "cvs update". If you checked out both PyCrust and PythonCardPrototype above, then you can open a command prompt and type cd c:\python\pycrust cvs update cd ..\pythoncardprototype cvs update And you'll get the latest updates of both packages. You can also create a batch file or shortcut, so you can update without going into DOS. I've attached a screen shot of a Shortcut I made to cvs.exe. I added " update" to the "Target:" and changed the "Start in:" directory to the PythonCard package directory. I moved that shortcut to my desktop and I can double-click it to update to the latest version of PythonCard. ------------------------------- Addendum by Patrick K. O'Brien: I do have a slightly different arrangement on my machine, that others might find useful as a variation on your instructions. First, I have a bin directory where I keep batch files and little utility programs, such as cvs.exe. That bin directory is on my path. Second, I'm sharing the HOME directory established by Cygwin. Basically, any HOME will do and since Cygwin needed one as well I just took advantage of it. Third, I call my code directory Code, rather that Python, which is no big deal but I just mention it because I'm going to show you my autoexec.bat file: Example autoexec.bat: --------------------- SET PATH=C:\bin;C:\Python22;C:\cygwin\bin SET HOME=C:\cygwin\home\pobrien SET CVS_RSH=ssh SET PYTHONPATH=C:\Code SET PYTHONSTARTUP=C:\Code\.pythonrc.py doskey (send suggestions or corrections to the address below) ka --- Kevin Altis al...@se... |