author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Wed, 20 Jul 2011 10:51:44 +0300 | |
changeset 897 | b4d7d3091494 |
parent 896 | 07df4fa723e0 |
child 898 | 32e4be02ab01 |
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] |
|
817
df347f6a491f
About 'eol' extensions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
815
diff
changeset
|
30 |
; To allow 'fetch' command. |
818
f73cf47ef8f6
Update from skel proj,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
817
diff
changeset
|
31 |
hgext.fetch = |
312 | 32 |
; To allow Mercurial Queues. |
33 |
hgext.mq = |
|
818
f73cf47ef8f6
Update from skel proj,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
817
diff
changeset
|
34 |
; To import revisions from foreign VCS repositories into Mercurial. |
f73cf47ef8f6
Update from skel proj,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
817
diff
changeset
|
35 |
hgext.convert = |
f73cf47ef8f6
Update from skel proj,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
817
diff
changeset
|
36 |
; Usage: hg glog <dir> |
f73cf47ef8f6
Update from skel proj,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
817
diff
changeset
|
37 |
hgext.graphlog = |
817
df347f6a491f
About 'eol' extensions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
815
diff
changeset
|
38 |
; Enable '.hgeol' tracking (fix for CR/LF). |
818
f73cf47ef8f6
Update from skel proj,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
817
diff
changeset
|
39 |
hgext.eol = |
312 | 40 |
|
310
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
41 |
** Multiline log message for log command. |
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 |
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
|
44 |
|
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
45 |
$ hg log -v |
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
46 |
|
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
47 |
or put into ~/.hgrc: |
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
48 |
|
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
49 |
[defaults] |
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
50 |
log = -v |
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
51 |
|
311
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
52 |
** Follow history ever when file copied. |
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
53 |
|
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
54 |
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
|
55 |
before copying run: |
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
56 |
|
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
57 |
$ hg log -f |
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
58 |
|
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
59 |
or put into ~/.hgrc: |
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
60 |
|
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
61 |
[defaults] |
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
62 |
log = -f |
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
63 |
|
851
ebf1ef1c1615
Clone specific branches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
818
diff
changeset
|
64 |
* Clone specific branches. |
ebf1ef1c1615
Clone specific branches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
818
diff
changeset
|
65 |
|
852 | 66 |
$ hg clone http://your/repo -r $branch |
67 |
||
68 |
* Closing branches. |
|
69 |
||
70 |
$ hg branches |
|
71 |
$branch (inactive) |
|
72 |
... |
|
73 |
$ hg branches -a |
|
74 |
... # no $branch |
|
75 |
$ hg up -r $branch |
|
76 |
$ hg ci --close-branch -m "Bla-bla-bla" |
|
77 |
$ hg up -r default |
|
78 |
$ hg branches |
|
79 |
... # no $branch |
|
80 |
$ hg branches -c |
|
81 |
$branch (inactive) |
|
82 |
... |
|
851
ebf1ef1c1615
Clone specific branches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
818
diff
changeset
|
83 |
|
854 | 84 |
To reopen closed branch just update to it and commit anything! |
853
ccec7dd08cf2
To reopen closed branch just update to it and commit!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
852
diff
changeset
|
85 |
|
766
0eb76fb9d948
Join history of two repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
678
diff
changeset
|
86 |
* Remove/rename files history from repo. |
0eb76fb9d948
Join history of two repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
678
diff
changeset
|
87 |
|
0eb76fb9d948
Join history of two repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
678
diff
changeset
|
88 |
$ cat >filemap.txt <<EOF |
0eb76fb9d948
Join history of two repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
678
diff
changeset
|
89 |
exclude path/to/file-or-dir |
0eb76fb9d948
Join history of two repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
678
diff
changeset
|
90 |
rename path/to/source path/to/destination |
0eb76fb9d948
Join history of two repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
678
diff
changeset
|
91 |
... |
0eb76fb9d948
Join history of two repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
678
diff
changeset
|
92 |
EOF |
0eb76fb9d948
Join history of two repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
678
diff
changeset
|
93 |
$ hg convert --filemap filemap.txt $repo_orig $repo_new |
0eb76fb9d948
Join history of two repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
678
diff
changeset
|
94 |
$ hg -R $repo_new up |
0eb76fb9d948
Join history of two repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
678
diff
changeset
|
95 |
|
896 | 96 |
http://mercurial.selenic.com/wiki/ConvertExtension |
97 |
||
894
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
98 |
** Fix branch names. |
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
99 |
|
895 | 100 |
$ hg conver --branchmap $branchmapfile oldrepo newrepo |
894
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
101 |
|
766
0eb76fb9d948
Join history of two repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
678
diff
changeset
|
102 |
* Join history of two repos. |
0eb76fb9d948
Join history of two repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
678
diff
changeset
|
103 |
|
0eb76fb9d948
Join history of two repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
678
diff
changeset
|
104 |
$ cat >filemap1.txt <<EOF |
0eb76fb9d948
Join history of two repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
678
diff
changeset
|
105 |
rename . dir1 |
0eb76fb9d948
Join history of two repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
678
diff
changeset
|
106 |
EOF |
0eb76fb9d948
Join history of two repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
678
diff
changeset
|
107 |
$ cat >filemap2.txt <<EOF |
0eb76fb9d948
Join history of two repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
678
diff
changeset
|
108 |
rename . dir2 |
0eb76fb9d948
Join history of two repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
678
diff
changeset
|
109 |
EOF |
0eb76fb9d948
Join history of two repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
678
diff
changeset
|
110 |
$ hg convert --filemap filemap1.txt $repo1 $repo_new |
0eb76fb9d948
Join history of two repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
678
diff
changeset
|
111 |
$ hg convert --filemap filemap2.txt $repo2 $repo_new |
0eb76fb9d948
Join history of two repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
678
diff
changeset
|
112 |
$ hg -R $repo_new merge |
0eb76fb9d948
Join history of two repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
678
diff
changeset
|
113 |
$ hg -R $repo_new ci -m "Join $repo1 and $repo2." |
0eb76fb9d948
Join history of two repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
678
diff
changeset
|
114 |
|
676 | 115 |
* Publishing repo. |
675 | 116 |
|
117 |
With static HTTP hosting you can copy via rsync, ftp, scp, etc., so long as all the files beneath |
|
118 |
.hg are copied. Also since 1.1 pull protocol can detect static HTTP hosting: |
|
119 |
||
120 |
$ hg clone http://example.com/project |
|
121 |
||
122 |
http://mercurial.selenic.com/wiki/hgserve |
|
676 | 123 |
http://mercurial.selenic.com/wiki/HgWebDirStepByStep |
675 | 124 |
http://mercurial.selenic.com/wiki/StaticHTTP |
125 |
||
676 | 126 |
** hgweb.config. |
127 |
||
128 |
Set allowed project by specifying paths to they (keys are URL, values are fs paths): |
|
129 |
||
130 |
[paths] |
|
131 |
myproject = /home/user/hg/myproject |
|
132 |
otherproject = /home/user/hg/otherproject |
|
133 |
||
134 |
You can use single wildcard '*' to search current subdirs or double wildcard '**' to search subdirs |
|
135 |
recursively: |
|
136 |
||
137 |
[paths] |
|
138 |
myproject = /home/user/hg/my/* |
|
139 |
otherproject = /home/user/hg/other/** |
|
140 |
||
141 |
Alternatively you can set a collection of repos (keys and values are both filesystem paths, keys |
|
142 |
should be prefixes of the values and are "subtracted" from the values in order to generate the URL |
|
143 |
paths to each repository): |
|
144 |
||
145 |
[collections] |
|
146 |
/home/user/hg = /home/user/hg |
|
147 |
/home/another/hg = /home/another/hg |
|
148 |
||
149 |
Allow archive downloads: |
|
150 |
||
151 |
[web] |
|
152 |
allow_archive = gz, zip, bz2 |
|
153 |
||
154 |
Make web page look nice: |
|
155 |
||
156 |
[web] |
|
678 | 157 |
# Use 'cd /lib/python2.x/site-packages/mercurial/templates; find . -type d' to see available |
158 |
# styles. Some interesting: gitweb, coal, monoblue. |
|
676 | 159 |
style = gitweb |
160 |
||
161 |
Set another settings: |
|
162 |
||
163 |
[web] |
|
164 |
encoding = UTF-8 |
|
165 |
||
166 |
maxchanges = 100 |
|
167 |
maxfiles = 100 |
|
168 |
||
169 |
In each $proj/.hg/hgrc put: |
|
170 |
||
171 |
[web] |
|
172 |
contact = ADMIN <admin@example.com> |
|
173 |
description = <p style="color: red;">$proj</b> allow make a <a href="http://example.com">BIG Thing.</a> |
|
174 |
# Do not use name, in this case you see dir name where project lcated. |
|
175 |
# name = $proj |
|
176 |
||
177 |
To allow push in 'hg serv': |
|
178 |
||
179 |
[web] |
|
180 |
allow_push = * |
|
181 |
push_ssl = false |
|
182 |
||
183 |
http://mercurial.selenic.com/wiki/PublishingRepositories |
|
184 |
Publishing Mercurial Repositories |
|
185 |
||
675 | 186 |
** init.d script. |
187 |
||
188 |
#!/bin/sh |
|
189 |
CMD=/usr/bin/hg |
|
190 |
||
191 |
PORT=7878 |
|
192 |
SRC=/srv/hg |
|
193 |
CONGIG=/srv/hg/hgweb.config |
|
194 |
PIDFILE=/var/run/hg.pid |
|
195 |
||
196 |
case "$1" in |
|
197 |
start) |
|
198 |
echo "Mecurial Server service starting." |
|
199 |
(cd "$SRC"; $CMD serve -d -p $PORT --pid-file "$PIDFILE") |
|
200 |
;; |
|
201 |
stop) |
|
202 |
if [ -f "$PIDFILE" ]; then |
|
203 |
PID=`cat "$PIDFILE"` |
|
204 |
if [ "$PID" -gt 1 ]; then |
|
205 |
kill -TERM $PID |
|
206 |
echo "Stopping the Mercurial service PID=$PID." |
|
207 |
else |
|
208 |
echo Bad PID for Mercurial -- \"$PID\". |
|
209 |
echo You may remove \"$PIDFILE\" manually. |
|
210 |
fi |
|
211 |
else |
|
212 |
echo No PID file recorded for mercurial. |
|
213 |
fi |
|
214 |
;; |
|
215 |
*) |
|
216 |
echo "$0 {start|stop}" |
|
217 |
exit 1 |
|
218 |
;; |
|
219 |
esac |
|
220 |
||
221 |
http://mercurial.selenic.com/wiki/hgserve |
|
222 |
||
294 | 223 |
* Manage patches with MQ. |
224 |
||
225 |
First enable MQ, add following to your ~/.hgrc: |
|
226 |
||
227 |
[extensions] |
|
228 |
hgext.mq = |
|
229 |
||
230 |
Second get unpatched sources and put it to hg repository: |
|
231 |
||
232 |
$ tar zxf proj-x.y.z.tar.gz |
|
233 |
$ mv proj-x.y.z proj |
|
234 |
$ cd proj |
|
235 |
$ hg init |
|
236 |
$ hg ci -m "Added x.y.z version of proj." |
|
237 |
||
238 |
Init MQ and take name for first patch: |
|
239 |
||
240 |
$ hg qinit |
|
241 |
$ hg qnew first.patch |
|
242 |
||
243 |
Next make changes by editing source and save it to patch: |
|
244 |
||
245 |
$ $EDITOR file.c |
|
246 |
... |
|
247 |
$ hg diff |
|
248 |
... |
|
249 |
$ hg qrefresh |
|
250 |
$ hg diff # <-- have zero diff |
|
251 |
||
252 |
You can make second patch by applying existing one: |
|
253 |
||
254 |
$ hg qnew second.patch |
|
255 |
$ patch -p1 <bugfix.patch |
|
256 |
$ hg qrefresh |
|
257 |
||
258 |
You can take list of patches (from old to new) and revert or apply patches by |
|
259 |
qpop/qpush command: |
|
260 |
||
261 |
$ hg qseries # <-- what patches have |
|
262 |
first.patch |
|
263 |
second.patch |
|
264 |
$ hg qapplied # <-- what patches applied |
|
265 |
first.patch |
|
266 |
second.patch |
|
267 |
$ hg qpop |
|
268 |
$ hg qseries |
|
269 |
first.patch |
|
270 |
second.patch |
|
271 |
$ hg qapplied |
|
272 |
first.patch |
|
273 |
||
274 |
You can revert or apply all patches by single command: |
|
275 |
||
276 |
$ hg qpop -a |
|
277 |
$ hg qpush -a |
|
278 |
||
279 |
You can delete patch from patch list (before that you need de-apply patch): |
|
280 |
||
281 |
$ hg qpop -a |
|
282 |
$ hg qdelete first.patch |
|
283 |
||
284 |
To add new version of source and fix patches for it first de apply patches, |
|
285 |
then pull new changes and try apply patches on top of new sources: |
|
286 |
||
287 |
$ hg qpop -a |
|
288 |
$ rm * # .hg dir not deleted because its name start with dot |
|
289 |
$ cd .. |
|
290 |
$ tar zxf proj-a.b.c.tar.gz |
|
291 |
$ cp -R proj-a.b.c/* proj |
|
292 |
$ cd proj |
|
293 |
$ hg addremove -s 70 |
|
294 |
$ hg ci -m "Added a.b.c version of proj." |
|
295 |
$ hg qpush -a |
|
296 |
||
295
d3f8534dadf9
Applying series of patches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
294
diff
changeset
|
297 |
To apply series of already done patches use: |
d3f8534dadf9
Applying series of patches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
294
diff
changeset
|
298 |
|
d3f8534dadf9
Applying series of patches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
294
diff
changeset
|
299 |
$ ls /path/to/bugfixes/*.patch | xargs hg qimport |
425
8b7a3f47dac1
Proxy settings for hg.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
313
diff
changeset
|
300 |
|
793
7453db7e6f54
Fix patch description message from command line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
766
diff
changeset
|
301 |
You can fix patch description message from command line: |
7453db7e6f54
Fix patch description message from command line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
766
diff
changeset
|
302 |
|
7453db7e6f54
Fix patch description message from command line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
766
diff
changeset
|
303 |
$ hg qser -s |
7453db7e6f54
Fix patch description message from command line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
766
diff
changeset
|
304 |
makefile-doc.patch: |
7453db7e6f54
Fix patch description message from command line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
766
diff
changeset
|
305 |
$ hg qpush |
7453db7e6f54
Fix patch description message from command line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
766
diff
changeset
|
306 |
applying makefile-doc.patch |
7453db7e6f54
Fix patch description message from command line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
766
diff
changeset
|
307 |
now at: makefile-doc.patch |
7453db7e6f54
Fix patch description message from command line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
766
diff
changeset
|
308 |
$ hg qref -m 'Add description about Makefile usage.' |
7453db7e6f54
Fix patch description message from command line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
766
diff
changeset
|
309 |
$ hg qser -s |
7453db7e6f54
Fix patch description message from command line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
766
diff
changeset
|
310 |
makefile-doc.patch: Add description about Makefile usage. |
7453db7e6f54
Fix patch description message from command line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
766
diff
changeset
|
311 |
|
7453db7e6f54
Fix patch description message from command line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
766
diff
changeset
|
312 |
or from editor by: |
7453db7e6f54
Fix patch description message from command line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
766
diff
changeset
|
313 |
|
7453db7e6f54
Fix patch description message from command line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
766
diff
changeset
|
314 |
$ hg qref -e |
7453db7e6f54
Fix patch description message from command line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
766
diff
changeset
|
315 |
|
861
a0a4d3b85923
Remove all patches from MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
854
diff
changeset
|
316 |
* Remove all patches from MQ. |
a0a4d3b85923
Remove all patches from MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
854
diff
changeset
|
317 |
|
a0a4d3b85923
Remove all patches from MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
854
diff
changeset
|
318 |
$ hg qpop -a |
a0a4d3b85923
Remove all patches from MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
854
diff
changeset
|
319 |
$ for patch in `hg qser`; do hg qrm $patch; done |
a0a4d3b85923
Remove all patches from MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
854
diff
changeset
|
320 |
|
815
4e8e511bd02e
Show supported/loaded plugin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
793
diff
changeset
|
321 |
* Show supported/loaded plugin. |
4e8e511bd02e
Show supported/loaded plugin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
793
diff
changeset
|
322 |
|
4e8e511bd02e
Show supported/loaded plugin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
793
diff
changeset
|
323 |
$ hg help extensions |
4e8e511bd02e
Show supported/loaded plugin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
793
diff
changeset
|
324 |
$ hg showconfig extensions |
4e8e511bd02e
Show supported/loaded plugin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
793
diff
changeset
|
325 |
|
425
8b7a3f47dac1
Proxy settings for hg.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
313
diff
changeset
|
326 |
* Proxy. |
8b7a3f47dac1
Proxy settings for hg.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
313
diff
changeset
|
327 |
|
8b7a3f47dac1
Proxy settings for hg.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
313
diff
changeset
|
328 |
$ hg clone --config http_proxy.host=$host:$port \ |
8b7a3f47dac1
Proxy settings for hg.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
313
diff
changeset
|
329 |
--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
|
330 |
|
faa365425ff0
Free Mercurial hosting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
425
diff
changeset
|
331 |
* Free Mercurial hosting. |
faa365425ff0
Free Mercurial hosting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
425
diff
changeset
|
332 |
|
faa365425ff0
Free Mercurial hosting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
425
diff
changeset
|
333 |
http://mercurial.selenic.com/wiki/MercurialHosting |
faa365425ff0
Free Mercurial hosting.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
425
diff
changeset
|
334 |
Free Hosting of Mercurial Repositories |
815
4e8e511bd02e
Show supported/loaded plugin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
793
diff
changeset
|
335 |
|
885
49e12da19c2d
Merge or rebase uncommitted changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
861
diff
changeset
|
336 |
* Merge or rebase uncommitted changes. |
49e12da19c2d
Merge or rebase uncommitted changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
861
diff
changeset
|
337 |
|
49e12da19c2d
Merge or rebase uncommitted changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
861
diff
changeset
|
338 |
$ hg diff > .diff # save local changes |
49e12da19c2d
Merge or rebase uncommitted changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
861
diff
changeset
|
339 |
$ hg revert -a |
49e12da19c2d
Merge or rebase uncommitted changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
861
diff
changeset
|
340 |
$ hg fetch |
49e12da19c2d
Merge or rebase uncommitted changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
861
diff
changeset
|
341 |
$ patch -p1 <.diff |
49e12da19c2d
Merge or rebase uncommitted changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
861
diff
changeset
|
342 |
|
49e12da19c2d
Merge or rebase uncommitted changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
861
diff
changeset
|
343 |
http://mercurial.selenic.com/wiki/TipsAndTricks#Merge_or_rebase_with_uncommitted_changes |
886 | 344 |
http://mercurial.selenic.com/wiki/ShelveExtension |
885
49e12da19c2d
Merge or rebase uncommitted changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
861
diff
changeset
|
345 |
|
894
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
346 |
* Hooks. |
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
347 |
|
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
348 |
** Check for bad branch names. |
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
349 |
|
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
350 |
.hg/hgcheck.py:: |
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
351 |
|
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
352 |
import re |
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
353 |
goodbranch_re = r'((bug|feature)#\d|release-1\.\d\.\d|default)$' |
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
354 |
def precommit_badbranchname(ui, repo, hooktype, **kwargs): |
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
355 |
ui.warn('"%s" hook failed\n' % hooktype) |
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
356 |
for rev in repo: |
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
357 |
branch = repo[rev].branch() |
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
358 |
re_ = re.compile(goodbranch_re) |
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
359 |
if not re_.match(branch): |
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
360 |
ui.warn('Invalid branch name "%s".\nUse one of default, bug#ID, feature#ID or release-1.XX.XX.\n' % branch) |
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
361 |
return True |
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
362 |
return False |
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
363 |
|
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
364 |
.hg/hgrc:: |
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
365 |
|
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
366 |
[hooks] |
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
367 |
precommit.badbranchname = python:.hg/hgcheck.py:precommit_badbranchname |
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
368 |
# precommit.gg = python:my.hgcheck.py.precommit_badbranch |
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
369 |
prechangegroup.badbranchname = python:.hg/hgcheck.py:precommit_badbranchname |
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
370 |
|
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
371 |
Read more: |
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
372 |
|
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
373 |
http://mercurial.selenic.com/wiki/HookExamples |
d7b21de5bb44
Check for bad branch names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
886
diff
changeset
|
374 |