Differences between version 14 and revision by previous author of CVS.
Other diffs: Previous Major Revision, Previous Revision, or view the Annotated Edit History
Newer page: | version 14 | Last edited on Tuesday, December 28, 2004 1:20:01 am | by AristotlePagaltzis | Revert |
Older page: | version 11 | Last edited on Monday, May 31, 2004 12:24:33 pm | by JohnMcPherson | Revert |
@@ -1,183 +1,23 @@
-[Acronym] for __C__oncurrent __V__ersioncontrol
__S__ystem. Not to be confused with [CSV].
+[Acronym] for __C__oncurrent __V__ersions
__S__ystem, a VersionControlSystem
. (
Not to be confused with [CSV].)
-A way
of allowing multiple people work on one set of files at the same time and have changes merged in and history
and versions kept
(much like the wiki)
.
+It was born as a batch
of [Shell] scripts wrapping [RCS]
and diff3
(1), but evolved into something
much greater. Unfortunately, its roots also imply some annoying limitations
like being unable to rename/move files in
the repository without losing the associated history
.
-[CVS] started off as a couple of shell script wrappers around
[RCS
] and diff3(1), and it's evolved into something much much more
.
-
-It's starting to show its age now however as it's starting to have a few design limitations
.
-
-cvs is invoked by using the cvs
(1
) command
.
+See also:
+* cvs(1), the user interface to
[CVS]
+*
[Open Source Development with CVS | http://cvsbook.red-bean.com/
] by Coriolis Open Press
.
+ * [Online version | http://cvsbook.red-bean.com/cvsbook.html]
+ * [Offline HTML version | http://cvsbook
.red-bean.com/cvsbook.html.gz]
+ * [PostScript version | http://cvsbook.red-bean.com/cvsbook.ps]
+ Note that some
(irrelevant?
) chapters regarding the philosophy behind [CVS] in OpenSource are only present in the printed edition
.
----
-If you get a message such as
- 2402/path/to/repository: no such repository
-then it means that your client is too old, and doesn't understand "host:port" being part of the pserver path (eg cvs -d :pserver:hostname:2402/path/to/repository). Upgrade to a newer (1.11.x) version. Version 1.10 (distributed with OSX and solaris for example) has this problem.
-----
-!! Existing documentation supporting CVS
-Coriolis Open Press [Open Source Development with CVS|http://cvsbook.red-bean.com/]. Its not all the chapters, but its the relevant ones. The non-free chapters regard the philosophy behind cvs in open source, or something. Direct link to [postscript|http://cvsbook.red-bean.com/cvsbook.ps] and [html|http://cvsbook.red-bean.com/cvsbook.html.gz]. [Online|http://cvsbook.red-bean.com/cvsbook.html] copy.
+!! Notes
+A message such as
-----
-!!Setting up a local CVS
repository
+ <verbatim>
+ 2402/path/to/
repository: no such repository
+ </verbatim>
-If the machine does not have a repository set up, you need to decide where to store the modules, and create a skeleton.
-This will create a "CVSROOT" directory.
-
- CVSROOT=/path/to/some/directory
- export CVSROOT
- # create an initial skeleton
- cvs init
-
-Now, to import a source code module and store it in the repository:
- # change into the directory containing files and dirs to import
- cd source/code/topdir
- # set the path to the cvs repository. /var/lib/cvs/ might be a good
- # place for a multiuser system, or in
your home directory for just
- # yourself (eg "mkdir ~/cvs"; CVSROOT=~/cvs)
.
- CVSROOT=/path/to/some/directory
- export CVSROOT
- # add the files in the current directory to a new module repository
- # the name for this module
. This will be the directory name, so
- # probably a good idea to not have spaces in it.
- MODULENAME="report"
- # a string to identify the original source
- VENDORTAG="original upstream"
- # a tag (string) to mark your initial versions of the files
- RELEASETAG="initial"
- cvs import "$MODULENAME" "$VENDORTAG" "$RELEASETAG"
-
-(the editor specified in your EDITOR or VISUAL environment variable will
-then open, asking for a comment. Just put "initial version" or something)
-
-This will create a new directory, like $CSVROOT/$MODULENAME.
-Note that this only sets up a module,
and doesn't touch your current directory.
-You will need to check out the module, as below.
-
-----
-!!Using a CVS repository/module
-
-there are 3 commands you need to
understand to use cvs
:
-# cvs checkout
-# cvs update
-# cvs commit
-
-:)
-
-(There are a few other commands you need if you want to set up a repository, but the above are all you need to get code out
of and into an existing repository).
-
-To use
the module created in the above section:
- # decide where you want to check out the code
- cd ~/src
- # tell cvs where the repository is
- CVSROOT=/
path/to/some/directory
- export CVSROOT
- # get the code from a module. In this case, the module named "report"
-
cvs checkout report
- # go into the newly created directory
- cd report
-
-Note that cvs also takes a "
-d" argument for directory, so you can do
- cvs -d /path/to/some/directory checkout report
-instead of setting the CVSROOT environment variable.
-
-----
-Here are some examples from the [Greenstone|http
://greenstone.org] source code. (GreenStone is [GPL]'d digital library management software from the Computer Science department at WaikatoUniversity).
-
-1) You need to "checkout" the source code. To check it out, you need to tell cvs where the "repository" is kept.
-
pserver is the method used for anonymous, read-only access to the repository. The newer way is to use ssh.
- $ CVSROOT=
:pserver:cvs_anon@cvs.scms.waikato.ac.nz
:/usr/local/global-cvs/gsdl-src
- $ export CVSROOT
- $ cvs checkout gsdl
-
-(If we had a account on that machine for write access, the environment variables would be slightly different:
- $ CVS_RSH=ssh ; export CVS_RSH
- $ CVSROOT=:ext:username@server:/directory
/to/repository
-)
-
-This particular root directory allows anonymous, read-only checkout. You would need a username and password on that particular machine to have write access.
-
-2) Make your own changes to the source code.
- $ dd if=/dev/random of=a_source_file.cpp bs=1k count=$RANDOM
-(I swear this is how some of our 4th years come up with their code...)
-
-3) Now, you can use cvs to see how your stuff differs from everyone else's, and how to get everyone else's changes into your checked out version.
- src/gsdl/perllib/plugins$ cvs update
- ? HTMLPlug.pm-readme
- ? mht
- cvs server: Updating .
- P !ConvertToPlug.pm
- M HTMLPlug.pm
- P !WordPlug.pm
-
-P means "patched"; my version was patched to be updated to other people's changes that they have committed. M means locally modified (ie by me).
-
-You can see what is different between my version and the current checked in version:
- src/gsdl/perllib/plugins$ cvs diff HTMLPlug.pm
- Index: HTMLPlug.pm
- ===================================================================
- RCS file: /usr/local/global-cvs/gsdl-src/gsdl/perllib/plugins/HTMLPlug.pm,v
- retrieving revision 1.58
- diff -r1.58 HTMLPlug.pm
- 524c524
-
< $tmptext =~ s
/\s\S*$/…/;
- ---
-
> $tmptext =~ s/\s\S*$/…/; # horizontal ellipsis ...
- 705,707c705,707
- < $$textref =~ s/&(lt|gt|amp|quot|nbsp);/&z$1;/go;
- < $$textref =~ s/&([[^;]+);/&ghtml::getcharequiv($1,1)/gseo;
- < $$textref =~ s/&z(lt|gt|amp|quot|nbsp);/&$1;/go;
- ---
- > # $$textref =~ s/&(lt|gt|amp|quot|nbsp);/&z$1;/go;
- > $$textref =~ s/&([[^;]+);/&ghtml::getcharequiv($1,)/gseo;
- > # $$textref =~ s/&z(lt|gt|amp|quot|nbsp);/&$1;/go;
-
-So this diff shows that I added a comment to line 524, and commented out lines 705 and 707 (and changed line 706
). You may or may not recognise this gibberish as [Perl] code...
-
-4) Other cvs commands I find very useful include:%%%
-cvs status
- src/gsdl/perllib/plugins$ cvs status HTMLPlug.pm
- ===================================================================
- File: HTMLPlug.pm Status: Locally Modified
-
- Working revision: 1.58
- Repository revision: 1.58 /usr/local/global-cvs/gsdl-src/gsdl/perllib/plugins/HTMLPlug.pm,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
-
-cvs annotate
-(this has been trimmed for brevity)
- src/gsdl/perllib/plugins$ cvs annotate HTMLPlug.pm
- (.... trimmed ....)
- 1.7 (sjboddie 06-Dec-99): # if no title use first 100 characters
- 1.7 (sjboddie 06-Dec-99): my $tmptext = $$textref;
- 1.43 (jrm21 21-May-01): $tmptext =~ s/<\/([[^>]+)><\1>//g; # (eg) </b><b> - no space
- 1.30 (say1 14-Oct-00): $tmptext =~ s/<[[^>]*>/ /g;
- 1.56 (jrm21 11-Jul-02): $tmptext =~ s/(?: |\xc2\xa0)/ /g; # utf-8 for nbsp...
- 1.43 (jrm21 21-May-01): $tmptext =~ s/^\s+//s;
- 1.16 (gwp 22-Jun-00): $tmptext =~ s/\s+$//;
- 1.14 (gwp 24-May-00): $tmptext =~ s/\s+/ /gs;
- 1.56 (jrm21 11-Jul-02): $tmptext =~ s/^$self->{'title_sub'}// if ($self->{'title_sub'});
- 1.56 (jrm21 11-Jul-02): $tmptext =~ s/^\s+//s; # in case title_sub introduced any...
- 1.30 (say1 14-Oct-00): $tmptext = substr ($tmptext, , 100);
- 1.14 (gwp 24-May-00): $tmptext =~ s/\s\S*$/.../;
- 1.15 (sjboddie 20-Jun-00): $doc_obj->add_utf8_metadata ($section, $field, $tmptext);
- 1.33 (paynter 02-Nov-00): print $outhandle " extracted \"$field\" metadata \"$tmptext\"\n"
- 1.36 (sjboddie 18-Jan-01): if ($self->{'verbosity'} > 2);
- 1.16 (gwp 22-Jun-00): next;
- (.... trimmed ....)
-This shows each line (as checked in) of the file, showing when that line was last edited, who by, when, and which version. So if you make a stuff-up, everyone else knows who
to blame!
-
-5) Put my improvements back into the main repository! (You should always do an update just before doing this, in case someone else has made a change since you last checked)
.
- src/gsdl/perllib/plugins$ cvs commit HTMLPlug.pm
-----
-!"cvs update" statuses
-| A | this file was added to your checked out version by CVS
-| C | this file has a conflict between your local changes and someone else's committed changes
-| M | you've modified it and not yet committed it
-| P | you've modified the file and cvs successfully inserted someone else's recent changes
-| R | file removed from the main repository
-| U | updated other people's changes (and you haven't changed this file).
-----
-See Also BitKeeper; SubVersion
+means that
your client is older than version 1
.11
.x
and doesn't understand <tt>host
:port</tt> being part
of the pserver
path (eg <tt>
cvs -d :pserver:hostname
:2402
/path
/to/repository</tt
>). You need
to upgrade
.