author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Fri, 26 Feb 2010 23:45:00 +0200 | |
changeset 310 | 4af75f7ab947 |
parent 295 | d3f8534dadf9 |
child 311 | e3d3fd4c128b |
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 |
|
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
5 |
** Multiline log message for log command. |
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
6 |
|
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
7 |
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
|
8 |
|
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
9 |
$ hg log -v |
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
10 |
|
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
11 |
or put into ~/.hgrc: |
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
12 |
|
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
13 |
[defaults] |
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
14 |
log = -v |
4af75f7ab947
Multiline log message for log command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
295
diff
changeset
|
15 |
|
294 | 16 |
* Manage patches with MQ. |
17 |
||
18 |
First enable MQ, add following to your ~/.hgrc: |
|
19 |
||
20 |
[extensions] |
|
21 |
hgext.mq = |
|
22 |
||
23 |
Second get unpatched sources and put it to hg repository: |
|
24 |
||
25 |
$ tar zxf proj-x.y.z.tar.gz |
|
26 |
$ mv proj-x.y.z proj |
|
27 |
$ cd proj |
|
28 |
$ hg init |
|
29 |
$ hg ci -m "Added x.y.z version of proj." |
|
30 |
||
31 |
Init MQ and take name for first patch: |
|
32 |
||
33 |
$ hg qinit |
|
34 |
$ hg qnew first.patch |
|
35 |
||
36 |
Next make changes by editing source and save it to patch: |
|
37 |
||
38 |
$ $EDITOR file.c |
|
39 |
... |
|
40 |
$ hg diff |
|
41 |
... |
|
42 |
$ hg qrefresh |
|
43 |
$ hg diff # <-- have zero diff |
|
44 |
||
45 |
You can make second patch by applying existing one: |
|
46 |
||
47 |
$ hg qnew second.patch |
|
48 |
$ patch -p1 <bugfix.patch |
|
49 |
$ hg qrefresh |
|
50 |
||
51 |
You can take list of patches (from old to new) and revert or apply patches by |
|
52 |
qpop/qpush command: |
|
53 |
||
54 |
$ hg qseries # <-- what patches have |
|
55 |
first.patch |
|
56 |
second.patch |
|
57 |
$ hg qapplied # <-- what patches applied |
|
58 |
first.patch |
|
59 |
second.patch |
|
60 |
$ hg qpop |
|
61 |
$ hg qseries |
|
62 |
first.patch |
|
63 |
second.patch |
|
64 |
$ hg qapplied |
|
65 |
first.patch |
|
66 |
||
67 |
You can revert or apply all patches by single command: |
|
68 |
||
69 |
$ hg qpop -a |
|
70 |
$ hg qpush -a |
|
71 |
||
72 |
You can delete patch from patch list (before that you need de-apply patch): |
|
73 |
||
74 |
$ hg qpop -a |
|
75 |
$ hg qdelete first.patch |
|
76 |
||
77 |
To add new version of source and fix patches for it first de apply patches, |
|
78 |
then pull new changes and try apply patches on top of new sources: |
|
79 |
||
80 |
$ hg qpop -a |
|
81 |
$ rm * # .hg dir not deleted because its name start with dot |
|
82 |
$ cd .. |
|
83 |
$ tar zxf proj-a.b.c.tar.gz |
|
84 |
$ cp -R proj-a.b.c/* proj |
|
85 |
$ cd proj |
|
86 |
$ hg addremove -s 70 |
|
87 |
$ hg ci -m "Added a.b.c version of proj." |
|
88 |
$ hg qpush -a |
|
89 |
||
295
d3f8534dadf9
Applying series of patches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
294
diff
changeset
|
90 |
To apply series of already done patches use: |
d3f8534dadf9
Applying series of patches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
294
diff
changeset
|
91 |
|
d3f8534dadf9
Applying series of patches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
294
diff
changeset
|
92 |
$ ls /path/to/bugfixes/*.patch | xargs hg qimport |