5 echo "[diff]" >> $HGRCPATH |
5 echo "[diff]" >> $HGRCPATH |
6 echo "nodates=true" >> $HGRCPATH |
6 echo "nodates=true" >> $HGRCPATH |
7 |
7 |
8 |
8 |
9 catpatch() { |
9 catpatch() { |
10 cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /" |
10 cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /" \ |
|
11 -e "s/^\(# Parent \).*/\1/" |
11 } |
12 } |
12 |
13 |
13 catlog() { |
14 catlog() { |
14 catpatch $1 |
15 catpatch $1 |
15 hg log --template "{rev}: {desc} - {author}\n" |
16 hg log --template "{rev}: {desc} - {author}\n" |
23 drop() { |
24 drop() { |
24 hg qpop |
25 hg qpop |
25 hg qdel $1.patch |
26 hg qdel $1.patch |
26 } |
27 } |
27 |
28 |
28 |
29 runtest() { |
29 echo ==== init |
30 echo ==== init |
30 hg init a |
31 hg init a |
31 cd a |
32 cd a |
32 hg qinit |
33 hg qinit |
33 |
34 |
34 |
35 |
35 echo ==== qnew -d |
36 echo ==== qnew -d |
36 hg qnew -d '3 0' 1.patch |
37 hg qnew -d '3 0' 1.patch |
37 catlogd 1 |
38 catlogd 1 |
38 |
39 |
39 echo ==== qref |
40 echo ==== qref |
40 echo "1" >1 |
41 echo "1" >1 |
41 hg add |
42 hg add |
42 hg qref |
43 hg qref |
43 catlogd 1 |
44 catlogd 1 |
44 |
45 |
45 echo ==== qref -d |
46 echo ==== qref -d |
46 hg qref -d '4 0' |
47 hg qref -d '4 0' |
47 catlogd 1 |
48 catlogd 1 |
48 |
49 |
49 |
50 |
50 echo ==== qnew |
51 echo ==== qnew |
51 hg qnew 2.patch |
52 hg qnew 2.patch |
52 echo "2" >2 |
53 echo "2" >2 |
53 hg add |
54 hg add |
54 hg qref |
55 hg qref |
55 catlog 2 |
56 catlog 2 |
56 |
57 |
57 echo ==== qref -d |
58 echo ==== qref -d |
58 hg qref -d '5 0' |
59 hg qref -d '5 0' |
59 catlog 2 |
60 catlog 2 |
60 |
61 |
61 drop 2 |
62 drop 2 |
62 |
63 |
63 |
64 |
64 echo ==== qnew -d -m |
65 echo ==== qnew -d -m |
65 hg qnew -d '6 0' -m "Three" 3.patch |
66 hg qnew -d '6 0' -m "Three" 3.patch |
66 catlogd 3 |
67 catlogd 3 |
67 |
68 |
68 echo ==== qref |
69 echo ==== qref |
69 echo "3" >3 |
70 echo "3" >3 |
70 hg add |
71 hg add |
71 hg qref |
72 hg qref |
72 catlogd 3 |
73 catlogd 3 |
73 |
74 |
74 echo ==== qref -m |
75 echo ==== qref -m |
75 hg qref -m "Drei" |
76 hg qref -m "Drei" |
76 catlogd 3 |
77 catlogd 3 |
77 |
78 |
78 echo ==== qref -d |
79 echo ==== qref -d |
79 hg qref -d '7 0' |
80 hg qref -d '7 0' |
80 catlogd 3 |
81 catlogd 3 |
81 |
82 |
82 echo ==== qref -d -m |
83 echo ==== qref -d -m |
83 hg qref -d '8 0' -m "Three (again)" |
84 hg qref -d '8 0' -m "Three (again)" |
84 catlogd 3 |
85 catlogd 3 |
85 |
86 |
86 |
87 |
87 echo ==== qnew -m |
88 echo ==== qnew -m |
88 hg qnew -m "Four" 4.patch |
89 hg qnew -m "Four" 4.patch |
89 echo "4" >4 |
90 echo "4" >4 |
90 hg add |
91 hg add |
91 hg qref |
92 hg qref |
92 catlog 4 |
93 catlog 4 |
93 |
94 |
94 echo ==== qref -d |
95 echo ==== qref -d |
95 hg qref -d '9 0' |
96 hg qref -d '9 0' |
96 catlog 4 |
97 catlog 4 |
97 |
98 |
98 drop 4 |
99 drop 4 |
99 |
100 |
100 |
101 |
101 echo ==== qnew with HG header |
102 echo ==== qnew with HG header |
102 hg qnew 5.patch |
103 hg qnew --config 'mq.plain=true' 5.patch |
103 hg qpop |
104 hg qpop |
104 echo "# HG changeset patch" >>.hg/patches/5.patch |
105 echo "# HG changeset patch" >>.hg/patches/5.patch |
105 echo "# Date 10 0" >>.hg/patches/5.patch |
106 echo "# Date 10 0" >>.hg/patches/5.patch |
106 hg qpush 2>&1 | grep 'Now at' |
107 hg qpush 2>&1 | grep 'Now at' |
107 catlogd 5 |
108 catlogd 5 |
108 |
109 |
109 echo ==== hg qref |
110 echo ==== hg qref |
110 echo "5" >5 |
111 echo "5" >5 |
111 hg add |
112 hg add |
112 hg qref |
113 hg qref |
113 catlogd 5 |
114 catlogd 5 |
114 |
115 |
115 echo ==== hg qref -d |
116 echo ==== hg qref -d |
116 hg qref -d '11 0' |
117 hg qref -d '11 0' |
117 catlogd 5 |
118 catlogd 5 |
118 |
119 |
119 |
120 |
120 echo ==== qnew -u |
121 echo ==== qnew with plain header |
121 hg qnew -u jane 6.patch |
122 hg qnew --config 'mq.plain=true' -d '12 0' 6.patch |
122 echo "6" >6 |
123 hg qpop |
123 hg add |
124 hg qpush 2>&1 | grep 'now at' |
124 hg qref |
125 catlog 6 |
125 catlog 6 |
126 |
126 |
127 echo ==== hg qref |
127 echo ==== qref -d |
128 echo "6" >6 |
128 hg qref -d '12 0' |
129 hg add |
129 catlog 6 |
130 hg qref |
130 |
131 catlogd 6 |
131 drop 6 |
132 |
132 |
133 echo ==== hg qref -d |
133 |
134 hg qref -d '13 0' |
134 echo ==== qnew -d |
135 catlogd 6 |
135 hg qnew -d '13 0' 7.patch |
136 |
136 echo "7" >7 |
137 drop 6 |
137 hg add |
138 |
138 hg qref |
139 |
139 catlog 7 |
140 echo ==== qnew -u |
140 |
141 hg qnew -u jane 6.patch |
141 echo ==== qref -u |
142 echo "6" >6 |
142 hg qref -u john |
143 hg add |
143 catlogd 7 |
144 hg qref |
144 |
145 catlog 6 |
145 |
146 |
146 echo ==== qnew |
147 echo ==== qref -d |
147 hg qnew 8.patch |
148 hg qref -d '12 0' |
148 echo "8" >8 |
149 catlog 6 |
149 hg add |
150 |
150 hg qref |
151 drop 6 |
151 catlog 8 |
152 |
152 |
153 |
153 echo ==== qref -u -d |
154 echo ==== qnew -d |
154 hg qref -u john -d '14 0' |
155 hg qnew -d '13 0' 7.patch |
155 catlog 8 |
156 echo "7" >7 |
156 |
157 hg add |
157 drop 8 |
158 hg qref |
158 |
159 catlog 7 |
159 |
160 |
160 echo ==== qnew -m |
161 echo ==== qref -u |
161 hg qnew -m "Nine" 9.patch |
162 hg qref -u john |
162 echo "9" >9 |
163 catlogd 7 |
163 hg add |
164 |
164 hg qref |
165 |
165 catlog 9 |
166 echo ==== qnew |
166 |
167 hg qnew 8.patch |
167 echo ==== qref -u -d |
168 echo "8" >8 |
168 hg qref -u john -d '15 0' |
169 hg add |
169 catlog 9 |
170 hg qref |
170 |
171 catlog 8 |
171 drop 9 |
172 |
172 |
173 echo ==== qref -u -d |
173 |
174 hg qref -u john -d '14 0' |
174 echo ==== "qpop -a / qpush -a" |
175 catlog 8 |
175 hg qpop -a |
176 |
176 hg qpush -a |
177 drop 8 |
177 hg log --template "{rev}: {desc} - {author} - {date}\n" |
178 |
|
179 |
|
180 echo ==== qnew -m |
|
181 hg qnew -m "Nine" 9.patch |
|
182 echo "9" >9 |
|
183 hg add |
|
184 hg qref |
|
185 catlog 9 |
|
186 |
|
187 echo ==== qref -u -d |
|
188 hg qref -u john -d '15 0' |
|
189 catlog 9 |
|
190 |
|
191 drop 9 |
|
192 |
|
193 |
|
194 echo ==== "qpop -a / qpush -a" |
|
195 hg qpop -a |
|
196 hg qpush -a |
|
197 hg log --template "{rev}: {desc} - {author} - {date}\n" |
|
198 } |
|
199 |
|
200 |
|
201 echo ======= plain headers |
|
202 |
|
203 echo "[mq]" >> $HGRCPATH |
|
204 echo "plain=true" >> $HGRCPATH |
|
205 |
|
206 mkdir sandbox |
|
207 (cd sandbox ; runtest) |
|
208 rm -r sandbox |
|
209 |
|
210 |
|
211 echo ======= hg headers |
|
212 |
|
213 echo "plain=false" >> $HGRCPATH |
|
214 |
|
215 mkdir sandbox |
|
216 (cd sandbox ; runtest) |
|
217 rm -r sandbox |