Mercurial > hgbook
annotate en/examples/template.simple @ 530:f809de31887a
more translation :D
added a term to the glossary
author | jerojasro@localhost |
---|---|
date | Sun, 30 Nov 2008 18:41:51 -0500 |
parents | ceaca14e49f0 |
children |
rev | line source |
---|---|
80
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
1 #!/bin/bash |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
2 |
139
ceaca14e49f0
Add local regexps to ignore bits of output.
Bryan O'Sullivan <bos@serpentine.com>
parents:
83
diff
changeset
|
3 # So many different bits of random output, it would be a nightmare to |
ceaca14e49f0
Add local regexps to ignore bits of output.
Bryan O'Sullivan <bos@serpentine.com>
parents:
83
diff
changeset
|
4 # ignore each individually. |
ceaca14e49f0
Add local regexps to ignore bits of output.
Bryan O'Sullivan <bos@serpentine.com>
parents:
83
diff
changeset
|
5 #$ ignore: .* |
ceaca14e49f0
Add local regexps to ignore bits of output.
Bryan O'Sullivan <bos@serpentine.com>
parents:
83
diff
changeset
|
6 |
80
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
7 hg init myrepo |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
8 cd myrepo |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
9 echo hello > hello |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
10 hg commit -Am'added hello' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
11 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
12 echo hello >> hello |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
13 echo goodbye > goodbye |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
14 echo ' added line to end of <<hello>> file.' > ../msg |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
15 echo '' >> ../msg |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
16 echo 'in addition, added a file with the helpful name (at least i hope that some might consider it so) of goodbye.' >> ../msg |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
17 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
18 hg commit -Al../msg |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
19 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
20 hg tag mytag |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
21 hg tag v0.1 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
22 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
23 #$ name: normal |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
24 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
25 hg log -r1 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
26 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
27 #$ name: compact |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
28 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
29 hg log --style compact |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
30 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
31 #$ name: changelog |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
32 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
33 hg log --style changelog |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
34 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
35 #$ name: simplest |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
36 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
37 hg log -r1 --template 'i saw a changeset\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
38 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
39 #$ name: simplesub |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
40 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
41 hg log --template 'i saw a changeset: {desc}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
42 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
43 #$ name: keywords |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
44 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
45 hg log -r1 --template 'author: {author}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
46 hg log -r1 --template 'desc:\n{desc}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
47 hg log -r1 --template 'files: {files}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
48 hg log -r1 --template 'file_adds: {file_adds}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
49 hg log -r1 --template 'file_dels: {file_dels}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
50 hg log -r1 --template 'node: {node}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
51 hg log -r1 --template 'parents: {parents}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
52 hg log -r1 --template 'rev: {rev}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
53 hg log -r1 --template 'tags: {tags}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
54 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
55 #$ name: datekeyword |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
56 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
57 hg log -r1 --template 'date: {date}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
58 hg log -r1 --template 'date: {date|isodate}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
59 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
60 #$ name: manyfilters |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
61 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
62 hg log -r1 --template '{author}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
63 hg log -r1 --template '{author|domain}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
64 hg log -r1 --template '{author|email}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
65 hg log -r1 --template '{author|obfuscate}\n' | cut -c-76 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
66 hg log -r1 --template '{author|person}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
67 hg log -r1 --template '{author|user}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
68 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
69 hg log -r1 --template 'looks almost right, but actually garbage: {date}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
70 hg log -r1 --template '{date|age}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
71 hg log -r1 --template '{date|date}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
72 hg log -r1 --template '{date|hgdate}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
73 hg log -r1 --template '{date|isodate}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
74 hg log -r1 --template '{date|rfc822date}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
75 hg log -r1 --template '{date|shortdate}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
76 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
77 hg log -r1 --template '{desc}\n' | cut -c-76 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
78 hg log -r1 --template '{desc|addbreaks}\n' | cut -c-76 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
79 hg log -r1 --template '{desc|escape}\n' | cut -c-76 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
80 hg log -r1 --template '{desc|fill68}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
81 hg log -r1 --template '{desc|fill76}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
82 hg log -r1 --template '{desc|firstline}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
83 hg log -r1 --template '{desc|strip}\n' | cut -c-76 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
84 hg log -r1 --template '{desc|tabindent}\n' | expand | cut -c-76 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
85 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
86 hg log -r1 --template '{node}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
87 hg log -r1 --template '{node|short}\n' |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
88 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
89 #$ name: combine |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
90 |
ea951cfb5cd9
Much template-related content.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
91 hg log -r1 --template 'description:\n\t{desc|strip|fill68|tabindent}\n' |
83
b476081a9c04
Much progress in template chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
80
diff
changeset
|
92 |
b476081a9c04
Much progress in template chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
80
diff
changeset
|
93 #$ name: rev |
b476081a9c04
Much progress in template chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
80
diff
changeset
|
94 |
b476081a9c04
Much progress in template chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
80
diff
changeset
|
95 echo 'changeset = "rev: {rev}\n"' > rev |
b476081a9c04
Much progress in template chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
80
diff
changeset
|
96 hg log -l1 --style ./rev |