author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Sun, 26 Sep 2010 22:22:02 +0300 | |
changeset 583 | 9f32f2204d33 |
parent 425 | 8b7a3f47dac1 |
child 673 | faa365425ff0 |
permissions | -rw-r--r-- |
294 | 1 |
-*- mode: outline; coding: utf-8 -*- |
2 |
||
310
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
3 |
* Useful customization. |
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
4 |
|
313
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
5 |
Put to your ~/.hgrc: |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
6 |
|
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
7 |
[ui] |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
8 |
; Editor for editing commit message. |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
9 |
editor = gvim |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
10 |
; Who commit. |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
11 |
username = Oleksandr Gavenko <gavenkoa@gmail.com> |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
12 |
; Use internal merge algorithm, which mark conflict like <<<<<< ====== >>>>>>. |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
13 |
; 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
|
14 |
; resolved by running 'hg resolve -m <file>'. |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
15 |
merge = internal:merge |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
16 |
[web] |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
17 |
; Default encoding for file hosted by 'hg serv'. |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
18 |
encoding = utf-8 |
7cc6dcfa284e
Useful customization.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
312
diff
changeset
|
19 |
|
312 | 20 |
** Useful extension. |
21 |
||
22 |
Put to your ~/.hgrc: |
|
23 |
||
24 |
[extensions] |
|
25 |
; To allow fetch command. |
|
26 |
fetch = |
|
27 |
; To allow Mercurial Queues. |
|
28 |
hgext.mq = |
|
29 |
||
310
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
30 |
** Multiline log message for log command. |
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
31 |
|
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
32 |
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
|
33 |
|
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
34 |
$ hg log -v |
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
35 |
|
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
36 |
or put into ~/.hgrc: |
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
37 |
|
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
38 |
[defaults] |
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
39 |
log = -v |
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
40 |
|
311
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
41 |
** Follow history ever when file copied. |
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
42 |
|
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
43 |
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
|
44 |
before copying run: |
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
45 |
|
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
46 |
$ hg log -f |
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 |
or put into ~/.hgrc: |
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
49 |
|
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
50 |
[defaults] |
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
51 |
log = -f |
e3d3fd4c128b
Follow history ever when file copied.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
310
diff
changeset
|
52 |
|
294 | 53 |
* Manage patches with MQ. |
54 |
||
55 |
First enable MQ, add following to your ~/.hgrc: |
|
56 |
||
57 |
[extensions] |
|
58 |
hgext.mq = |
|
59 |
||
60 |
Second get unpatched sources and put it to hg repository: |
|
61 |
||
62 |
$ tar zxf proj-x.y.z.tar.gz |
|
63 |
$ mv proj-x.y.z proj |
|
64 |
$ cd proj |
|
65 |
$ hg init |
|
66 |
$ hg ci -m "Added x.y.z version of proj." |
|
67 |
||
68 |
Init MQ and take name for first patch: |
|
69 |
||
70 |
$ hg qinit |
|
71 |
$ hg qnew first.patch |
|
72 |
||
73 |
Next make changes by editing source and save it to patch: |
|
74 |
||
75 |
$ $EDITOR file.c |
|
76 |
... |
|
77 |
$ hg diff |
|
78 |
... |
|
79 |
$ hg qrefresh |
|
80 |
$ hg diff # <-- have zero diff |
|
81 |
||
82 |
You can make second patch by applying existing one: |
|
83 |
||
84 |
$ hg qnew second.patch |
|
85 |
$ patch -p1 <bugfix.patch |
|
86 |
$ hg qrefresh |
|
87 |
||
88 |
You can take list of patches (from old to new) and revert or apply patches by |
|
89 |
qpop/qpush command: |
|
90 |
||
91 |
$ hg qseries # <-- what patches have |
|
92 |
first.patch |
|
93 |
second.patch |
|
94 |
$ hg qapplied # <-- what patches applied |
|
95 |
first.patch |
|
96 |
second.patch |
|
97 |
$ hg qpop |
|
98 |
$ hg qseries |
|
99 |
first.patch |
|
100 |
second.patch |
|
101 |
$ hg qapplied |
|
102 |
first.patch |
|
103 |
||
104 |
You can revert or apply all patches by single command: |
|
105 |
||
106 |
$ hg qpop -a |
|
107 |
$ hg qpush -a |
|
108 |
||
109 |
You can delete patch from patch list (before that you need de-apply patch): |
|
110 |
||
111 |
$ hg qpop -a |
|
112 |
$ hg qdelete first.patch |
|
113 |
||
114 |
To add new version of source and fix patches for it first de apply patches, |
|
115 |
then pull new changes and try apply patches on top of new sources: |
|
116 |
||
117 |
$ hg qpop -a |
|
118 |
$ rm * # .hg dir not deleted because its name start with dot |
|
119 |
$ cd .. |
|
120 |
$ tar zxf proj-a.b.c.tar.gz |
|
121 |
$ cp -R proj-a.b.c/* proj |
|
122 |
$ cd proj |
|
123 |
$ hg addremove -s 70 |
|
124 |
$ hg ci -m "Added a.b.c version of proj." |
|
125 |
$ hg qpush -a |
|
126 |
||
295
d3f8534dadf9
Applying series of patches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
294
diff
changeset
|
127 |
To apply series of already done patches use: |
d3f8534dadf9
Applying series of patches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
294
diff
changeset
|
128 |
|
d3f8534dadf9
Applying series of patches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
294
diff
changeset
|
129 |
$ ls /path/to/bugfixes/*.patch | xargs hg qimport |
425
8b7a3f47dac1
Proxy settings for hg.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
313
diff
changeset
|
130 |
|
8b7a3f47dac1
Proxy settings for hg.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
313
diff
changeset
|
131 |
* Proxy. |
8b7a3f47dac1
Proxy settings for hg.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
313
diff
changeset
|
132 |
|
8b7a3f47dac1
Proxy settings for hg.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
313
diff
changeset
|
133 |
$ hg clone --config http_proxy.host=$host:$port \ |
8b7a3f47dac1
Proxy settings for hg.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
313
diff
changeset
|
134 |
--config http_proxy.user=$user --config http_proxy.passwd=$password $addr |