Mercurial > hgbook
annotate en/examples/tour @ 714:c44d5854620b
Fix up chapter 1.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Tue, 31 Mar 2009 22:38:30 -0700 |
parents | fb5c0d56d7f1 |
children | 4e23c220d1b0 |
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 |
92 | 122 |
123 #$ name: clone-push | |
124 | |
125 cd .. | |
126 hg clone hello hello-push | |
127 | |
128 #$ name: outgoing | |
129 | |
130 cd my-hello | |
131 hg outgoing ../hello-push | |
132 | |
133 #$ name: push | |
134 | |
135 hg push ../hello-push | |
136 | |
137 #$ name: push.nothing | |
138 | |
139 hg push ../hello-push | |
93 | 140 |
141 #$ name: outgoing.net | |
142 | |
143 hg outgoing http://hg.serpentine.com/tutorial/hello | |
144 | |
145 #$ name: push.net | |
146 | |
147 hg push http://hg.serpentine.com/tutorial/hello | |
148 | |
94 | 149 #$ name: merge.clone |
150 | |
151 cd .. | |
152 hg clone hello my-new-hello | |
153 cd my-new-hello | |
154 sed -i '/printf/i\\tprintf("once more, hello.\\n");' hello.c | |
155 hg commit -m 'A new hello for a new day.' | |
156 | |
406 | 157 #$ name: merge.dummy2 |
158 | |
159 hg log -r 5 | grep changeset | cut -c 16-19 2>/dev/null > /tmp/REV5.my-new-hello | |
160 | |
94 | 161 #$ name: merge.cat |
162 | |
163 cat hello.c | |
164 cat ../my-hello/hello.c | |
165 | |
166 #$ name: merge.pull | |
167 | |
168 hg pull ../my-hello | |
169 | |
406 | 170 #$ name: merge.dummy3 |
171 | |
172 hg log -r 6 | grep changeset | cut -c 16-19 2>/dev/null > /tmp/REV6.my-new-hello | |
173 | |
94 | 174 #$ name: merge.heads |
175 | |
176 hg heads | |
177 | |
178 #$ name: merge.update | |
179 | |
180 hg update | |
181 | |
182 #$ name: merge.merge | |
183 | |
184 hg merge | |
185 | |
186 #$ name: merge.parents | |
187 | |
188 hg parents | |
189 cat hello.c | |
190 | |
191 #$ name: merge.commit | |
192 | |
193 hg commit -m 'Merged changes' | |
194 | |
406 | 195 #$ name: merge.dummy4 |
196 | |
197 hg log -r 7 | grep changeset | cut -c 16-19 2>/dev/null > /tmp/REV7.my-new-hello | |
198 | |
94 | 199 #$ name: merge.tip |
200 | |
201 hg tip |