1028
|
1 |
.. -*- coding: utf-8 -*-
|
|
2 |
|
|
3 |
======
|
|
4 |
CVS.
|
|
5 |
======
|
1029
|
6 |
.. contents::
|
1028
|
7 |
|
|
8 |
CVS via proxy server.
|
|
9 |
=====================
|
|
10 |
::
|
|
11 |
|
|
12 |
$ cvs -d:pserver;proxy=$proxyhost;proxyport=$proxyport:$cvsuser@$cvsdomain:/$repo
|
|
13 |
|
|
14 |
Create CVS Repository.
|
|
15 |
======================
|
|
16 |
::
|
|
17 |
|
|
18 |
$ export CVSROOT=/srv/cvsroot
|
|
19 |
$ cvs init
|
|
20 |
|
|
21 |
$ groupadd cvs
|
|
22 |
$ useradd -m -g cvs -s /bin/sh -c "CVS Repository" cvs
|
|
23 |
|
|
24 |
$ chown -R cvs $CVSROOT
|
|
25 |
$ chgrp -R cvs $CVSROOT
|
|
26 |
$ chmod -R g+s $CVSROOT
|
|
27 |
|
|
28 |
$ grep cvs /etc/services && echo OK
|
|
29 |
cvspserver 2401/tcp # CVS client/server operations
|
|
30 |
cvspserver 2401/udp # CVS client/server operations
|
|
31 |
$ echo '# CVS server
|
|
32 |
cvspserver stream tcp nowait root /usr/bin/cvs cvs --allow-root=/usr/local/src/cvsroot pserver' \
|
|
33 |
>/etc/inetd.conf
|
|
34 |
$ killall -HUP inetd # signal inetd daemon to re-read the config file
|
|
35 |
|
|
36 |
$ ls $CVSROOT/CVSROOT
|
|
37 |
readers # list of pseudo usernames that can read via cvspserver
|
|
38 |
writers # list of pseudo usernames can write via cvspserver
|
|
39 |
passwd # encrypted passwd string with (htpasswd from apache)
|
|
40 |
|
|
41 |
CVS workflow.
|
|
42 |
=============
|
|
43 |
|
|
44 |
Check out sources::
|
|
45 |
|
|
46 |
$ cvs co -P $proj
|
|
47 |
|
|
48 |
Status of changes::
|
|
49 |
|
|
50 |
$ cvs status
|
|
51 |
|
|
52 |
Compare local changes::
|
|
53 |
|
|
54 |
$ cvs diff -u $path
|
|
55 |
|
|
56 |
Creating patch::
|
|
57 |
|
|
58 |
$ cvs diff -N -u -r >$patch
|
|
59 |
|
|
60 |
History of changes::
|
|
61 |
|
|
62 |
$ cvs log $file
|
|
63 |
|
|
64 |
Remove a file::
|
|
65 |
|
|
66 |
$ rm $file # must first remove it locally
|
|
67 |
$ cvs rm $file # schedules it for removal
|
|
68 |
|
|
69 |
Add a file::
|
|
70 |
|
|
71 |
$ cvs add $file
|
|
72 |
|
|
73 |
Check in local changes::
|
|
74 |
|
|
75 |
$ cvs ci
|
|
76 |
|
|
77 |
Update local sources::
|
|
78 |
|
|
79 |
$ cvs update
|
|
80 |
|
|
81 |
Move a file can not be done cleanly at the local level. The best way to do this
|
|
82 |
with CVS is to go to the cvsroot repository and move the file or directory
|
|
83 |
within the repository there. The cvsroot repository keeps all files in their RCS
|
|
84 |
form of filename,v . The next cvs update will manifest the file move.
|
|
85 |
|
|
86 |
Tagging sources::
|
|
87 |
|
|
88 |
$ cvs tag $name
|
|
89 |
$ cvs rtag $name
|
|
90 |
|
|
91 |
Revert file::
|
|
92 |
|
|
93 |
$ rm $file # remove it from local sources
|
|
94 |
$ cvs update $file # get a new copy from the repository
|
|
95 |
|