Mercurial > hgbook
annotate en/examples/tour @ 826:a17d6390a480
More fixes to chapters 1 and 2.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Sun, 03 May 2009 20:27:09 -0700 |
parents | c8d662d3cb40 |
children | 477d6a3e5023 |
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 |
94 | 154 #$ name: merge.clone |
155 | |
156 cd .. | |
157 hg clone hello my-new-hello | |
158 cd my-new-hello | |
718 | 159 # The file new-hello.c is lightly edited. |
160 cp ../new-hello.c hello.c | |
94 | 161 hg commit -m 'A new hello for a new day.' |
162 | |
406 | 163 #$ name: merge.dummy2 |
164 | |
165 hg log -r 5 | grep changeset | cut -c 16-19 2>/dev/null > /tmp/REV5.my-new-hello | |
166 | |
826
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
824
diff
changeset
|
167 #$ name: merge.cat1 |
94 | 168 |
169 cat hello.c | |
826
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
824
diff
changeset
|
170 |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
824
diff
changeset
|
171 #$ name: merge.cat2 |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
824
diff
changeset
|
172 |
94 | 173 cat ../my-hello/hello.c |
174 | |
175 #$ name: merge.pull | |
176 | |
177 hg pull ../my-hello | |
178 | |
406 | 179 #$ name: merge.dummy3 |
180 | |
181 hg log -r 6 | grep changeset | cut -c 16-19 2>/dev/null > /tmp/REV6.my-new-hello | |
182 | |
94 | 183 #$ name: merge.heads |
184 | |
185 hg heads | |
186 | |
187 #$ name: merge.update | |
188 | |
189 hg update | |
190 | |
191 #$ name: merge.merge | |
192 | |
193 hg merge | |
194 | |
195 #$ name: merge.parents | |
196 | |
197 hg parents | |
198 cat hello.c | |
199 | |
200 #$ name: merge.commit | |
201 | |
202 hg commit -m 'Merged changes' | |
203 | |
406 | 204 #$ name: merge.dummy4 |
205 | |
206 hg log -r 7 | grep changeset | cut -c 16-19 2>/dev/null > /tmp/REV7.my-new-hello | |
207 | |
94 | 208 #$ name: merge.tip |
209 | |
210 hg tip |