author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Mon, 22 Feb 2016 13:12:06 +0200 | |
changeset 1908 | 0260f8ffef35 |
parent 1905 | fba288d59662 |
child 1912 | 8b81a8f0f692 |
permissions | -rw-r--r-- |
1513 | 1 |
.. -*- coding: utf-8; -*- |
2 |
.. include:: HEADER.rst |
|
3 |
||
4 |
============= |
|
5 |
Subversion. |
|
6 |
============= |
|
7 |
.. contents:: |
|
1905
fba288d59662
Include only local subsections into TOC. This prevent duplication of
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1779
diff
changeset
|
8 |
:local: |
1513 | 9 |
|
10 |
Where palced config files? |
|
11 |
========================== |
|
12 |
||
13 |
The per-user configuration area currently contains three files two |
|
14 |
configuration files ('config' and 'servers'). |
|
15 |
||
1777 | 16 |
``/etc/subversion`` |
17 |
Unix system wide configurations. |
|
18 |
``$HOME/.subversion`` |
|
19 |
Unix per-user configuration area. |
|
20 |
``%APPDATA%\Subversion`` |
|
21 |
Windows per-user configuration area. |
|
22 |
||
23 |
Coping repository. |
|
24 |
================== |
|
1513 | 25 |
|
1777 | 26 |
Making local repository copy:: |
27 |
||
28 |
$ svnadmin create $SVNROOT |
|
29 |
$ svnsync init file://$SVNROOT svn://$REMOTE |
|
30 |
$ svnsync synchronize file://$SVNROOT |
|
31 |
||
32 |
Note that you can't relocate working copy to new repository copy becase of:: |
|
33 |
||
34 |
$ svn relocate file://$SVNROOT |
|
35 |
svn: E195009: The repository at 'file:///home/user/devel/repo-copy' has uuid 'b064fe9f-b7ba-459e-afdf-3429ad89a318', but the WC has '11827c6b-1af5-4614-8a8b-dda7fb34cd94' |
|
36 |
||
37 |
Coping repository from SourceForge to GoogleCode:: |
|
1513 | 38 |
|
39 |
$ svnsync init https://PROJ.googlecode.com/svn https://PROJ.svn.sourceforge.net/svnroot/PROJ |
|
40 |
$ svnsync --username NAME --password PASSWORD \ |
|
41 |
sync https://PROJ.googlecode.com/svn https://PROJ.svn.sourceforge.net/svnroot/PROJ |
|
42 |
||
43 |
Disable interactive conflict resolution. |
|
44 |
======================================== |
|
45 |
||
46 |
Write in ``$HOME/.subversion/config``:: |
|
47 |
||
48 |
[miscellany] |
|
49 |
interactive-conflicts = no |
|
50 |
||
51 |
Creating svn repo. |
|
52 |
================== |
|
53 |
:: |
|
54 |
||
55 |
$ mkdir -p /srv/svn |
|
56 |
$ svnadmin create /srv/svn/$repo |
|
57 |
$ svn co file:///srv/svn/$repo $repo |
|
58 |
$ cd /tmp/$repo |
|
59 |
$ mkdir trunk branches features tags |
|
60 |
$ svn add * |
|
61 |
$ svn st # check all OK |
|
62 |
$ svn ci -m "Init repo." |
|
63 |
||
64 |
For multi-project repo do follow:: |
|
65 |
||
66 |
$ mkdir -p /srv/svn |
|
67 |
$ svnadmin create /srv/svn/$repo |
|
68 |
$ svn co file:///srv/svn/$repo $repo |
|
69 |
$ cd /tmp/$repo |
|
70 |
$ for proj in $proj1 $proj2; do mkdir $proj/trunk $proj/branches $proj/features $proj/tags; done |
|
71 |
$ svn add * |
|
72 |
$ svn st # check all OK |
|
73 |
$ svn ci -m "Init repo." |
|
74 |
||
75 |
Run local svn server. |
|
76 |
===================== |
|
77 |
:: |
|
78 |
||
1530
d41385c7d4cb
Remove unnecessary .exe command suffix.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1513
diff
changeset
|
79 |
$ svnserve -d --pid-file=svnserve.pid --root=/srv/svn/proj # default port: 3690 |
1513 | 80 |
$ svn ls svn://localhost # check all OK |
81 |
$ kill -l |
|
82 |
||
83 |
Undo bad commit. |
|
84 |
================ |
|
85 |
:: |
|
86 |
||
87 |
$ emacs FILE |
|
88 |
... |
|
89 |
$ svn ci -m "Introduce first bug." |
|
90 |
Sending trunk/FILE |
|
91 |
Transmitting file data . |
|
92 |
Committed revision 7. |
|
93 |
$ emacs FILE |
|
94 |
... |
|
95 |
$ svn ci -m "Make a lot of good changes." |
|
96 |
... |
|
97 |
Committed revision 8. |
|
98 |
... |
|
99 |
$ emacs FILE |
|
100 |
... |
|
101 |
$ svn ci -m "Introduce second bug." |
|
102 |
... |
|
103 |
Committed revision 10. |
|
104 |
$ emacs FILE |
|
105 |
... |
|
106 |
$ svn ci -m "Make a lot of good changes." |
|
107 |
... |
|
108 |
||
109 |
Now you understand that revision 7 and 10 buggy. You decide revert changes:: |
|
110 |
||
111 |
$ svn merge -r 7:6 -r 10:9 FILE |
|
112 |
$ svn ci -m "Reverted revision 7 and 10." |
|
113 |
||
114 |
For one changeset revert you can use shortly syntax:: |
|
115 |
||
116 |
$ svn merge -c -7 -c -10 FILE |
|
117 |
||
1531 | 118 |
Also you can use ranges:: |
1513 | 119 |
|
120 |
$ svn merge -r 10:6 FILE |
|
121 |
||
122 |
Merge branches. |
|
123 |
=============== |
|
124 |
:: |
|
125 |
||
126 |
$ cd trunk |
|
127 |
$ svn mergeinfo --show-revs eligible ^/branches/feature |
|
128 |
$ svn merge ^/branches/feature |
|
129 |
$ svn ci -m 'Integrate feature X.' |
|
130 |
||
1778 | 131 |
Fix EOL style. |
132 |
============== |
|
133 |
:: |
|
134 |
||
135 |
$ find . -type f -name '*.java' -exec svn propset svn:eol-style native {} ';' |
|
136 |
$ svn ci -m 'Fix svn:eol-style.' |
|
137 |
||
1779 | 138 |
Note that this actions pollute history. For example every line of file with |
139 |
CR/LF (created on Windows on file without ``svn:eol-style native``) after this |
|
140 |
actions would have new author in ``svn annotate``, and ``svn diff`` will show |
|
141 |
all on all change. |
|
142 |