Mercurial > hg
annotate tests/test-mq-header-from @ 6174:434139080ed4
Permit XML entities to be escaped in template output.
Useful for creating XML documents directly from Hg logging. Can also be used for
HTML. For use in content, will escape '&', '<', and for completeness '>'
(although it is not strictly necessary). For use in attributes, will also escape
' and ". Will also replace nonprinting (ASCII) control characters with spaces,
since these are illegal in XML.
author | Jesse Glick <jesse.glick@sun.com> |
---|---|
date | Mon, 28 Jan 2008 22:19:12 -0500 |
parents | 38b592536a58 |
children | fb32ae9c76e7 |
rev | line source |
---|---|
5673
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
1 #!/bin/sh |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
2 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
3 echo "[extensions]" >> $HGRCPATH |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
4 echo "mq=" >> $HGRCPATH |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
5 echo "[diff]" >> $HGRCPATH |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
6 echo "nodates=true" >> $HGRCPATH |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
7 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
8 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
9 catlog() { |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
10 cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /" |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
11 hg log --template "{rev}: {desc} - {author}\n" |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
12 } |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
13 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
14 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
15 echo ==== init |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
16 hg init a |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
17 cd a |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
18 hg qinit |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
19 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
20 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
21 echo ==== qnew -U |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
22 hg qnew -U 1.patch |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
23 catlog 1 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
24 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
25 echo ==== qref |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
26 echo "1" >1 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
27 hg add |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
28 hg qref |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
29 catlog 1 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
30 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
31 echo ==== qref -u |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
32 hg qref -u mary |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
33 catlog 1 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
34 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
35 echo ==== qnew |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
36 hg qnew 2.patch |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
37 echo "2" >2 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
38 hg add |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
39 hg qref |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
40 catlog 2 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
41 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
42 echo ==== qref -u |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
43 hg qref -u jane |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
44 catlog 2 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
45 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
46 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
47 echo ==== qnew -U -m |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
48 hg qnew -U -m "Three" 3.patch |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
49 catlog 3 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
50 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
51 echo ==== qref |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
52 echo "3" >3 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
53 hg add |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
54 hg qref |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
55 catlog 3 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
56 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
57 echo ==== qref -m |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
58 hg qref -m "Drei" |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
59 catlog 3 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
60 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
61 echo ==== qref -u |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
62 hg qref -u mary |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
63 catlog 3 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
64 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
65 echo ==== qref -u -m |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
66 hg qref -u maria -m "Three (again)" |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
67 catlog 3 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
68 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
69 echo ==== qnew -m |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
70 hg qnew -m "Four" 4.patch |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
71 echo "4" >4 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
72 hg add |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
73 hg qref |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
74 catlog 4 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
75 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
76 echo ==== qref -u |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
77 hg qref -u jane |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
78 catlog 4 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
79 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
80 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
81 echo ==== qnew with HG header |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
82 hg qnew 5.patch |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
83 hg qpop |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
84 echo "# HG changeset patch" >>.hg/patches/5.patch |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
85 echo "# User johndoe" >>.hg/patches/5.patch |
5822
38b592536a58
test-mq-header: don't fail with different patch(1)
Maxim Dounin <mdounin@mdounin.ru>
parents:
5673
diff
changeset
|
86 hg qpush 2>&1 | grep 'Now at' |
5673
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
87 catlog 5 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
88 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
89 echo ==== hg qref |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
90 echo "5" >5 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
91 hg add |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
92 hg qref |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
93 catlog 5 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
94 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
95 echo ==== hg qref -U |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
96 hg qref -U |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
97 catlog 5 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
98 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
99 echo ==== hg qref -u |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
100 hg qref -u johndeere |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
101 catlog 5 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
102 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
103 |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
104 echo ==== "qpop -a / qpush -a" |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
105 hg qpop -a |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
106 hg qpush -a |
dd3ce7515f4d
mq: add --currentuser and --user options to qnew and qrefresh
peter.arrenbrecht@gmail.com
parents:
diff
changeset
|
107 hg log --template "{rev}: {desc} - {author}\n" |