-
Notifications
You must be signed in to change notification settings - Fork 146
/
SVN_HOWTO.txt
193 lines (138 loc) · 5.73 KB
/
SVN_HOWTO.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
GRASS Addons Subversion repository at osgeo.org
##########################################################
-1. How to get access here?
Write access is only granted to developers who agree to abide by
RFC2 - Legal aspects of code contributions
https://trac.osgeo.org/grass/wiki/RFC/2_LegalAspectsOfCodeContributions
This needs to be communicated to a GRASS developer. For details, see
https://trac.osgeo.org/grass/wiki/HowToContribute#WriteaccesstotheGRASS-Addons-SVNrepository
Then you, the new developer need to obtain an "osgeo_id" at
http://www.osgeo.org/osgeo_userid
If you have an "osgeo_id" but forgot it, search for it at
Search at http://www.osgeo.org/cgi-bin/ldap_web_search.py
##########################################################
Using the GRASS Addons Subversion
0. Install the svn client software
Linux: * 'subversion' package (RPM/DEB for your distro, should
be on the CDROMs/DVD)
MacOSX: * http://subversion.tigris.org/
-> Downloads
Windows: * http://tortoisesvn.tigris.org/
-> Downloads
If you want a pretty Win32 GUI, 'TortoiseSVN'
integrates nicely with the Windows Explorer.
PROXY:
SVN is a tricky software. It ignores any environment variables for proxy.
If you have to use a proxy server, edit
$HOME/.subversion/servers
and add:
[global]
http-proxy-host = proxy.yourdomain.xyz
http-proxy-port = 3128
1. How to get the grass-addons from the SVN repository
1a) Command line:
svn checkout https://svn.osgeo.org/grass/grass-addons grass-addons
-> first it shows you the certificate (not validated which is ok),
enter 'p' to accept it permanently
1b) TortoiseSVN:
Just enter this url:
https://svn.osgeo.org/grass/grass-addons
and your user/password combination.
2. This will check out the grass-addons into the directory grass-addons/
3. cd grass-addons/
4. Read submitting instructions before committing any changes!
https://trac.osgeo.org/grass/wiki/Submitting
5. Now work on the repository (see below).
########################
We also have a nice Web interface for *reading* (not submitting):
http://trac.osgeo.org/grass/browser/grass-addons
If you want a graphical tool for SVN, get it here:
http://en.wikipedia.org/wiki/Subversion_%28software%29#GUI_front-ends.2Fclients
########################
Change notification:
Every change in the repository issues an email which indicates
- date
- author
- commit comment
- list of changed lines
The SVN change notification is better than that of the old CVS.
########################
Some commands (commands are pretty much the same as for CVS!):
- Help:
svn help
svn help up
svn help mv
...
- Update from SVN server:
svn up
This can happen:
A Added
D Deleted
U Updated
C Conflict - ZAP! Here check for problems (same as in old CVS)
G merGed
- Find out if you have uncommitted changes on your disk:
svn status
If no output, everything was uploaded to SVN. Congrats.
- Verify changes before submitting:
svn diff
- Commit changes to SVN server:
individual file commit:
svn ci -m "Some useful comment" file1 [file2 ...]
or (for global commit of all changes), simply:
svn ci -m "Some useful comment"
- Add new file/directory to SVN repository:
svn add file
svn ci -m "Some useful comment" file
svn add directory
svn ci -m "Some useful comment" directory
- Remove file from SVN server (careful!):
svn rm file
svn ci -m "Some useful comment" file
- Move file to another directory (this is the cool feature of SVN):
svn mv file ../some_dir/
cd ..
svn ci -m "file moved because ..."
- Make new directory (see also svn add above for simplicity):
svn mkdir newdirectory
svn ci -m "we need a new directory" newdirectory
- Oops - submitted a wrong change? Revert!
svn revert file
- See last changes after updating:
(BASE: the revision you updated to, PREV: previous)
svn diff -r PREV:BASE
svn diff -r PREV:BASE file
- Check history of changes:
(see http://svngrassaddons.red-bean.com/nightly/en/svn.tour.history.html for details)
svn log file
... on all files:
svn log
... create ChangeLog file:
svn log > ChangeLog
- Handling SVN conflicts (please read the svngrassaddons if unsure!):
http://svngrassaddons.red-bean.com/en/1.1/ch03s05.html
Whenever a conflict occurs, three things typically occur to assist you in
noticing and resolving that conflict:
* Subversion prints a C during the update, and remembers that the file is
in a state of conflict.
* For every conflicted file, Subversion places up to three extra
unversioned files in your working copy
* At this point, Subversion will not allow you to commit the file until
the three temporary files are removed.
$ svn commit --message "Add a few more things"
svn: Commit failed (details follow):
svn: Aborting commit: '/home/sally/svn-work/sandwich.txt' remains in conflict
* If you get a conflict, you need to do *one* of three things:
* Merge the conflicted text 'by hand' (by examining and editing the
conflict markers (<<<<< and >>>>>) within the file).
* or: Copy one of the temporary files on top of your working file.
* or: Run svn revert <filename> to throw away all of your local changes.
Once you've resolved the conflict, you need to let Subversion know by running
svn resolved. This removes the three temporary files and Subversion no longer
considers the file to be in a state of conflict:
$ svn resolved sandwich.txt
Resolved conflicted state of 'sandwich.txt'
##########
Reference (really good:)
http://svnbook.red-bean.com/nightly/en/index.html
Version Control with Subversion