Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
en:docs:cvs [2014/05/21 20:42] – external edit 127.0.0.1 | en:docs:cvs [2018/09/07 02:54] (current) – prokushev | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== osFree (was for Netlabs) CVS/SVN readme ===== | + | Page outdated. |
- | + | ||
- | (c) Ulrich Moeller, November 12, 1999 | + | |
- | + | ||
- | Last updated March 6, 2002 by Ulrich Moeller | + | |
- | osFree updated October 11, 2003 by Yuri Prokushev | + | |
- | + | ||
- | **Note:** This document in process of update for osFree SVN instead of Netlabs.org CVS. | + | |
- | + | ||
- | ==== ABOUT THIS DOCUMENT ==== | + | |
- | + | ||
- | This is for people who would like to access the osFree source code. If you have never written a program before, you will probably not be interested in this document. | + | |
- | + | ||
- | ==== INTRODUCTION TO SVN ==== | + | |
- | + | ||
- | SVN stands for “S…. V…. N….”. It is a tool which allows several developers to work on the same source code at the same time. | + | |
- | + | ||
- | For those of you that have never dealt with anything like this… just imagine a word processor document on a shared network directory that several people work on at the same time. There has to be some coordination of all the changes going on and checks whether the changes conflict with each other. | + | |
- | + | ||
- | SVN does exactly that, except that it can handle large directory trees with many files of any type – text or binary. | + | |
- | + | ||
- | The concept of a client/ | + | |
- | + | ||
- | While your local copy will always be at a certain code/ | + | |
- | + | ||
- | Maybe the nicest thing about SVN is that with text files, it can merge code changes. SVN has GNU “diff” built in so even if two people work on the same source file, SVN in most cases can automatically keep the changes in sync. See “Terminology” below. | + | |
- | + | ||
- | Netlabs has set up a CVS server on which all the Netlabs projects reside. This document should give you all the information about how to access that repository. | + | |
- | + | ||
- | ==== SETUP ==== | + | |
- | + | ||
- | As with most Unix programs, SVN expects you to have a “home” directory. If you don't have one, create an empty directory somewhere and set the HOME environment variable to that directory. | + | |
- | + | ||
- | In any case, I strongly recommend to create a file in $(HOME) called ”.svnrc” and add put a single line | + | |
- | + | ||
- | cvs -z9 | + | |
- | + | ||
- | in there to enable maximum compression during transfers. This greatly speeds up things if you have a slow internet connection. Otherwise CVS will do all network transfers with uncompressed data, which can be terribly slow. | + | |
- | + | ||
- | Secondly, the most practical way to use CVS is to have a common parent directory for all code repositories (i.e. projects). So create one (for example, “F: | + | |
- | + | ||
- | Finally, CVS needs you to have a user name and a password. If you don't have one yet, use “guest” and “readonly”, | + | |
- | + | ||
- | Set the current project environment. This is done via another environment variable, so for XWorkplace, set: | + | |
- | + | ||
- | < | + | |
- | + | ||
- | For WarpIN, use: | + | |
- | + | ||
- | < | + | |
- | + | ||
- | For the " | + | |
- | + | ||
- | < | + | |
- | + | ||
- | and so on. Currently, Netlabs holds over a dozen projects which can all be retrieved that way. | + | |
- | + | ||
- | NOTE: The CVSROOT path was changed in February 2002 for all Netlabs projects. From your old CVSROOT variables, simply remove the “e:” before ”/ | + | |
- | + | ||
- | Create a local subdirectory in your CVS root directory with the same name (e.g. (“F: | + | |
- | + | ||
- | Set USER=guest in your environment. Fire up your internet connection. To log onto a project, use the “cvs login” command. Enter “readonly” when you are prompted for the password. (Note that you will need to enter “cvs login” separately for each repository. CVS will then store the data in $(HOME)\.cvspass so you only need to do this once per project.) | + | |
- | + | ||
- | You are now ready to download (“check out”) a project. See section 5 below. | + | |
- | + | ||
- | ==== SVN TERMINOLOGY ==== | + | |
- | + | ||
- | The following terms should be known when working with SVN (or even reading the documentation): | + | |
- | + | ||
- | * " | + | |
- | * Repositories are usually equivalent to projects. However, repositories are just a directory on the server and can be created in any way. For example, we created the “xwphelpers” repository for code that is shared between XWorkplace and WarpIN. | + | |
- | * " | + | |
- | * To check out code, use the “cvs checkout” command. Details follow in the next section. | + | |
- | * " | + | |
- | * To commit code to the server, use the “cvs commit” command. See the CVS reference for details. Again, this requires that you have been granted write access by the server administrator. | + | |
- | * Usually, with most projects, only a limited number of people have write access to the server, for obvious reasons. But this is a “project policy” issue and not a CVS restriction. | + | |
- | * " | + | |
- | + | ||
- | If SVN then finds that a file has been changed on the server and your local copy needs to be updated, it “merges” all changes into the local copy. That is, it does not simply overwrite the local copy with the new version on the server, but will compare (diff) the two files and patch the local copy! As a result, you will not lose changes you made to your local copy when you check out updates. | + | |
- | + | ||
- | CVS has GNU “diff” built in for this, so this is pretty powerful. | + | |
- | + | ||
- | This happens automatically if you do “cvs checkout” after your initial checkout. Note that you can also use “cvs update”; the difference is that “update” will not retrieve new files, but only update existing local files. See the CVS reference for details. | + | |
- | + | ||
- | * " | + | |
- | + | ||
- | < | + | |
- | + | ||
- | ==== CHECKING OUT THE CODE ==== | + | |
- | + | ||
- | Change to the osFree root directory (e.g. " | + | |
- | + | ||
- | The command for getting source from the server is "cvs checkout" | + | |
- | + | ||
- | cvs checkout . | + | |
- | + | ||
- | (mind the dot) from the XWorkplace root directory, this will retrieve the entire code tree and create new local files if they don't exist yet. This can take a while for bigger projects. Again, use maximum compression (see section 3). | + | |
- | + | ||
- | "cvs checkout" | + | |
- | + | ||
- | cvs checkout src/ | + | |
- | + | ||
- | only those files are checked out. Mind the forward slashes. | + | |
- | + | ||
- | By contrast, "cvs update" | + | |
- | + | ||
- | You will see that CVS puts out lots of information about the files that were worked on. A typical CVS output from " | + | |
- | + | ||
- | < | + | |
- | M makefile | + | |
- | M include/ | + | |
- | M include/ | + | |
- | M src/ | + | |
- | + | ||
- | I strongly recommend redirecting standard output when using "cvs update" | + | |
- | + | ||
- | In each such line, the first letter tells you what CVS has done to the file: | + | |
- | + | ||
- | |?: |CVS does not know the file. It is in your local tree, but not in the repository. This happens if you have added files to your local copy yourself. | | + | |
- | |U: |This is the most frequent one. It means that CVS has “U”pdated a local file with a new copy from the server and occurs during “checkout” or “update”. | | + | |
- | |P: |Similar to " | + | |
- | |M: |This means that your local file was **M**odified before the update. You get this no matter if the file was updated (i.e. changes were merged successfully) or not. | | + | |
- | |C: |This happens if merge failed and a **C**onflict occured. You need to manually edit all files which have been marked with " | + | |
- | |R: |A local file has been removed because it is no longer in the repository (i.e. has been removed by someone with write access). | | + | |
- | + | ||
- | ~~DISCUSSION~~ | + | |
+ | See [[https:// |