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