Mercurial > hgbook
annotate ja/examples/tour @ 834:896ab6eaf1c6
merged
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Fri, 10 Jul 2009 02:32:17 +0900 |
parents | en/examples/tour@477d6a3e5023 en/examples/tour@019040fbf5f5 |
children |
rev | line source |
---|---|
87 | 1 #!/bin/bash |
2 | |
3 #$ name: version | |
4 | |
5 hg version | |
6 | |
7 #$ name: help | |
8 | |
9 hg help init | |
10 | |
11 #$ name: clone | |
12 | |
13 hg clone http://hg.serpentine.com/tutorial/hello | |
14 | |
15 #$ name: ls | |
139
ceaca14e49f0
Add local regexps to ignore bits of output.
Bryan O'Sullivan <bos@serpentine.com>
parents:
102
diff
changeset
|
16 #$ ignore: ^drwx.* |
174
ef6a1427d0af
Update tour info more usefully.
Bryan O'Sullivan <bos@serpentine.com>
parents:
139
diff
changeset
|
17 #$ ignore: ^total \d+ |
87 | 18 |
19 ls -l | |
20 ls hello | |
88
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
21 |
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
22 #$ name: ls-a |
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
23 |
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
24 cd hello |
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
25 ls -a |
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
26 |
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
27 #$ name: log |
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
28 |
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
29 hg log |
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
30 |
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
31 #$ name: log-r |
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
32 |
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
33 hg log -r 3 |
406 | 34 hg log -r 0272e0d5a517 |
88
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
35 hg log -r 1 -r 4 |
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
36 |
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
37 #$ name: log.range |
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
38 |
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
39 hg log -r 2:4 |
91 | 40 |
41 #$ name: log-v | |
42 | |
43 hg log -v -r 3 | |
44 | |
45 #$ name: log-vp | |
46 | |
47 hg log -v -p -r 2 | |
48 | |
49 #$ name: reclone | |
50 | |
51 cd .. | |
52 hg clone hello my-hello | |
53 cd my-hello | |
54 | |
714 | 55 #$ name: cat1 |
56 cat hello.c | |
57 | |
58 #$ name: | |
91 | 59 |
60 sed -i '/printf/a\\tprintf("hello again!\\n");' hello.c | |
61 | |
714 | 62 #$ name: cat2 |
63 # ... edit edit edit ... | |
64 cat hello.c | |
65 | |
91 | 66 #$ name: status |
67 | |
68 ls | |
69 hg status | |
70 | |
71 #$ name: diff | |
72 | |
73 hg diff | |
74 | |
75 #$ name: | |
76 | |
77 export HGEDITOR='echo Added an extra line of output >' | |
78 | |
79 #$ name: commit | |
80 | |
81 hg commit | |
82 | |
406 | 83 #$ name: merge.dummy1 |
84 | |
85 hg log -r 5 | grep changeset | cut -c 16-19 2>/dev/null > /tmp/REV5.my-hello | |
86 | |
91 | 87 #$ name: tip |
88 | |
89 hg tip -vp | |
90 | |
91 #$ name: clone-pull | |
92 | |
93 cd .. | |
94 hg clone hello hello-pull | |
95 | |
96 #$ name: incoming | |
97 | |
98 cd hello-pull | |
99 hg incoming ../my-hello | |
100 | |
101 #$ name: pull | |
102 | |
103 hg tip | |
104 hg pull ../my-hello | |
105 hg tip | |
106 | |
107 #$ name: update | |
108 | |
109 grep printf hello.c | |
110 hg update tip | |
111 grep printf hello.c | |
112 | |
113 #$ name: parents | |
114 | |
115 hg parents | |
116 | |
117 #$ name: older | |
118 | |
119 hg update 2 | |
120 hg parents | |
94 | 121 hg update |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
718
diff
changeset
|
122 hg parents |
92 | 123 |
124 #$ name: clone-push | |
125 | |
126 cd .. | |
127 hg clone hello hello-push | |
128 | |
129 #$ name: outgoing | |
130 | |
131 cd my-hello | |
132 hg outgoing ../hello-push | |
133 | |
134 #$ name: push | |
135 | |
136 hg push ../hello-push | |
137 | |
138 #$ name: push.nothing | |
139 | |
140 hg push ../hello-push | |
93 | 141 |
142 #$ name: outgoing.net | |
143 | |
144 hg outgoing http://hg.serpentine.com/tutorial/hello | |
145 | |
146 #$ name: push.net | |
147 | |
148 hg push http://hg.serpentine.com/tutorial/hello | |
149 | |
718 | 150 #$ name: |
151 cp hello.c ../new-hello.c | |
826
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
824
diff
changeset
|
152 sed -i '/printf("hello,/i\\tprintf("once more, hello.\\n");' ../new-hello.c |
718 | 153 |
828 | 154 my-text-editor() |
155 { | |
156 cp ../new-hello.c hello.c | |
157 } | |
718 | 158 |
94 | 159 #$ name: merge.clone |
160 | |
161 cd .. | |
162 hg clone hello my-new-hello | |
163 cd my-new-hello | |
828 | 164 # Make some simple edits to hello.c. |
165 my-text-editor hello.c | |
94 | 166 hg commit -m 'A new hello for a new day.' |
167 | |
406 | 168 #$ name: merge.dummy2 |
169 | |
170 hg log -r 5 | grep changeset | cut -c 16-19 2>/dev/null > /tmp/REV5.my-new-hello | |
171 | |
826
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
824
diff
changeset
|
172 #$ name: merge.cat1 |
94 | 173 |
174 cat hello.c | |
826
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
824
diff
changeset
|
175 |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
824
diff
changeset
|
176 #$ name: merge.cat2 |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
824
diff
changeset
|
177 |
94 | 178 cat ../my-hello/hello.c |
179 | |
180 #$ name: merge.pull | |
181 | |
182 hg pull ../my-hello | |
183 | |
406 | 184 #$ name: merge.dummy3 |
185 | |
186 hg log -r 6 | grep changeset | cut -c 16-19 2>/dev/null > /tmp/REV6.my-new-hello | |
187 | |
94 | 188 #$ name: merge.heads |
189 | |
190 hg heads | |
191 | |
192 #$ name: merge.update | |
193 | |
194 hg update | |
195 | |
196 #$ name: merge.merge | |
197 | |
198 hg merge | |
199 | |
200 #$ name: merge.parents | |
201 | |
202 hg parents | |
203 cat hello.c | |
204 | |
205 #$ name: merge.commit | |
206 | |
207 hg commit -m 'Merged changes' | |
208 | |
406 | 209 #$ name: merge.dummy4 |
210 | |
211 hg log -r 7 | grep changeset | cut -c 16-19 2>/dev/null > /tmp/REV7.my-new-hello | |
212 | |
94 | 213 #$ name: merge.tip |
214 | |
215 hg tip |