author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Fri, 10 Dec 2010 12:56:10 +0200 | |
changeset 752 | 8423422f0a57 |
parent 678 | cd12d3519111 |
child 766 | 0eb76fb9d948 |
permissions | -rw-r--r-- |
294 | 1 |
-*- mode: outline; coding: utf-8 -*- |
2 |
||
674
6429d14cfc2a
Some Projects that Use Mercurial
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
673
diff
changeset
|
3 |
* About. |
6429d14cfc2a
Some Projects that Use Mercurial
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
673
diff
changeset
|
4 |
|
6429d14cfc2a
Some Projects that Use Mercurial
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
673
diff
changeset
|
5 |
http://mercurial.selenic.com/wiki/ProjectsUsingMercurial |
6429d14cfc2a
Some Projects that Use Mercurial
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
673
diff
changeset
|
6 |
Some Projects that Use Mercurial |
6429d14cfc2a
Some Projects that Use Mercurial
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
673
diff
changeset
|
7 |
|
6429d14cfc2a
Some Projects that Use Mercurial
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
673
diff
changeset
|
8 |
* User config. |
310
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
9 |
|
313
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
10 |
Put to your ~/.hgrc: |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
11 |
|
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
12 |
[ui] |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
13 |
; Editor for editing commit message. |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
14 |
editor = gvim |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
15 |
; Who commit. |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
16 |
username = Oleksandr Gavenko <gavenkoa@gmail.com> |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
17 |
; Use internal merge algorithm, which mark conflict like <<<<<< ====== >>>>>>. |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
18 |
; Save previous file version in '*.orig' file, after merge must be marked as |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
19 |
; resolved by running 'hg resolve -m <file>'. |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
20 |
merge = internal:merge |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
21 |
[web] |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
22 |
; Default encoding for file hosted by 'hg serv'. |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
23 |
encoding = utf-8 |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
24 |
|
312 | 25 |
** Useful extension. |
26 |
||
27 |
Put to your ~/.hgrc: |
|
28 |
||
29 |
[extensions] |
|
30 |
; To allow fetch command. |
|
31 |
fetch = |
|
32 |
; To allow Mercurial Queues. |
|
33 |
hgext.mq = |
|
34 |
||
310
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
35 |
** Multiline log message for log command. |
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
36 |
|
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
37 |
By default 'hg log' show only first line of log message. To see all message run: |
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
38 |
|
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
39 |
$ hg log -v |
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
40 |
|
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
41 |
or put into ~/.hgrc: |
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
42 |
|
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
43 |
[defaults] |
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
44 |
log = -v |
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
45 |
|
311
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
46 |
** Follow history ever when file copied. |
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
47 |
|
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
48 |
By default 'hg log' show only history after last file copy. To see log message |
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
49 |
before copying run: |
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
50 |
|
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
51 |
$ hg log -f |
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
52 |
|
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
53 |
or put into ~/.hgrc: |
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
54 |
|
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
55 |
[defaults] |
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
56 |
log = -f |
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
57 |
|
676 | 58 |
* Publishing repo. |
675 | 59 |
|
60 |
With static HTTP hosting you can copy via rsync, ftp, scp, etc., so long as all the files beneath |
|
61 |
.hg are copied. Also since 1.1 pull protocol can detect static HTTP hosting: |
|
62 |
||
63 |
$ hg clone http://example.com/project |
|
64 |
||
65 |
http://mercurial.selenic.com/wiki/hgserve |
|
676 | 66 |
http://mercurial.selenic.com/wiki/HgWebDirStepByStep |
675 | 67 |
http://mercurial.selenic.com/wiki/StaticHTTP |
68 |
||
676 | 69 |
** hgweb.config. |
70 |
||
71 |
Set allowed project by specifying paths to they (keys are URL, values are fs paths): |
|
72 |
||
73 |
[paths] |
|
74 |
myproject = /home/user/hg/myproject |
|
75 |
otherproject = /home/user/hg/otherproject |
|
76 |
||
77 |
You can use single wildcard '*' to search current subdirs or double wildcard '**' to search subdirs |
|
78 |
recursively: |
|
79 |
||
80 |
[paths] |
|
81 |
myproject = /home/user/hg/my/* |
|
82 |
otherproject = /home/user/hg/other/** |
|
83 |
||
84 |
Alternatively you can set a collection of repos (keys and values are both filesystem paths, keys |
|
85 |
should be prefixes of the values and are "subtracted" from the values in order to generate the URL |
|
86 |
paths to each repository): |
|
87 |
||
88 |
[collections] |
|
89 |
/home/user/hg = /home/user/hg |
|
90 |
/home/another/hg = /home/another/hg |
|
91 |
||
92 |
Allow archive downloads: |
|
93 |
||
94 |
[web] |
|
95 |
allow_archive = gz, zip, bz2 |
|
96 |
||
97 |
Make web page look nice: |
|
98 |
||
99 |
[web] |
|
678 | 100 |
# Use 'cd /lib/python2.x/site-packages/mercurial/templates; find . -type d' to see available |
101 |
# styles. Some interesting: gitweb, coal, monoblue. |
|
676 | 102 |
style = gitweb |
103 |
||
104 |
Set another settings: |
|
105 |
||
106 |
[web] |
|
107 |
encoding = UTF-8 |
|
108 |
||
109 |
maxchanges = 100 |
|
110 |
maxfiles = 100 |
|
111 |
||
112 |
In each $proj/.hg/hgrc put: |
|
113 |
||
114 |
[web] |
|
115 |
contact = ADMIN <admin@example.com> |
|
116 |
description = <p style="color: red;">$proj</b> allow make a <a href="http://example.com">BIG Thing.</a> |
|
117 |
# Do not use name, in this case you see dir name where project lcated. |
|
118 |
# name = $proj |
|
119 |
||
120 |
To allow push in 'hg serv': |
|
121 |
||
122 |
[web] |
|
123 |
allow_push = * |
|
124 |
push_ssl = false |
|
125 |
||
126 |
http://mercurial.selenic.com/wiki/PublishingRepositories |
|
127 |
Publishing Mercurial Repositories |
|
128 |
||
675 | 129 |
** init.d script. |
130 |
||
131 |
#!/bin/sh |
|
132 |
CMD=/usr/bin/hg |
|
133 |
||
134 |
PORT=7878 |
|
135 |
SRC=/srv/hg |
|
136 |
CONGIG=/srv/hg/hgweb.config |
|
137 |
PIDFILE=/var/run/hg.pid |
|
138 |
||
139 |
case "$1" in |
|
140 |
start) |
|
141 |
echo "Mecurial Server service starting." |
|
142 |
(cd "$SRC"; $CMD serve -d -p $PORT --pid-file "$PIDFILE") |
|
143 |
;; |
|
144 |
stop) |
|
145 |
if [ -f "$PIDFILE" ]; then |
|
146 |
PID=`cat "$PIDFILE"` |
|
147 |
if [ "$PID" -gt 1 ]; then |
|
148 |
kill -TERM $PID |
|
149 |
echo "Stopping the Mercurial service PID=$PID." |
|
150 |
else |
|
151 |
echo Bad PID for Mercurial -- \"$PID\". |
|
152 |
echo You may remove \"$PIDFILE\" manually. |
|
153 |
fi |
|
154 |
else |
|
155 |
echo No PID file recorded for mercurial. |
|
156 |
fi |
|
157 |
;; |
|
158 |
*) |
|
159 |
echo "$0 {start|stop}" |
|
160 |
exit 1 |
|
161 |
;; |
|
162 |
esac |
|
163 |
||
164 |
http://mercurial.selenic.com/wiki/hgserve |
|
165 |
||
294 | 166 |
* Manage patches with MQ. |
167 |
||
168 |
First enable MQ, add following to your ~/.hgrc: |
|
169 |
||
170 |
[extensions] |
|
171 |
hgext.mq = |
|
172 |
||
173 |
Second get unpatched sources and put it to hg repository: |
|
174 |
||
175 |
$ tar zxf proj-x.y.z.tar.gz |
|
176 |
$ mv proj-x.y.z proj |
|
177 |
$ cd proj |
|
178 |
$ hg init |
|
179 |
$ hg ci -m "Added x.y.z version of proj." |
|
180 |
||
181 |
Init MQ and take name for first patch: |
|
182 |
||
183 |
$ hg qinit |
|
184 |
$ hg qnew first.patch |
|
185 |
||
186 |
Next make changes by editing source and save it to patch: |
|
187 |
||
188 |
$ $EDITOR file.c |
|
189 |
... |
|
190 |
$ hg diff |
|
191 |
... |
|
192 |
$ hg qrefresh |
|
193 |
$ hg diff # <-- have zero diff |
|
194 |
||
195 |
You can make second patch by applying existing one: |
|
196 |
||
197 |
$ hg qnew second.patch |
|
198 |
$ patch -p1 <bugfix.patch |
|
199 |
$ hg qrefresh |
|
200 |
||
201 |
You can take list of patches (from old to new) and revert or apply patches by |
|
202 |
qpop/qpush command: |
|
203 |
||
204 |
$ hg qseries # <-- what patches have |
|
205 |
first.patch |
|
206 |
second.patch |
|
207 |
$ hg qapplied # <-- what patches applied |
|
208 |
first.patch |
|
209 |
second.patch |
|
210 |
$ hg qpop |
|
211 |
$ hg qseries |
|
212 |
first.patch |
|
213 |
second.patch |
|
214 |
$ hg qapplied |
|
215 |
first.patch |
|
216 |
||
217 |
You can revert or apply all patches by single command: |
|
218 |
||
219 |
$ hg qpop -a |
|
220 |
$ hg qpush -a |
|
221 |
||
222 |
You can delete patch from patch list (before that you need de-apply patch): |
|
223 |
||
224 |
$ hg qpop -a |
|
225 |
$ hg qdelete first.patch |
|
226 |
||
227 |
To add new version of source and fix patches for it first de apply patches, |
|
228 |
then pull new changes and try apply patches on top of new sources: |
|
229 |
||
230 |
$ hg qpop -a |
|
231 |
$ rm * # .hg dir not deleted because its name start with dot |
|
232 |
$ cd .. |
|
233 |
$ tar zxf proj-a.b.c.tar.gz |
|
234 |
$ cp -R proj-a.b.c/* proj |
|
235 |
$ cd proj |
|
236 |
$ hg addremove -s 70 |
|
237 |
$ hg ci -m "Added a.b.c version of proj." |
|
238 |
$ hg qpush -a |
|
239 |
||
295
d3f8534dadf9
Applying series of patches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
294
diff
changeset
|
240 |
To apply series of already done patches use: |
d3f8534dadf9
Applying series of patches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
294
diff
changeset
|
241 |
|
d3f8534dadf9
Applying series of patches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
294
diff
changeset
|
242 |
$ ls /path/to/bugfixes/*.patch | xargs hg qimport |
425
8b7a3f47dac1
Proxy settings for hg.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
313
diff
changeset
|
243 |
|
8b7a3f47dac1
Proxy settings for hg.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
313
diff
changeset
|
244 |
* Proxy. |
8b7a3f47dac1
Proxy settings for hg.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
313
diff
changeset
|
245 |
|
8b7a3f47dac1
Proxy settings for hg.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
313
diff
changeset
|
246 |
$ hg clone --config http_proxy.host=$host:$port \ |
8b7a3f47dac1
Proxy settings for hg.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
313
diff
changeset
|
247 |
--config http_proxy.user=$user --config http_proxy.passwd=$password $addr |
673
faa365425ff0
Free Mercurial hosting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
425
diff
changeset
|
248 |
|
faa365425ff0
Free Mercurial hosting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
425
diff
changeset
|
249 |
* Free Mercurial hosting. |
faa365425ff0
Free Mercurial hosting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
425
diff
changeset
|
250 |
|
faa365425ff0
Free Mercurial hosting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
425
diff
changeset
|
251 |
http://mercurial.selenic.com/wiki/MercurialHosting |
faa365425ff0
Free Mercurial hosting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
425
diff
changeset
|
252 |
Free Hosting of Mercurial Repositories |