1 |
g2boojum |
1.1 |
GLEP: 36 |
2 |
|
|
Title: Subversion/CVS for Gentoo Hosted Projects |
3 |
ciaranm |
1.6 |
Version: $Revision: 1.5 $ |
4 |
g2boojum |
1.1 |
Author: Aaron Walker <ka0ttic@gentoo.org> |
5 |
ciaranm |
1.6 |
Last-Modified: $Date: 2005/07/30 16:58:12 $ |
6 |
kugelfang |
1.5 |
Status: Final |
7 |
g2boojum |
1.1 |
Type: Standards Track |
8 |
|
|
Content-Type: text/x-rst |
9 |
|
|
Created: 11-Nov-2004 |
10 |
ciaranm |
1.6 |
Post-History: 13-Mar-2005, 21-Mar-2005 |
11 |
g2boojum |
1.1 |
|
12 |
|
|
Abstract |
13 |
|
|
======== |
14 |
|
|
|
15 |
|
|
Allow maintainers of Gentoo hosted projects to choose between Subversion/CVS. |
16 |
|
|
|
17 |
|
|
Motivation |
18 |
|
|
========== |
19 |
|
|
|
20 |
|
|
By offering a choice of version control systems, developers who want or need |
21 |
|
|
certain features, can choose which one suits them or their project the best. |
22 |
|
|
|
23 |
|
|
In addition, there are quite a few projects that should be Gentoo hosted, but |
24 |
|
|
are hosted elsewhere due to the fact that Subversion is not currently offered. |
25 |
|
|
Examples include the app-vim/gentoo-syntax package ([1]_), and |
26 |
g2boojum |
1.2 |
app-shells/gentoo-bashcomp ([2]_). |
27 |
g2boojum |
1.1 |
|
28 |
|
|
Subversion has many advantages over CVS, including changesets, directory |
29 |
|
|
versioning, atomic commits, versioned metadata, and more efficient branching |
30 |
|
|
and tagging ([3]_). Despite these advantages, many developers feel that |
31 |
|
|
Subversion is not yet ready for the main tree due to scaling issues. |
32 |
|
|
|
33 |
|
|
Specification |
34 |
|
|
============= |
35 |
|
|
|
36 |
|
|
The following steps describe, in detail, the process of setting up the |
37 |
|
|
Subversion svnserve daemon (over SSH) and creating new repositories. |
38 |
ka0ttic |
1.3 |
|
39 |
|
|
One repository should be created per project. Reasons for this include easier |
40 |
|
|
control over who has access, performance (checking out one big repository |
41 |
|
|
takes many times longer), ease-of-use (branching and merging are more difficult |
42 |
|
|
with one big repository), and meaningful revision numbers (since Subversion |
43 |
|
|
uses repository-global revision numbers, revision numbers for project A will |
44 |
|
|
increase on every commit even if no changes are made to project A). |
45 |
|
|
|
46 |
|
|
For preexisting CVS repositories, instructions on converting ([4]_) are |
47 |
|
|
already available in addition to the cvs2svn documentation itself ([5]_). |
48 |
g2boojum |
1.1 |
|
49 |
|
|
1. Install dev-util/subversion:: |
50 |
|
|
|
51 |
|
|
$ emerge subversion |
52 |
|
|
|
53 |
|
|
2. Write wrapper script for svnserve:: |
54 |
|
|
|
55 |
|
|
|
56 |
ka0ttic |
1.4 |
$ $EDITOR /usr/local/bin/svnserve-ssh && chmod +x \ |
57 |
|
|
> /usr/local/bin/svnserve-ssh |
58 |
|
|
|
59 |
|
|
#!/bin/sh |
60 |
|
|
umask 002 |
61 |
|
|
exec /usr/bin/svnserve "$@" |
62 |
g2boojum |
1.1 |
|
63 |
|
|
3. Modify the svnserve rc script:: |
64 |
|
|
|
65 |
ka0ttic |
1.4 |
$ cp /etc/init.d/svnserve /etc/init.d/svnserve-ssh |
66 |
|
|
$ sed -i 's:/usr/bin/svnserve:/usr/local/bin/svnserve-ssh:' \ |
67 |
|
|
> /etc/init.d/svnserve-ssh |
68 |
g2boojum |
1.1 |
|
69 |
|
|
4. Edit svnserve rc config:: |
70 |
|
|
|
71 |
|
|
$ ln -s /etc/init.d/svnserve /etc/init.d/svnserve-ssh |
72 |
|
|
$ $EDITOR /etc/init.d/svnserve |
73 |
|
|
|
74 |
|
|
SVNSERVE_OPTS="--root=/var/svnroot" |
75 |
|
|
SVNSERVE_USER="svn" |
76 |
|
|
SVNSERVE_GROUP="svn" |
77 |
|
|
|
78 |
|
|
5. Add svn group and user:: |
79 |
|
|
|
80 |
|
|
$ groupadd svn |
81 |
|
|
$ useradd svn -d /var/svnroot -s /bin/false -g svn |
82 |
|
|
|
83 |
|
|
6. Create the directory that will hold the repositories:: |
84 |
|
|
|
85 |
|
|
$ mkdir -p /var/svnroot/conf |
86 |
|
|
|
87 |
|
|
7. To create new repositories, simply run:: |
88 |
|
|
|
89 |
g2boojum |
1.2 |
$ svnadmin create --fs-type fsfs /var/svnroot/<repos> |
90 |
g2boojum |
1.1 |
|
91 |
|
|
8. Make sure newly created/converted repositories have correct permissions. Of course, Infra might want to do this differently:: |
92 |
|
|
|
93 |
|
|
$ chown -Rf svn:users /var/svnroot/<repos> |
94 |
|
|
$ chmod -Rf 775 /var/svnroot/<repos> |
95 |
|
|
|
96 |
|
|
9. Start it up:: |
97 |
|
|
|
98 |
|
|
$ /etc/init.d/svnserve-ssh start |
99 |
|
|
$ rc-update add svnserve-ssh default |
100 |
|
|
|
101 |
|
|
Backwards Compatibility |
102 |
|
|
======================= |
103 |
|
|
|
104 |
|
|
Offering a choice between Subversion and CVS should in no way cause any |
105 |
|
|
backwards compatibility issues. Those developers who prefer to use CVS can |
106 |
|
|
continue to do so without any ill effects. |
107 |
|
|
|
108 |
|
|
References |
109 |
|
|
========== |
110 |
|
|
|
111 |
|
|
.. [1] app-vim/gentoo-syntax |
112 |
|
|
http://developer.berlios.de/projects/gentoo-syntax/ |
113 |
g2boojum |
1.2 |
.. [2] app-shells/gentoo-bashcomp |
114 |
|
|
http://developer.berlios.de/projects/gentoo-bashcomp/ |
115 |
g2boojum |
1.1 |
.. [3] Version Control with Subversion |
116 |
|
|
http://svnbook.red-bean.com/en/1.0/ch01s03.html |
117 |
|
|
.. [4] Migration of Gentoo Repositories from CVS to Subversion |
118 |
|
|
http://dev.gentoo.org/~trapni/CVS2SVN.MIGRATION |
119 |
|
|
.. [5] cvs2svn Documentation |
120 |
|
|
http://cvs2svn.tigris.org/cvs2svn.html |
121 |
|
|
|
122 |
|
|
Copyright |
123 |
|
|
========= |
124 |
|
|
|
125 |
|
|
This document has been placed in the public domain. |
126 |
|
|
|