Show More
@@ -1,527 +1,527 b'' | |||||
1 | test-abort-checkin.t |
|
1 | test-abort-checkin.t | |
2 | test-add.t |
|
2 | test-add.t | |
3 | test-addremove-similar.t |
|
3 | test-addremove-similar.t | |
4 | test-addremove.t |
|
4 | test-addremove.t | |
5 | test-amend-subrepo.t |
|
5 | test-amend-subrepo.t | |
6 | test-amend.t |
|
6 | test-amend.t | |
7 | test-ancestor.py |
|
7 | test-ancestor.py | |
8 | test-annotate.py |
|
8 | test-annotate.py | |
9 | test-annotate.t |
|
9 | test-annotate.t | |
10 | test-archive-symlinks.t |
|
10 | test-archive-symlinks.t | |
11 | test-atomictempfile.py |
|
11 | test-atomictempfile.py | |
12 | test-audit-path.t |
|
12 | test-audit-path.t | |
13 | test-audit-subrepo.t |
|
13 | test-audit-subrepo.t | |
14 | test-automv.t |
|
14 | test-automv.t | |
15 | test-backout.t |
|
15 | test-backout.t | |
16 | test-backwards-remove.t |
|
16 | test-backwards-remove.t | |
17 | test-basic.t |
|
17 | test-basic.t | |
18 | test-bheads.t |
|
18 | test-bheads.t | |
19 | test-bisect.t |
|
19 | test-bisect.t | |
20 | test-bisect2.t |
|
20 | test-bisect2.t | |
21 | test-bisect3.t |
|
21 | test-bisect3.t | |
22 | test-blackbox.t |
|
22 | test-blackbox.t | |
23 | test-bookmarks-current.t |
|
23 | test-bookmarks-current.t | |
24 | test-bookmarks-merge.t |
|
24 | test-bookmarks-merge.t | |
25 | test-bookmarks-rebase.t |
|
25 | test-bookmarks-rebase.t | |
26 | test-bookmarks-strip.t |
|
26 | test-bookmarks-strip.t | |
27 | test-bookmarks.t |
|
27 | test-bookmarks.t | |
28 | test-branch-change.t |
|
28 | test-branch-change.t | |
29 | test-branch-option.t |
|
29 | test-branch-option.t | |
30 | test-branch-tag-confict.t |
|
30 | test-branch-tag-confict.t | |
31 | test-branches.t |
|
31 | test-branches.t | |
32 | test-bundle-phases.t |
|
32 | test-bundle-phases.t | |
33 | test-bundle-type.t |
|
33 | test-bundle-type.t | |
34 | test-bundle-vs-outgoing.t |
|
34 | test-bundle-vs-outgoing.t | |
35 | test-bundle2-multiple-changegroups.t |
|
35 | test-bundle2-multiple-changegroups.t | |
36 | test-cappedreader.py |
|
36 | test-cappedreader.py | |
37 | test-casecollision.t |
|
37 | test-casecollision.t | |
38 | test-cat.t |
|
38 | test-cat.t | |
39 | test-cbor.py |
|
39 | test-cbor.py | |
40 | test-censor.t |
|
40 | test-censor.t | |
41 | test-changelog-exec.t |
|
41 | test-changelog-exec.t | |
42 | test-check-commit.t |
|
42 | test-check-commit.t | |
43 | test-check-execute.t |
|
43 | test-check-execute.t | |
44 | test-check-interfaces.py |
|
44 | test-check-interfaces.py | |
45 | test-check-module-imports.t |
|
45 | test-check-module-imports.t | |
46 | test-check-pyflakes.t |
|
46 | test-check-pyflakes.t | |
47 | test-check-pylint.t |
|
47 | test-check-pylint.t | |
48 | test-check-shbang.t |
|
48 | test-check-shbang.t | |
49 | test-children.t |
|
49 | test-children.t | |
50 | test-clone-cgi.t |
|
50 | test-clone-cgi.t | |
51 | test-clone-pull-corruption.t |
|
51 | test-clone-pull-corruption.t | |
52 | test-clone-r.t |
|
52 | test-clone-r.t | |
53 | test-clone-update-order.t |
|
53 | test-clone-update-order.t | |
54 | test-command-template.t |
|
|||
55 | test-commit-amend.t |
|
54 | test-commit-amend.t | |
56 | test-commit-interactive.t |
|
55 | test-commit-interactive.t | |
57 | test-commit-multiple.t |
|
56 | test-commit-multiple.t | |
58 | test-commit-unresolved.t |
|
57 | test-commit-unresolved.t | |
59 | test-commit.t |
|
58 | test-commit.t | |
60 | test-committer.t |
|
59 | test-committer.t | |
61 | test-completion.t |
|
60 | test-completion.t | |
62 | test-config-env.py |
|
61 | test-config-env.py | |
63 | test-config.t |
|
62 | test-config.t | |
64 | test-conflict.t |
|
63 | test-conflict.t | |
65 | test-confused-revert.t |
|
64 | test-confused-revert.t | |
66 | test-context.py |
|
65 | test-context.py | |
67 | test-contrib-check-code.t |
|
66 | test-contrib-check-code.t | |
68 | test-contrib-check-commit.t |
|
67 | test-contrib-check-commit.t | |
69 | test-convert-authormap.t |
|
68 | test-convert-authormap.t | |
70 | test-convert-clonebranches.t |
|
69 | test-convert-clonebranches.t | |
71 | test-convert-cvs-branch.t |
|
70 | test-convert-cvs-branch.t | |
72 | test-convert-cvs-detectmerge.t |
|
71 | test-convert-cvs-detectmerge.t | |
73 | test-convert-cvs-synthetic.t |
|
72 | test-convert-cvs-synthetic.t | |
74 | test-convert-cvs.t |
|
73 | test-convert-cvs.t | |
75 | test-convert-cvsnt-mergepoints.t |
|
74 | test-convert-cvsnt-mergepoints.t | |
76 | test-convert-datesort.t |
|
75 | test-convert-datesort.t | |
77 | test-convert-filemap.t |
|
76 | test-convert-filemap.t | |
78 | test-convert-hg-sink.t |
|
77 | test-convert-hg-sink.t | |
79 | test-convert-hg-source.t |
|
78 | test-convert-hg-source.t | |
80 | test-convert-hg-startrev.t |
|
79 | test-convert-hg-startrev.t | |
81 | test-convert-splicemap.t |
|
80 | test-convert-splicemap.t | |
82 | test-convert-tagsbranch-topology.t |
|
81 | test-convert-tagsbranch-topology.t | |
83 | test-copy-move-merge.t |
|
82 | test-copy-move-merge.t | |
84 | test-copy.t |
|
83 | test-copy.t | |
85 | test-copytrace-heuristics.t |
|
84 | test-copytrace-heuristics.t | |
86 | test-debugbuilddag.t |
|
85 | test-debugbuilddag.t | |
87 | test-debugbundle.t |
|
86 | test-debugbundle.t | |
88 | test-debugextensions.t |
|
87 | test-debugextensions.t | |
89 | test-debugindexdot.t |
|
88 | test-debugindexdot.t | |
90 | test-debugrename.t |
|
89 | test-debugrename.t | |
91 | test-default-push.t |
|
90 | test-default-push.t | |
92 | test-diff-binary-file.t |
|
91 | test-diff-binary-file.t | |
93 | test-diff-change.t |
|
92 | test-diff-change.t | |
94 | test-diff-copy-depth.t |
|
93 | test-diff-copy-depth.t | |
95 | test-diff-hashes.t |
|
94 | test-diff-hashes.t | |
96 | test-diff-ignore-whitespace.t |
|
95 | test-diff-ignore-whitespace.t | |
97 | test-diff-indent-heuristic.t |
|
96 | test-diff-indent-heuristic.t | |
98 | test-diff-issue2761.t |
|
97 | test-diff-issue2761.t | |
99 | test-diff-newlines.t |
|
98 | test-diff-newlines.t | |
100 | test-diff-reverse.t |
|
99 | test-diff-reverse.t | |
101 | test-diff-subdir.t |
|
100 | test-diff-subdir.t | |
102 | test-diff-unified.t |
|
101 | test-diff-unified.t | |
103 | test-diff-upgrade.t |
|
102 | test-diff-upgrade.t | |
104 | test-diffdir.t |
|
103 | test-diffdir.t | |
105 | test-diffstat.t |
|
104 | test-diffstat.t | |
106 | test-directaccess.t |
|
105 | test-directaccess.t | |
107 | test-dirstate-backup.t |
|
106 | test-dirstate-backup.t | |
108 | test-dirstate-nonnormalset.t |
|
107 | test-dirstate-nonnormalset.t | |
109 | test-dirstate.t |
|
108 | test-dirstate.t | |
110 | test-dispatch.py |
|
109 | test-dispatch.py | |
111 | test-doctest.py |
|
110 | test-doctest.py | |
112 | test-double-merge.t |
|
111 | test-double-merge.t | |
113 | test-drawdag.t |
|
112 | test-drawdag.t | |
114 | test-duplicateoptions.py |
|
113 | test-duplicateoptions.py | |
115 | test-editor-filename.t |
|
114 | test-editor-filename.t | |
116 | test-empty-dir.t |
|
115 | test-empty-dir.t | |
117 | test-empty-file.t |
|
116 | test-empty-file.t | |
118 | test-empty-group.t |
|
117 | test-empty-group.t | |
119 | test-empty.t |
|
118 | test-empty.t | |
120 | test-encode.t |
|
119 | test-encode.t | |
121 | test-encoding-func.py |
|
120 | test-encoding-func.py | |
122 | test-encoding.t |
|
121 | test-encoding.t | |
123 | test-eol-add.t |
|
122 | test-eol-add.t | |
124 | test-eol-clone.t |
|
123 | test-eol-clone.t | |
125 | test-eol-hook.t |
|
124 | test-eol-hook.t | |
126 | test-eol-patch.t |
|
125 | test-eol-patch.t | |
127 | test-eol-tag.t |
|
126 | test-eol-tag.t | |
128 | test-eol-update.t |
|
127 | test-eol-update.t | |
129 | test-eol.t |
|
128 | test-eol.t | |
130 | test-eolfilename.t |
|
129 | test-eolfilename.t | |
131 | test-excessive-merge.t |
|
130 | test-excessive-merge.t | |
132 | test-exchange-obsmarkers-case-A1.t |
|
131 | test-exchange-obsmarkers-case-A1.t | |
133 | test-exchange-obsmarkers-case-A2.t |
|
132 | test-exchange-obsmarkers-case-A2.t | |
134 | test-exchange-obsmarkers-case-A3.t |
|
133 | test-exchange-obsmarkers-case-A3.t | |
135 | test-exchange-obsmarkers-case-A4.t |
|
134 | test-exchange-obsmarkers-case-A4.t | |
136 | test-exchange-obsmarkers-case-A5.t |
|
135 | test-exchange-obsmarkers-case-A5.t | |
137 | test-exchange-obsmarkers-case-A6.t |
|
136 | test-exchange-obsmarkers-case-A6.t | |
138 | test-exchange-obsmarkers-case-A7.t |
|
137 | test-exchange-obsmarkers-case-A7.t | |
139 | test-exchange-obsmarkers-case-B1.t |
|
138 | test-exchange-obsmarkers-case-B1.t | |
140 | test-exchange-obsmarkers-case-B2.t |
|
139 | test-exchange-obsmarkers-case-B2.t | |
141 | test-exchange-obsmarkers-case-B3.t |
|
140 | test-exchange-obsmarkers-case-B3.t | |
142 | test-exchange-obsmarkers-case-B4.t |
|
141 | test-exchange-obsmarkers-case-B4.t | |
143 | test-exchange-obsmarkers-case-B5.t |
|
142 | test-exchange-obsmarkers-case-B5.t | |
144 | test-exchange-obsmarkers-case-B6.t |
|
143 | test-exchange-obsmarkers-case-B6.t | |
145 | test-exchange-obsmarkers-case-B7.t |
|
144 | test-exchange-obsmarkers-case-B7.t | |
146 | test-exchange-obsmarkers-case-C1.t |
|
145 | test-exchange-obsmarkers-case-C1.t | |
147 | test-exchange-obsmarkers-case-C2.t |
|
146 | test-exchange-obsmarkers-case-C2.t | |
148 | test-exchange-obsmarkers-case-C3.t |
|
147 | test-exchange-obsmarkers-case-C3.t | |
149 | test-exchange-obsmarkers-case-C4.t |
|
148 | test-exchange-obsmarkers-case-C4.t | |
150 | test-exchange-obsmarkers-case-D1.t |
|
149 | test-exchange-obsmarkers-case-D1.t | |
151 | test-exchange-obsmarkers-case-D2.t |
|
150 | test-exchange-obsmarkers-case-D2.t | |
152 | test-exchange-obsmarkers-case-D3.t |
|
151 | test-exchange-obsmarkers-case-D3.t | |
153 | test-exchange-obsmarkers-case-D4.t |
|
152 | test-exchange-obsmarkers-case-D4.t | |
154 | test-execute-bit.t |
|
153 | test-execute-bit.t | |
155 | test-export.t |
|
154 | test-export.t | |
156 | test-extdata.t |
|
155 | test-extdata.t | |
157 | test-extdiff.t |
|
156 | test-extdiff.t | |
158 | test-extensions-afterloaded.t |
|
157 | test-extensions-afterloaded.t | |
159 | test-extensions-wrapfunction.py |
|
158 | test-extensions-wrapfunction.py | |
160 | test-extra-filelog-entry.t |
|
159 | test-extra-filelog-entry.t | |
161 | test-fetch.t |
|
160 | test-fetch.t | |
162 | test-filebranch.t |
|
161 | test-filebranch.t | |
163 | test-filecache.py |
|
162 | test-filecache.py | |
164 | test-filelog.py |
|
163 | test-filelog.py | |
165 | test-fileset-generated.t |
|
164 | test-fileset-generated.t | |
166 | test-fileset.t |
|
165 | test-fileset.t | |
167 | test-fix-topology.t |
|
166 | test-fix-topology.t | |
168 | test-flags.t |
|
167 | test-flags.t | |
169 | test-generaldelta.t |
|
168 | test-generaldelta.t | |
170 | test-getbundle.t |
|
169 | test-getbundle.t | |
171 | test-git-export.t |
|
170 | test-git-export.t | |
172 | test-glog-topological.t |
|
171 | test-glog-topological.t | |
173 | test-gpg.t |
|
172 | test-gpg.t | |
174 | test-graft.t |
|
173 | test-graft.t | |
175 | test-hg-parseurl.py |
|
174 | test-hg-parseurl.py | |
176 | test-hghave.t |
|
175 | test-hghave.t | |
177 | test-hgignore.t |
|
176 | test-hgignore.t | |
178 | test-hgk.t |
|
177 | test-hgk.t | |
179 | test-hgrc.t |
|
178 | test-hgrc.t | |
180 | test-hgweb-bundle.t |
|
179 | test-hgweb-bundle.t | |
181 | test-hgweb-descend-empties.t |
|
180 | test-hgweb-descend-empties.t | |
182 | test-hgweb-empty.t |
|
181 | test-hgweb-empty.t | |
183 | test-hgweb-removed.t |
|
182 | test-hgweb-removed.t | |
184 | test-hgwebdir-paths.py |
|
183 | test-hgwebdir-paths.py | |
185 | test-hgwebdirsym.t |
|
184 | test-hgwebdirsym.t | |
186 | test-histedit-arguments.t |
|
185 | test-histedit-arguments.t | |
187 | test-histedit-base.t |
|
186 | test-histedit-base.t | |
188 | test-histedit-bookmark-motion.t |
|
187 | test-histedit-bookmark-motion.t | |
189 | test-histedit-commute.t |
|
188 | test-histedit-commute.t | |
190 | test-histedit-drop.t |
|
189 | test-histedit-drop.t | |
191 | test-histedit-edit.t |
|
190 | test-histedit-edit.t | |
192 | test-histedit-fold-non-commute.t |
|
191 | test-histedit-fold-non-commute.t | |
193 | test-histedit-fold.t |
|
192 | test-histedit-fold.t | |
194 | test-histedit-no-change.t |
|
193 | test-histedit-no-change.t | |
195 | test-histedit-non-commute-abort.t |
|
194 | test-histedit-non-commute-abort.t | |
196 | test-histedit-non-commute.t |
|
195 | test-histedit-non-commute.t | |
197 | test-histedit-obsolete.t |
|
196 | test-histedit-obsolete.t | |
198 | test-histedit-outgoing.t |
|
197 | test-histedit-outgoing.t | |
199 | test-histedit-templates.t |
|
198 | test-histedit-templates.t | |
200 | test-http-branchmap.t |
|
199 | test-http-branchmap.t | |
201 | test-http-bundle1.t |
|
200 | test-http-bundle1.t | |
202 | test-http-clone-r.t |
|
201 | test-http-clone-r.t | |
203 | test-http.t |
|
202 | test-http.t | |
204 | test-hybridencode.py |
|
203 | test-hybridencode.py | |
205 | test-identify.t |
|
204 | test-identify.t | |
206 | test-impexp-branch.t |
|
205 | test-impexp-branch.t | |
207 | test-import-bypass.t |
|
206 | test-import-bypass.t | |
208 | test-import-eol.t |
|
207 | test-import-eol.t | |
209 | test-import-merge.t |
|
208 | test-import-merge.t | |
210 | test-import-unknown.t |
|
209 | test-import-unknown.t | |
211 | test-import.t |
|
210 | test-import.t | |
212 | test-imports-checker.t |
|
211 | test-imports-checker.t | |
213 | test-incoming-outgoing.t |
|
212 | test-incoming-outgoing.t | |
214 | test-inherit-mode.t |
|
213 | test-inherit-mode.t | |
215 | test-init.t |
|
214 | test-init.t | |
216 | test-issue1089.t |
|
215 | test-issue1089.t | |
217 | test-issue1102.t |
|
216 | test-issue1102.t | |
218 | test-issue1175.t |
|
217 | test-issue1175.t | |
219 | test-issue1306.t |
|
218 | test-issue1306.t | |
220 | test-issue1438.t |
|
219 | test-issue1438.t | |
221 | test-issue1502.t |
|
220 | test-issue1502.t | |
222 | test-issue1802.t |
|
221 | test-issue1802.t | |
223 | test-issue1877.t |
|
222 | test-issue1877.t | |
224 | test-issue1993.t |
|
223 | test-issue1993.t | |
225 | test-issue2137.t |
|
224 | test-issue2137.t | |
226 | test-issue3084.t |
|
225 | test-issue3084.t | |
227 | test-issue4074.t |
|
226 | test-issue4074.t | |
228 | test-issue522.t |
|
227 | test-issue522.t | |
229 | test-issue586.t |
|
228 | test-issue586.t | |
230 | test-issue612.t |
|
229 | test-issue612.t | |
231 | test-issue619.t |
|
230 | test-issue619.t | |
232 | test-issue660.t |
|
231 | test-issue660.t | |
233 | test-issue672.t |
|
232 | test-issue672.t | |
234 | test-issue842.t |
|
233 | test-issue842.t | |
235 | test-journal-exists.t |
|
234 | test-journal-exists.t | |
236 | test-journal-share.t |
|
235 | test-journal-share.t | |
237 | test-journal.t |
|
236 | test-journal.t | |
238 | test-known.t |
|
237 | test-known.t | |
239 | test-largefiles-cache.t |
|
238 | test-largefiles-cache.t | |
240 | test-largefiles-misc.t |
|
239 | test-largefiles-misc.t | |
241 | test-largefiles-small-disk.t |
|
240 | test-largefiles-small-disk.t | |
242 | test-largefiles-update.t |
|
241 | test-largefiles-update.t | |
243 | test-largefiles.t |
|
242 | test-largefiles.t | |
244 | test-lfs-largefiles.t |
|
243 | test-lfs-largefiles.t | |
245 | test-lfs-pointer.py |
|
244 | test-lfs-pointer.py | |
246 | test-linerange.py |
|
245 | test-linerange.py | |
247 | test-locate.t |
|
246 | test-locate.t | |
248 | test-lock-badness.t |
|
247 | test-lock-badness.t | |
249 | test-log-linerange.t |
|
248 | test-log-linerange.t | |
250 | test-log.t |
|
249 | test-log.t | |
251 | test-logexchange.t |
|
250 | test-logexchange.t | |
252 | test-lrucachedict.py |
|
251 | test-lrucachedict.py | |
253 | test-mactext.t |
|
252 | test-mactext.t | |
254 | test-mailmap.t |
|
253 | test-mailmap.t | |
255 | test-manifest-merging.t |
|
254 | test-manifest-merging.t | |
256 | test-manifest.py |
|
255 | test-manifest.py | |
257 | test-manifest.t |
|
256 | test-manifest.t | |
258 | test-match.py |
|
257 | test-match.py | |
259 | test-mdiff.py |
|
258 | test-mdiff.py | |
260 | test-merge-changedelete.t |
|
259 | test-merge-changedelete.t | |
261 | test-merge-closedheads.t |
|
260 | test-merge-closedheads.t | |
262 | test-merge-commit.t |
|
261 | test-merge-commit.t | |
263 | test-merge-criss-cross.t |
|
262 | test-merge-criss-cross.t | |
264 | test-merge-default.t |
|
263 | test-merge-default.t | |
265 | test-merge-force.t |
|
264 | test-merge-force.t | |
266 | test-merge-halt.t |
|
265 | test-merge-halt.t | |
267 | test-merge-internal-tools-pattern.t |
|
266 | test-merge-internal-tools-pattern.t | |
268 | test-merge-local.t |
|
267 | test-merge-local.t | |
269 | test-merge-remove.t |
|
268 | test-merge-remove.t | |
270 | test-merge-revert.t |
|
269 | test-merge-revert.t | |
271 | test-merge-revert2.t |
|
270 | test-merge-revert2.t | |
272 | test-merge-subrepos.t |
|
271 | test-merge-subrepos.t | |
273 | test-merge-symlinks.t |
|
272 | test-merge-symlinks.t | |
274 | test-merge-tools.t |
|
273 | test-merge-tools.t | |
275 | test-merge-types.t |
|
274 | test-merge-types.t | |
276 | test-merge1.t |
|
275 | test-merge1.t | |
277 | test-merge10.t |
|
276 | test-merge10.t | |
278 | test-merge2.t |
|
277 | test-merge2.t | |
279 | test-merge4.t |
|
278 | test-merge4.t | |
280 | test-merge5.t |
|
279 | test-merge5.t | |
281 | test-merge6.t |
|
280 | test-merge6.t | |
282 | test-merge7.t |
|
281 | test-merge7.t | |
283 | test-merge8.t |
|
282 | test-merge8.t | |
284 | test-merge9.t |
|
283 | test-merge9.t | |
285 | test-minifileset.py |
|
284 | test-minifileset.py | |
286 | test-minirst.py |
|
285 | test-minirst.py | |
287 | test-mq-git.t |
|
286 | test-mq-git.t | |
288 | test-mq-header-date.t |
|
287 | test-mq-header-date.t | |
289 | test-mq-header-from.t |
|
288 | test-mq-header-from.t | |
290 | test-mq-merge.t |
|
289 | test-mq-merge.t | |
291 | test-mq-pull-from-bundle.t |
|
290 | test-mq-pull-from-bundle.t | |
292 | test-mq-qclone-http.t |
|
291 | test-mq-qclone-http.t | |
293 | test-mq-qdelete.t |
|
292 | test-mq-qdelete.t | |
294 | test-mq-qdiff.t |
|
293 | test-mq-qdiff.t | |
295 | test-mq-qfold.t |
|
294 | test-mq-qfold.t | |
296 | test-mq-qgoto.t |
|
295 | test-mq-qgoto.t | |
297 | test-mq-qimport-fail-cleanup.t |
|
296 | test-mq-qimport-fail-cleanup.t | |
298 | test-mq-qnew.t |
|
297 | test-mq-qnew.t | |
299 | test-mq-qpush-exact.t |
|
298 | test-mq-qpush-exact.t | |
300 | test-mq-qqueue.t |
|
299 | test-mq-qqueue.t | |
301 | test-mq-qrefresh-interactive.t |
|
300 | test-mq-qrefresh-interactive.t | |
302 | test-mq-qrefresh-replace-log-message.t |
|
301 | test-mq-qrefresh-replace-log-message.t | |
303 | test-mq-qrefresh.t |
|
302 | test-mq-qrefresh.t | |
304 | test-mq-qrename.t |
|
303 | test-mq-qrename.t | |
305 | test-mq-qsave.t |
|
304 | test-mq-qsave.t | |
306 | test-mq-safety.t |
|
305 | test-mq-safety.t | |
307 | test-mq-subrepo.t |
|
306 | test-mq-subrepo.t | |
308 | test-mq-symlinks.t |
|
307 | test-mq-symlinks.t | |
309 | test-mv-cp-st-diff.t |
|
308 | test-mv-cp-st-diff.t | |
310 | test-narrow-archive.t |
|
309 | test-narrow-archive.t | |
311 | test-narrow-clone-no-ellipsis.t |
|
310 | test-narrow-clone-no-ellipsis.t | |
312 | test-narrow-clone-non-narrow-server.t |
|
311 | test-narrow-clone-non-narrow-server.t | |
313 | test-narrow-clone-nonlinear.t |
|
312 | test-narrow-clone-nonlinear.t | |
314 | test-narrow-clone.t |
|
313 | test-narrow-clone.t | |
315 | test-narrow-commit.t |
|
314 | test-narrow-commit.t | |
316 | test-narrow-copies.t |
|
315 | test-narrow-copies.t | |
317 | test-narrow-debugcommands.t |
|
316 | test-narrow-debugcommands.t | |
318 | test-narrow-debugrebuilddirstate.t |
|
317 | test-narrow-debugrebuilddirstate.t | |
319 | test-narrow-exchange-merges.t |
|
318 | test-narrow-exchange-merges.t | |
320 | test-narrow-exchange.t |
|
319 | test-narrow-exchange.t | |
321 | test-narrow-expanddirstate.t |
|
320 | test-narrow-expanddirstate.t | |
322 | test-narrow-merge.t |
|
321 | test-narrow-merge.t | |
323 | test-narrow-patch.t |
|
322 | test-narrow-patch.t | |
324 | test-narrow-patterns.t |
|
323 | test-narrow-patterns.t | |
325 | test-narrow-pull.t |
|
324 | test-narrow-pull.t | |
326 | test-narrow-rebase.t |
|
325 | test-narrow-rebase.t | |
327 | test-narrow-shallow-merges.t |
|
326 | test-narrow-shallow-merges.t | |
328 | test-narrow-shallow.t |
|
327 | test-narrow-shallow.t | |
329 | test-narrow-strip.t |
|
328 | test-narrow-strip.t | |
330 | test-narrow-update.t |
|
329 | test-narrow-update.t | |
331 | test-narrow-widen.t |
|
330 | test-narrow-widen.t | |
332 | test-narrow.t |
|
331 | test-narrow.t | |
333 | test-nested-repo.t |
|
332 | test-nested-repo.t | |
334 | test-newbranch.t |
|
333 | test-newbranch.t | |
335 | test-obshistory.t |
|
334 | test-obshistory.t | |
336 | test-obsmarker-template.t |
|
335 | test-obsmarker-template.t | |
337 | test-obsmarkers-effectflag.t |
|
336 | test-obsmarkers-effectflag.t | |
338 | test-obsolete-bundle-strip.t |
|
337 | test-obsolete-bundle-strip.t | |
339 | test-obsolete-changeset-exchange.t |
|
338 | test-obsolete-changeset-exchange.t | |
340 | test-obsolete-checkheads.t |
|
339 | test-obsolete-checkheads.t | |
341 | test-obsolete-distributed.t |
|
340 | test-obsolete-distributed.t | |
342 | test-obsolete-tag-cache.t |
|
341 | test-obsolete-tag-cache.t | |
343 | test-pager.t |
|
342 | test-pager.t | |
344 | test-parents.t |
|
343 | test-parents.t | |
345 | test-parseindex2.py |
|
344 | test-parseindex2.py | |
346 | test-patch-offset.t |
|
345 | test-patch-offset.t | |
347 | test-patch.t |
|
346 | test-patch.t | |
348 | test-pathconflicts-merge.t |
|
347 | test-pathconflicts-merge.t | |
349 | test-pathconflicts-update.t |
|
348 | test-pathconflicts-update.t | |
350 | test-pathencode.py |
|
349 | test-pathencode.py | |
351 | test-pending.t |
|
350 | test-pending.t | |
352 | test-permissions.t |
|
351 | test-permissions.t | |
353 | test-phases.t |
|
352 | test-phases.t | |
354 | test-pull-branch.t |
|
353 | test-pull-branch.t | |
355 | test-pull-http.t |
|
354 | test-pull-http.t | |
356 | test-pull-permission.t |
|
355 | test-pull-permission.t | |
357 | test-pull-pull-corruption.t |
|
356 | test-pull-pull-corruption.t | |
358 | test-pull-r.t |
|
357 | test-pull-r.t | |
359 | test-pull-update.t |
|
358 | test-pull-update.t | |
360 | test-pull.t |
|
359 | test-pull.t | |
361 | test-purge.t |
|
360 | test-purge.t | |
362 | test-push-checkheads-partial-C1.t |
|
361 | test-push-checkheads-partial-C1.t | |
363 | test-push-checkheads-partial-C2.t |
|
362 | test-push-checkheads-partial-C2.t | |
364 | test-push-checkheads-partial-C3.t |
|
363 | test-push-checkheads-partial-C3.t | |
365 | test-push-checkheads-partial-C4.t |
|
364 | test-push-checkheads-partial-C4.t | |
366 | test-push-checkheads-pruned-B1.t |
|
365 | test-push-checkheads-pruned-B1.t | |
367 | test-push-checkheads-pruned-B2.t |
|
366 | test-push-checkheads-pruned-B2.t | |
368 | test-push-checkheads-pruned-B3.t |
|
367 | test-push-checkheads-pruned-B3.t | |
369 | test-push-checkheads-pruned-B4.t |
|
368 | test-push-checkheads-pruned-B4.t | |
370 | test-push-checkheads-pruned-B5.t |
|
369 | test-push-checkheads-pruned-B5.t | |
371 | test-push-checkheads-pruned-B6.t |
|
370 | test-push-checkheads-pruned-B6.t | |
372 | test-push-checkheads-pruned-B7.t |
|
371 | test-push-checkheads-pruned-B7.t | |
373 | test-push-checkheads-pruned-B8.t |
|
372 | test-push-checkheads-pruned-B8.t | |
374 | test-push-checkheads-superceed-A1.t |
|
373 | test-push-checkheads-superceed-A1.t | |
375 | test-push-checkheads-superceed-A2.t |
|
374 | test-push-checkheads-superceed-A2.t | |
376 | test-push-checkheads-superceed-A3.t |
|
375 | test-push-checkheads-superceed-A3.t | |
377 | test-push-checkheads-superceed-A4.t |
|
376 | test-push-checkheads-superceed-A4.t | |
378 | test-push-checkheads-superceed-A5.t |
|
377 | test-push-checkheads-superceed-A5.t | |
379 | test-push-checkheads-superceed-A6.t |
|
378 | test-push-checkheads-superceed-A6.t | |
380 | test-push-checkheads-superceed-A7.t |
|
379 | test-push-checkheads-superceed-A7.t | |
381 | test-push-checkheads-superceed-A8.t |
|
380 | test-push-checkheads-superceed-A8.t | |
382 | test-push-checkheads-unpushed-D1.t |
|
381 | test-push-checkheads-unpushed-D1.t | |
383 | test-push-checkheads-unpushed-D2.t |
|
382 | test-push-checkheads-unpushed-D2.t | |
384 | test-push-checkheads-unpushed-D3.t |
|
383 | test-push-checkheads-unpushed-D3.t | |
385 | test-push-checkheads-unpushed-D4.t |
|
384 | test-push-checkheads-unpushed-D4.t | |
386 | test-push-checkheads-unpushed-D5.t |
|
385 | test-push-checkheads-unpushed-D5.t | |
387 | test-push-checkheads-unpushed-D6.t |
|
386 | test-push-checkheads-unpushed-D6.t | |
388 | test-push-checkheads-unpushed-D7.t |
|
387 | test-push-checkheads-unpushed-D7.t | |
389 | test-push-http.t |
|
388 | test-push-http.t | |
390 | test-push-warn.t |
|
389 | test-push-warn.t | |
391 | test-push.t |
|
390 | test-push.t | |
392 | test-pushvars.t |
|
391 | test-pushvars.t | |
393 | test-qrecord.t |
|
392 | test-qrecord.t | |
394 | test-rebase-abort.t |
|
393 | test-rebase-abort.t | |
395 | test-rebase-base-flag.t |
|
394 | test-rebase-base-flag.t | |
396 | test-rebase-bookmarks.t |
|
395 | test-rebase-bookmarks.t | |
397 | test-rebase-brute-force.t |
|
396 | test-rebase-brute-force.t | |
398 | test-rebase-cache.t |
|
397 | test-rebase-cache.t | |
399 | test-rebase-check-restore.t |
|
398 | test-rebase-check-restore.t | |
400 | test-rebase-collapse.t |
|
399 | test-rebase-collapse.t | |
401 | test-rebase-conflicts.t |
|
400 | test-rebase-conflicts.t | |
402 | test-rebase-dest.t |
|
401 | test-rebase-dest.t | |
403 | test-rebase-detach.t |
|
402 | test-rebase-detach.t | |
404 | test-rebase-emptycommit.t |
|
403 | test-rebase-emptycommit.t | |
405 | test-rebase-inmemory.t |
|
404 | test-rebase-inmemory.t | |
406 | test-rebase-interruptions.t |
|
405 | test-rebase-interruptions.t | |
407 | test-rebase-issue-noparam-single-rev.t |
|
406 | test-rebase-issue-noparam-single-rev.t | |
408 | test-rebase-legacy.t |
|
407 | test-rebase-legacy.t | |
409 | test-rebase-mq-skip.t |
|
408 | test-rebase-mq-skip.t | |
410 | test-rebase-mq.t |
|
409 | test-rebase-mq.t | |
411 | test-rebase-named-branches.t |
|
410 | test-rebase-named-branches.t | |
412 | test-rebase-newancestor.t |
|
411 | test-rebase-newancestor.t | |
413 | test-rebase-obsolete.t |
|
412 | test-rebase-obsolete.t | |
414 | test-rebase-parameters.t |
|
413 | test-rebase-parameters.t | |
415 | test-rebase-partial.t |
|
414 | test-rebase-partial.t | |
416 | test-rebase-pull.t |
|
415 | test-rebase-pull.t | |
417 | test-rebase-rename.t |
|
416 | test-rebase-rename.t | |
418 | test-rebase-scenario-global.t |
|
417 | test-rebase-scenario-global.t | |
419 | test-rebase-templates.t |
|
418 | test-rebase-templates.t | |
420 | test-rebase-transaction.t |
|
419 | test-rebase-transaction.t | |
421 | test-rebuildstate.t |
|
420 | test-rebuildstate.t | |
422 | test-record.t |
|
421 | test-record.t | |
423 | test-relink.t |
|
422 | test-relink.t | |
424 | test-remove.t |
|
423 | test-remove.t | |
425 | test-rename-after-merge.t |
|
424 | test-rename-after-merge.t | |
426 | test-rename-dir-merge.t |
|
425 | test-rename-dir-merge.t | |
427 | test-rename-merge1.t |
|
426 | test-rename-merge1.t | |
428 | test-rename.t |
|
427 | test-rename.t | |
429 | test-repair-strip.t |
|
428 | test-repair-strip.t | |
430 | test-repo-compengines.t |
|
429 | test-repo-compengines.t | |
431 | test-resolve.t |
|
430 | test-resolve.t | |
432 | test-revert-flags.t |
|
431 | test-revert-flags.t | |
433 | test-revert-interactive.t |
|
432 | test-revert-interactive.t | |
434 | test-revert-unknown.t |
|
433 | test-revert-unknown.t | |
435 | test-revlog-ancestry.py |
|
434 | test-revlog-ancestry.py | |
436 | test-revlog-group-emptyiter.t |
|
435 | test-revlog-group-emptyiter.t | |
437 | test-revlog-mmapindex.t |
|
436 | test-revlog-mmapindex.t | |
438 | test-revlog-packentry.t |
|
437 | test-revlog-packentry.t | |
439 | test-revlog-raw.py |
|
438 | test-revlog-raw.py | |
440 | test-revlog-v2.t |
|
439 | test-revlog-v2.t | |
441 | test-revset-dirstate-parents.t |
|
440 | test-revset-dirstate-parents.t | |
442 | test-revset-legacy-lookup.t |
|
441 | test-revset-legacy-lookup.t | |
443 | test-revset-outgoing.t |
|
442 | test-revset-outgoing.t | |
444 | test-rollback.t |
|
443 | test-rollback.t | |
445 | test-run-tests.py |
|
444 | test-run-tests.py | |
446 | test-run-tests.t |
|
445 | test-run-tests.t | |
447 | test-schemes.t |
|
446 | test-schemes.t | |
448 | test-serve.t |
|
447 | test-serve.t | |
449 | test-setdiscovery.t |
|
448 | test-setdiscovery.t | |
450 | test-share.t |
|
449 | test-share.t | |
451 | test-shelve.t |
|
450 | test-shelve.t | |
452 | test-show-stack.t |
|
451 | test-show-stack.t | |
453 | test-show-work.t |
|
452 | test-show-work.t | |
454 | test-show.t |
|
453 | test-show.t | |
455 | test-simple-update.t |
|
454 | test-simple-update.t | |
456 | test-simplekeyvaluefile.py |
|
455 | test-simplekeyvaluefile.py | |
457 | test-simplemerge.py |
|
456 | test-simplemerge.py | |
458 | test-single-head.t |
|
457 | test-single-head.t | |
459 | test-sparse-clear.t |
|
458 | test-sparse-clear.t | |
460 | test-sparse-clone.t |
|
459 | test-sparse-clone.t | |
461 | test-sparse-import.t |
|
460 | test-sparse-import.t | |
462 | test-sparse-merges.t |
|
461 | test-sparse-merges.t | |
463 | test-sparse-profiles.t |
|
462 | test-sparse-profiles.t | |
464 | test-sparse-requirement.t |
|
463 | test-sparse-requirement.t | |
465 | test-sparse-verbose-json.t |
|
464 | test-sparse-verbose-json.t | |
466 | test-sparse.t |
|
465 | test-sparse.t | |
467 | test-split.t |
|
466 | test-split.t | |
468 | test-ssh-bundle1.t |
|
467 | test-ssh-bundle1.t | |
469 | test-ssh-clone-r.t |
|
468 | test-ssh-clone-r.t | |
470 | test-ssh-proto-unbundle.t |
|
469 | test-ssh-proto-unbundle.t | |
471 | test-ssh-proto.t |
|
470 | test-ssh-proto.t | |
472 | test-ssh.t |
|
471 | test-ssh.t | |
473 | test-sshserver.py |
|
472 | test-sshserver.py | |
474 | test-stack.t |
|
473 | test-stack.t | |
475 | test-status-inprocess.py |
|
474 | test-status-inprocess.py | |
476 | test-status-rev.t |
|
475 | test-status-rev.t | |
477 | test-status-terse.t |
|
476 | test-status-terse.t | |
478 | test-strict.t |
|
477 | test-strict.t | |
479 | test-strip-cross.t |
|
478 | test-strip-cross.t | |
480 | test-strip.t |
|
479 | test-strip.t | |
481 | test-subrepo-deep-nested-change.t |
|
480 | test-subrepo-deep-nested-change.t | |
482 | test-subrepo-missing.t |
|
481 | test-subrepo-missing.t | |
483 | test-subrepo-paths.t |
|
482 | test-subrepo-paths.t | |
484 | test-subrepo-recursion.t |
|
483 | test-subrepo-recursion.t | |
485 | test-subrepo-relative-path.t |
|
484 | test-subrepo-relative-path.t | |
486 | test-subrepo.t |
|
485 | test-subrepo.t | |
487 | test-symlink-os-yes-fs-no.py |
|
486 | test-symlink-os-yes-fs-no.py | |
488 | test-symlink-placeholder.t |
|
487 | test-symlink-placeholder.t | |
489 | test-symlinks.t |
|
488 | test-symlinks.t | |
490 | test-tag.t |
|
489 | test-tag.t | |
491 | test-tags.t |
|
490 | test-tags.t | |
|
491 | test-template-basic.t | |||
492 | test-template-functions.t |
|
492 | test-template-functions.t | |
493 | test-template-keywords.t |
|
493 | test-template-keywords.t | |
494 | test-template-map.t |
|
494 | test-template-map.t | |
495 | test-transplant.t |
|
495 | test-transplant.t | |
496 | test-treemanifest.t |
|
496 | test-treemanifest.t | |
497 | test-ui-color.py |
|
497 | test-ui-color.py | |
498 | test-ui-config.py |
|
498 | test-ui-config.py | |
499 | test-ui-verbosity.py |
|
499 | test-ui-verbosity.py | |
500 | test-unamend.t |
|
500 | test-unamend.t | |
501 | test-unbundlehash.t |
|
501 | test-unbundlehash.t | |
502 | test-uncommit.t |
|
502 | test-uncommit.t | |
503 | test-unified-test.t |
|
503 | test-unified-test.t | |
504 | test-unionrepo.t |
|
504 | test-unionrepo.t | |
505 | test-unrelated-pull.t |
|
505 | test-unrelated-pull.t | |
506 | test-up-local-change.t |
|
506 | test-up-local-change.t | |
507 | test-update-branches.t |
|
507 | test-update-branches.t | |
508 | test-update-dest.t |
|
508 | test-update-dest.t | |
509 | test-update-issue1456.t |
|
509 | test-update-issue1456.t | |
510 | test-update-names.t |
|
510 | test-update-names.t | |
511 | test-update-reverse.t |
|
511 | test-update-reverse.t | |
512 | test-upgrade-repo.t |
|
512 | test-upgrade-repo.t | |
513 | test-url-download.t |
|
513 | test-url-download.t | |
514 | test-url-rev.t |
|
514 | test-url-rev.t | |
515 | test-url.py |
|
515 | test-url.py | |
516 | test-username-newline.t |
|
516 | test-username-newline.t | |
517 | test-verify.t |
|
517 | test-verify.t | |
518 | test-walk.t |
|
518 | test-walk.t | |
519 | test-walkrepo.py |
|
519 | test-walkrepo.py | |
520 | test-websub.t |
|
520 | test-websub.t | |
521 | test-win32text.t |
|
521 | test-win32text.t | |
522 | test-wireproto-clientreactor.py |
|
522 | test-wireproto-clientreactor.py | |
523 | test-wireproto-framing.py |
|
523 | test-wireproto-framing.py | |
524 | test-wireproto-serverreactor.py |
|
524 | test-wireproto-serverreactor.py | |
525 | test-wireproto.py |
|
525 | test-wireproto.py | |
526 | test-wsgirequest.py |
|
526 | test-wsgirequest.py | |
527 | test-xdg.t |
|
527 | test-xdg.t |
@@ -1,1085 +1,1088 b'' | |||||
|
1 | Test template syntax and basic functionality | |||
|
2 | ============================================ | |||
|
3 | ||||
1 |
$ |
|
4 | $ hg init a | |
2 | $ cd a |
|
5 | $ cd a | |
3 | $ echo a > a |
|
6 | $ echo a > a | |
4 | $ hg add a |
|
7 | $ hg add a | |
5 | $ echo line 1 > b |
|
8 | $ echo line 1 > b | |
6 |
$ |
|
9 | $ echo line 2 >> b | |
7 | $ hg commit -l b -d '1000000 0' -u 'User Name <user@hostname>' |
|
10 | $ hg commit -l b -d '1000000 0' -u 'User Name <user@hostname>' | |
8 |
|
11 | |||
9 |
$ |
|
12 | $ hg add b | |
10 | $ echo other 1 > c |
|
13 | $ echo other 1 > c | |
11 |
$ |
|
14 | $ echo other 2 >> c | |
12 | $ echo >> c |
|
15 | $ echo >> c | |
13 | $ echo other 3 >> c |
|
16 | $ echo other 3 >> c | |
14 |
$ |
|
17 | $ hg commit -l c -d '1100000 0' -u 'A. N. Other <other@place>' | |
15 |
|
18 | |||
16 |
$ |
|
19 | $ hg add c | |
17 | $ hg commit -m 'no person' -d '1200000 0' -u 'other@place' |
|
20 | $ hg commit -m 'no person' -d '1200000 0' -u 'other@place' | |
18 |
$ |
|
21 | $ echo c >> c | |
19 | $ hg commit -m 'no user, no domain' -d '1300000 0' -u 'person' |
|
22 | $ hg commit -m 'no user, no domain' -d '1300000 0' -u 'person' | |
20 |
|
23 | |||
21 |
$ |
|
24 | $ echo foo > .hg/branch | |
22 | $ hg commit -m 'new branch' -d '1400000 0' -u 'person' |
|
25 | $ hg commit -m 'new branch' -d '1400000 0' -u 'person' | |
23 |
|
26 | |||
24 |
$ |
|
27 | $ hg co -q 3 | |
25 |
$ |
|
28 | $ echo other 4 >> d | |
26 | $ hg add d |
|
29 | $ hg add d | |
27 | $ hg commit -m 'new head' -d '1500000 0' -u 'person' |
|
30 | $ hg commit -m 'new head' -d '1500000 0' -u 'person' | |
28 |
|
31 | |||
29 |
$ |
|
32 | $ hg merge -q foo | |
30 | $ hg commit -m 'merge' -d '1500001 0' -u 'person' |
|
33 | $ hg commit -m 'merge' -d '1500001 0' -u 'person' | |
31 |
|
34 | |||
32 | Test arithmetic operators have the right precedence: |
|
35 | Test arithmetic operators have the right precedence: | |
33 |
|
36 | |||
34 |
$ |
|
37 | $ hg log -l 1 -T '{date(date, "%Y") + 5 * 10} {date(date, "%Y") - 2 * 3}\n' | |
35 | 2020 1964 |
|
38 | 2020 1964 | |
36 |
$ |
|
39 | $ hg log -l 1 -T '{date(date, "%Y") * 5 + 10} {date(date, "%Y") * 3 - 2}\n' | |
37 | 9860 5908 |
|
40 | 9860 5908 | |
38 |
|
41 | |||
39 | Test division: |
|
42 | Test division: | |
40 |
|
43 | |||
41 |
$ |
|
44 | $ hg debugtemplate -r0 -v '{5 / 2} {mod(5, 2)}\n' | |
42 | (template |
|
45 | (template | |
43 | (/ |
|
46 | (/ | |
44 | (integer '5') |
|
47 | (integer '5') | |
45 | (integer '2')) |
|
48 | (integer '2')) | |
46 | (string ' ') |
|
49 | (string ' ') | |
47 | (func |
|
50 | (func | |
48 | (symbol 'mod') |
|
51 | (symbol 'mod') | |
49 | (list |
|
52 | (list | |
50 | (integer '5') |
|
53 | (integer '5') | |
51 | (integer '2'))) |
|
54 | (integer '2'))) | |
52 | (string '\n')) |
|
55 | (string '\n')) | |
53 | * keywords: |
|
56 | * keywords: | |
54 | * functions: mod |
|
57 | * functions: mod | |
55 | 2 1 |
|
58 | 2 1 | |
56 | $ hg debugtemplate -r0 -v '{5 / -2} {mod(5, -2)}\n' |
|
59 | $ hg debugtemplate -r0 -v '{5 / -2} {mod(5, -2)}\n' | |
57 | (template |
|
60 | (template | |
58 | (/ |
|
61 | (/ | |
59 | (integer '5') |
|
62 | (integer '5') | |
60 | (negate |
|
63 | (negate | |
61 | (integer '2'))) |
|
64 | (integer '2'))) | |
62 | (string ' ') |
|
65 | (string ' ') | |
63 | (func |
|
66 | (func | |
64 | (symbol 'mod') |
|
67 | (symbol 'mod') | |
65 | (list |
|
68 | (list | |
66 | (integer '5') |
|
69 | (integer '5') | |
67 | (negate |
|
70 | (negate | |
68 | (integer '2')))) |
|
71 | (integer '2')))) | |
69 | (string '\n')) |
|
72 | (string '\n')) | |
70 | * keywords: |
|
73 | * keywords: | |
71 | * functions: mod |
|
74 | * functions: mod | |
72 | -3 -1 |
|
75 | -3 -1 | |
73 | $ hg debugtemplate -r0 -v '{-5 / 2} {mod(-5, 2)}\n' |
|
76 | $ hg debugtemplate -r0 -v '{-5 / 2} {mod(-5, 2)}\n' | |
74 | (template |
|
77 | (template | |
75 | (/ |
|
78 | (/ | |
76 | (negate |
|
79 | (negate | |
77 | (integer '5')) |
|
80 | (integer '5')) | |
78 | (integer '2')) |
|
81 | (integer '2')) | |
79 | (string ' ') |
|
82 | (string ' ') | |
80 | (func |
|
83 | (func | |
81 | (symbol 'mod') |
|
84 | (symbol 'mod') | |
82 | (list |
|
85 | (list | |
83 | (negate |
|
86 | (negate | |
84 | (integer '5')) |
|
87 | (integer '5')) | |
85 | (integer '2'))) |
|
88 | (integer '2'))) | |
86 | (string '\n')) |
|
89 | (string '\n')) | |
87 | * keywords: |
|
90 | * keywords: | |
88 | * functions: mod |
|
91 | * functions: mod | |
89 | -3 1 |
|
92 | -3 1 | |
90 | $ hg debugtemplate -r0 -v '{-5 / -2} {mod(-5, -2)}\n' |
|
93 | $ hg debugtemplate -r0 -v '{-5 / -2} {mod(-5, -2)}\n' | |
91 | (template |
|
94 | (template | |
92 | (/ |
|
95 | (/ | |
93 | (negate |
|
96 | (negate | |
94 | (integer '5')) |
|
97 | (integer '5')) | |
95 | (negate |
|
98 | (negate | |
96 | (integer '2'))) |
|
99 | (integer '2'))) | |
97 | (string ' ') |
|
100 | (string ' ') | |
98 | (func |
|
101 | (func | |
99 | (symbol 'mod') |
|
102 | (symbol 'mod') | |
100 | (list |
|
103 | (list | |
101 | (negate |
|
104 | (negate | |
102 | (integer '5')) |
|
105 | (integer '5')) | |
103 | (negate |
|
106 | (negate | |
104 | (integer '2')))) |
|
107 | (integer '2')))) | |
105 | (string '\n')) |
|
108 | (string '\n')) | |
106 | * keywords: |
|
109 | * keywords: | |
107 | * functions: mod |
|
110 | * functions: mod | |
108 | 2 -1 |
|
111 | 2 -1 | |
109 |
|
112 | |||
110 | Filters bind closer than arithmetic: |
|
113 | Filters bind closer than arithmetic: | |
111 |
|
114 | |||
112 | $ hg debugtemplate -r0 -v '{revset(".")|count - 1}\n' |
|
115 | $ hg debugtemplate -r0 -v '{revset(".")|count - 1}\n' | |
113 | (template |
|
116 | (template | |
114 | (- |
|
117 | (- | |
115 | (| |
|
118 | (| | |
116 | (func |
|
119 | (func | |
117 | (symbol 'revset') |
|
120 | (symbol 'revset') | |
118 | (string '.')) |
|
121 | (string '.')) | |
119 | (symbol 'count')) |
|
122 | (symbol 'count')) | |
120 | (integer '1')) |
|
123 | (integer '1')) | |
121 | (string '\n')) |
|
124 | (string '\n')) | |
122 | * keywords: |
|
125 | * keywords: | |
123 | * functions: count, revset |
|
126 | * functions: count, revset | |
124 | 0 |
|
127 | 0 | |
125 |
|
128 | |||
126 | But negate binds closer still: |
|
129 | But negate binds closer still: | |
127 |
|
130 | |||
128 | $ hg debugtemplate -r0 -v '{1-3|stringify}\n' |
|
131 | $ hg debugtemplate -r0 -v '{1-3|stringify}\n' | |
129 | (template |
|
132 | (template | |
130 | (- |
|
133 | (- | |
131 | (integer '1') |
|
134 | (integer '1') | |
132 | (| |
|
135 | (| | |
133 | (integer '3') |
|
136 | (integer '3') | |
134 | (symbol 'stringify'))) |
|
137 | (symbol 'stringify'))) | |
135 | (string '\n')) |
|
138 | (string '\n')) | |
136 | * keywords: |
|
139 | * keywords: | |
137 | * functions: stringify |
|
140 | * functions: stringify | |
138 | hg: parse error: arithmetic only defined on integers |
|
141 | hg: parse error: arithmetic only defined on integers | |
139 | [255] |
|
142 | [255] | |
140 | $ hg debugtemplate -r0 -v '{-3|stringify}\n' |
|
143 | $ hg debugtemplate -r0 -v '{-3|stringify}\n' | |
141 | (template |
|
144 | (template | |
142 | (| |
|
145 | (| | |
143 | (negate |
|
146 | (negate | |
144 | (integer '3')) |
|
147 | (integer '3')) | |
145 | (symbol 'stringify')) |
|
148 | (symbol 'stringify')) | |
146 | (string '\n')) |
|
149 | (string '\n')) | |
147 | * keywords: |
|
150 | * keywords: | |
148 | * functions: stringify |
|
151 | * functions: stringify | |
149 | -3 |
|
152 | -3 | |
150 |
|
153 | |||
151 | Filters bind as close as map operator: |
|
154 | Filters bind as close as map operator: | |
152 |
|
155 | |||
153 | $ hg debugtemplate -r0 -v '{desc|splitlines % "{line}\n"}' |
|
156 | $ hg debugtemplate -r0 -v '{desc|splitlines % "{line}\n"}' | |
154 | (template |
|
157 | (template | |
155 | (% |
|
158 | (% | |
156 | (| |
|
159 | (| | |
157 | (symbol 'desc') |
|
160 | (symbol 'desc') | |
158 | (symbol 'splitlines')) |
|
161 | (symbol 'splitlines')) | |
159 | (template |
|
162 | (template | |
160 | (symbol 'line') |
|
163 | (symbol 'line') | |
161 | (string '\n')))) |
|
164 | (string '\n')))) | |
162 | * keywords: desc, line |
|
165 | * keywords: desc, line | |
163 | * functions: splitlines |
|
166 | * functions: splitlines | |
164 | line 1 |
|
167 | line 1 | |
165 | line 2 |
|
168 | line 2 | |
166 |
|
169 | |||
167 | Keyword arguments: |
|
170 | Keyword arguments: | |
168 |
|
171 | |||
169 | $ hg debugtemplate -r0 -v '{foo=bar|baz}' |
|
172 | $ hg debugtemplate -r0 -v '{foo=bar|baz}' | |
170 | (template |
|
173 | (template | |
171 | (keyvalue |
|
174 | (keyvalue | |
172 | (symbol 'foo') |
|
175 | (symbol 'foo') | |
173 | (| |
|
176 | (| | |
174 | (symbol 'bar') |
|
177 | (symbol 'bar') | |
175 | (symbol 'baz')))) |
|
178 | (symbol 'baz')))) | |
176 | * keywords: bar, foo |
|
179 | * keywords: bar, foo | |
177 | * functions: baz |
|
180 | * functions: baz | |
178 | hg: parse error: can't use a key-value pair in this context |
|
181 | hg: parse error: can't use a key-value pair in this context | |
179 | [255] |
|
182 | [255] | |
180 |
|
183 | |||
181 | $ hg debugtemplate '{pad("foo", width=10, left=true)}\n' |
|
184 | $ hg debugtemplate '{pad("foo", width=10, left=true)}\n' | |
182 | foo |
|
185 | foo | |
183 |
|
186 | |||
184 | Call function which takes named arguments by filter syntax: |
|
187 | Call function which takes named arguments by filter syntax: | |
185 |
|
188 | |||
186 | $ hg debugtemplate '{" "|separate}' |
|
189 | $ hg debugtemplate '{" "|separate}' | |
187 | $ hg debugtemplate '{("not", "an", "argument", "list")|separate}' |
|
190 | $ hg debugtemplate '{("not", "an", "argument", "list")|separate}' | |
188 | hg: parse error: unknown method 'list' |
|
191 | hg: parse error: unknown method 'list' | |
189 | [255] |
|
192 | [255] | |
190 |
|
193 | |||
191 | Second branch starting at nullrev: |
|
194 | Second branch starting at nullrev: | |
192 |
|
195 | |||
193 | $ hg update null |
|
196 | $ hg update null | |
194 | 0 files updated, 0 files merged, 4 files removed, 0 files unresolved |
|
197 | 0 files updated, 0 files merged, 4 files removed, 0 files unresolved | |
195 | $ echo second > second |
|
198 | $ echo second > second | |
196 | $ hg add second |
|
199 | $ hg add second | |
197 | $ hg commit -m second -d '1000000 0' -u 'User Name <user@hostname>' |
|
200 | $ hg commit -m second -d '1000000 0' -u 'User Name <user@hostname>' | |
198 | created new head |
|
201 | created new head | |
199 |
|
202 | |||
200 | $ echo third > third |
|
203 | $ echo third > third | |
201 | $ hg add third |
|
204 | $ hg add third | |
202 | $ hg mv second fourth |
|
205 | $ hg mv second fourth | |
203 | $ hg commit -m third -d "2020-01-01 10:01" |
|
206 | $ hg commit -m third -d "2020-01-01 10:01" | |
204 |
|
207 | |||
205 | $ hg log --template '{join(file_copies, ",\n")}\n' -r . |
|
208 | $ hg log --template '{join(file_copies, ",\n")}\n' -r . | |
206 | fourth (second) |
|
209 | fourth (second) | |
207 | $ hg log -T '{file_copies % "{source} -> {name}\n"}' -r . |
|
210 | $ hg log -T '{file_copies % "{source} -> {name}\n"}' -r . | |
208 | second -> fourth |
|
211 | second -> fourth | |
209 | $ hg log -T '{rev} {ifcontains("fourth", file_copies, "t", "f")}\n' -r .:7 |
|
212 | $ hg log -T '{rev} {ifcontains("fourth", file_copies, "t", "f")}\n' -r .:7 | |
210 | 8 t |
|
213 | 8 t | |
211 | 7 f |
|
214 | 7 f | |
212 |
|
215 | |||
213 | Internal resources shouldn't be exposed (issue5699): |
|
216 | Internal resources shouldn't be exposed (issue5699): | |
214 |
|
217 | |||
215 | $ hg log -r. -T '{cache}{ctx}{repo}{revcache}{templ}{ui}' |
|
218 | $ hg log -r. -T '{cache}{ctx}{repo}{revcache}{templ}{ui}' | |
216 |
|
219 | |||
217 | Never crash on internal resource not available: |
|
220 | Never crash on internal resource not available: | |
218 |
|
221 | |||
219 | $ hg --cwd .. debugtemplate '{"c0bebeef"|shortest}\n' |
|
222 | $ hg --cwd .. debugtemplate '{"c0bebeef"|shortest}\n' | |
220 | abort: template resource not available: repo |
|
223 | abort: template resource not available: repo | |
221 | [255] |
|
224 | [255] | |
222 |
|
225 | |||
223 | $ hg config -T '{author}' |
|
226 | $ hg config -T '{author}' | |
224 |
|
227 | |||
225 | Quoting for ui.logtemplate |
|
228 | Quoting for ui.logtemplate | |
226 |
|
229 | |||
227 | $ hg tip --config "ui.logtemplate={rev}\n" |
|
230 | $ hg tip --config "ui.logtemplate={rev}\n" | |
228 | 8 |
|
231 | 8 | |
229 | $ hg tip --config "ui.logtemplate='{rev}\n'" |
|
232 | $ hg tip --config "ui.logtemplate='{rev}\n'" | |
230 | 8 |
|
233 | 8 | |
231 | $ hg tip --config 'ui.logtemplate="{rev}\n"' |
|
234 | $ hg tip --config 'ui.logtemplate="{rev}\n"' | |
232 | 8 |
|
235 | 8 | |
233 | $ hg tip --config 'ui.logtemplate=n{rev}\n' |
|
236 | $ hg tip --config 'ui.logtemplate=n{rev}\n' | |
234 | n8 |
|
237 | n8 | |
235 |
|
238 | |||
236 | Check that recursive reference does not fall into RuntimeError (issue4758): |
|
239 | Check that recursive reference does not fall into RuntimeError (issue4758): | |
237 |
|
240 | |||
238 | common mistake: |
|
241 | common mistake: | |
239 |
|
242 | |||
240 | $ cat << EOF > issue4758 |
|
243 | $ cat << EOF > issue4758 | |
241 | > changeset = '{changeset}\n' |
|
244 | > changeset = '{changeset}\n' | |
242 | > EOF |
|
245 | > EOF | |
243 | $ hg log --style ./issue4758 |
|
246 | $ hg log --style ./issue4758 | |
244 | abort: recursive reference 'changeset' in template |
|
247 | abort: recursive reference 'changeset' in template | |
245 | [255] |
|
248 | [255] | |
246 |
|
249 | |||
247 | circular reference: |
|
250 | circular reference: | |
248 |
|
251 | |||
249 | $ cat << EOF > issue4758 |
|
252 | $ cat << EOF > issue4758 | |
250 | > changeset = '{foo}' |
|
253 | > changeset = '{foo}' | |
251 | > foo = '{changeset}' |
|
254 | > foo = '{changeset}' | |
252 | > EOF |
|
255 | > EOF | |
253 | $ hg log --style ./issue4758 |
|
256 | $ hg log --style ./issue4758 | |
254 | abort: recursive reference 'foo' in template |
|
257 | abort: recursive reference 'foo' in template | |
255 | [255] |
|
258 | [255] | |
256 |
|
259 | |||
257 | buildmap() -> gettemplate(), where no thunk was made: |
|
260 | buildmap() -> gettemplate(), where no thunk was made: | |
258 |
|
261 | |||
259 | $ cat << EOF > issue4758 |
|
262 | $ cat << EOF > issue4758 | |
260 | > changeset = '{files % changeset}\n' |
|
263 | > changeset = '{files % changeset}\n' | |
261 | > EOF |
|
264 | > EOF | |
262 | $ hg log --style ./issue4758 |
|
265 | $ hg log --style ./issue4758 | |
263 | abort: recursive reference 'changeset' in template |
|
266 | abort: recursive reference 'changeset' in template | |
264 | [255] |
|
267 | [255] | |
265 |
|
268 | |||
266 | not a recursion if a keyword of the same name exists: |
|
269 | not a recursion if a keyword of the same name exists: | |
267 |
|
270 | |||
268 | $ cat << EOF > issue4758 |
|
271 | $ cat << EOF > issue4758 | |
269 | > changeset = '{tags % rev}' |
|
272 | > changeset = '{tags % rev}' | |
270 | > rev = '{rev} {tag}\n' |
|
273 | > rev = '{rev} {tag}\n' | |
271 | > EOF |
|
274 | > EOF | |
272 | $ hg log --style ./issue4758 -r tip |
|
275 | $ hg log --style ./issue4758 -r tip | |
273 | 8 tip |
|
276 | 8 tip | |
274 |
|
277 | |||
275 | Set up phase: |
|
278 | Set up phase: | |
276 |
|
279 | |||
277 | $ hg phase -r 5 --public |
|
280 | $ hg phase -r 5 --public | |
278 | $ hg phase -r 7 --secret --force |
|
281 | $ hg phase -r 7 --secret --force | |
279 |
|
282 | |||
280 | Add a dummy commit to make up for the instability of the above: |
|
283 | Add a dummy commit to make up for the instability of the above: | |
281 |
|
284 | |||
282 | $ echo a > a |
|
285 | $ echo a > a | |
283 | $ hg add a |
|
286 | $ hg add a | |
284 | $ hg ci -m future |
|
287 | $ hg ci -m future | |
285 |
|
288 | |||
286 | Add a commit that does all possible modifications at once |
|
289 | Add a commit that does all possible modifications at once | |
287 |
|
290 | |||
288 | $ echo modify >> third |
|
291 | $ echo modify >> third | |
289 | $ touch b |
|
292 | $ touch b | |
290 | $ hg add b |
|
293 | $ hg add b | |
291 | $ hg mv fourth fifth |
|
294 | $ hg mv fourth fifth | |
292 | $ hg rm a |
|
295 | $ hg rm a | |
293 | $ hg ci -m "Modify, add, remove, rename" |
|
296 | $ hg ci -m "Modify, add, remove, rename" | |
294 |
|
297 | |||
295 | Error on syntax: |
|
298 | Error on syntax: | |
296 |
|
299 | |||
297 | $ cat <<EOF > t |
|
300 | $ cat <<EOF > t | |
298 | > changeset = '{c}' |
|
301 | > changeset = '{c}' | |
299 | > c = q |
|
302 | > c = q | |
300 | > x = "f |
|
303 | > x = "f | |
301 | > EOF |
|
304 | > EOF | |
302 | $ echo '[ui]' > .hg/hgrc |
|
305 | $ echo '[ui]' > .hg/hgrc | |
303 | $ echo 'style = t' >> .hg/hgrc |
|
306 | $ echo 'style = t' >> .hg/hgrc | |
304 | $ hg log |
|
307 | $ hg log | |
305 | hg: parse error at t:3: unmatched quotes |
|
308 | hg: parse error at t:3: unmatched quotes | |
306 | [255] |
|
309 | [255] | |
307 |
|
310 | |||
308 | $ hg log -T '{date' |
|
311 | $ hg log -T '{date' | |
309 | hg: parse error at 1: unterminated template expansion |
|
312 | hg: parse error at 1: unterminated template expansion | |
310 | ({date |
|
313 | ({date | |
311 | ^ here) |
|
314 | ^ here) | |
312 | [255] |
|
315 | [255] | |
313 | $ hg log -T '{date(}' |
|
316 | $ hg log -T '{date(}' | |
314 | hg: parse error at 6: not a prefix: end |
|
317 | hg: parse error at 6: not a prefix: end | |
315 | ({date(} |
|
318 | ({date(} | |
316 | ^ here) |
|
319 | ^ here) | |
317 | [255] |
|
320 | [255] | |
318 | $ hg log -T '{date)}' |
|
321 | $ hg log -T '{date)}' | |
319 | hg: parse error at 5: invalid token |
|
322 | hg: parse error at 5: invalid token | |
320 | ({date)} |
|
323 | ({date)} | |
321 | ^ here) |
|
324 | ^ here) | |
322 | [255] |
|
325 | [255] | |
323 | $ hg log -T '{date date}' |
|
326 | $ hg log -T '{date date}' | |
324 | hg: parse error at 6: invalid token |
|
327 | hg: parse error at 6: invalid token | |
325 | ({date date} |
|
328 | ({date date} | |
326 | ^ here) |
|
329 | ^ here) | |
327 | [255] |
|
330 | [255] | |
328 |
|
331 | |||
329 | $ hg log -T '{}' |
|
332 | $ hg log -T '{}' | |
330 | hg: parse error at 1: not a prefix: end |
|
333 | hg: parse error at 1: not a prefix: end | |
331 | ({} |
|
334 | ({} | |
332 | ^ here) |
|
335 | ^ here) | |
333 | [255] |
|
336 | [255] | |
334 | $ hg debugtemplate -v '{()}' |
|
337 | $ hg debugtemplate -v '{()}' | |
335 | (template |
|
338 | (template | |
336 | (group |
|
339 | (group | |
337 | None)) |
|
340 | None)) | |
338 | * keywords: |
|
341 | * keywords: | |
339 | * functions: |
|
342 | * functions: | |
340 | hg: parse error: missing argument |
|
343 | hg: parse error: missing argument | |
341 | [255] |
|
344 | [255] | |
342 |
|
345 | |||
343 | Behind the scenes, this would throw TypeError without intype=bytes |
|
346 | Behind the scenes, this would throw TypeError without intype=bytes | |
344 |
|
347 | |||
345 | $ hg log -l 3 --template '{date|obfuscate}\n' |
|
348 | $ hg log -l 3 --template '{date|obfuscate}\n' | |
346 | 0.00 |
|
349 | 0.00 | |
347 | 0.00 |
|
350 | 0.00 | |
348 | 1577872860.00 |
|
351 | 1577872860.00 | |
349 |
|
352 | |||
350 | Behind the scenes, this will throw a ValueError |
|
353 | Behind the scenes, this will throw a ValueError | |
351 |
|
354 | |||
352 | $ hg log -l 3 --template 'line: {desc|shortdate}\n' |
|
355 | $ hg log -l 3 --template 'line: {desc|shortdate}\n' | |
353 | hg: parse error: invalid date: 'Modify, add, remove, rename' |
|
356 | hg: parse error: invalid date: 'Modify, add, remove, rename' | |
354 | (template filter 'shortdate' is not compatible with keyword 'desc') |
|
357 | (template filter 'shortdate' is not compatible with keyword 'desc') | |
355 | [255] |
|
358 | [255] | |
356 |
|
359 | |||
357 | Behind the scenes, this would throw AttributeError without intype=bytes |
|
360 | Behind the scenes, this would throw AttributeError without intype=bytes | |
358 |
|
361 | |||
359 | $ hg log -l 3 --template 'line: {date|escape}\n' |
|
362 | $ hg log -l 3 --template 'line: {date|escape}\n' | |
360 | line: 0.00 |
|
363 | line: 0.00 | |
361 | line: 0.00 |
|
364 | line: 0.00 | |
362 | line: 1577872860.00 |
|
365 | line: 1577872860.00 | |
363 |
|
366 | |||
364 | $ hg log -l 3 --template 'line: {extras|localdate}\n' |
|
367 | $ hg log -l 3 --template 'line: {extras|localdate}\n' | |
365 | hg: parse error: localdate expects a date information |
|
368 | hg: parse error: localdate expects a date information | |
366 | [255] |
|
369 | [255] | |
367 |
|
370 | |||
368 | Behind the scenes, this will throw ValueError |
|
371 | Behind the scenes, this will throw ValueError | |
369 |
|
372 | |||
370 | $ hg tip --template '{author|email|date}\n' |
|
373 | $ hg tip --template '{author|email|date}\n' | |
371 | hg: parse error: date expects a date information |
|
374 | hg: parse error: date expects a date information | |
372 | [255] |
|
375 | [255] | |
373 |
|
376 | |||
374 | $ hg tip -T '{author|email|shortdate}\n' |
|
377 | $ hg tip -T '{author|email|shortdate}\n' | |
375 | hg: parse error: invalid date: 'test' |
|
378 | hg: parse error: invalid date: 'test' | |
376 | (template filter 'shortdate' is not compatible with keyword 'author') |
|
379 | (template filter 'shortdate' is not compatible with keyword 'author') | |
377 | [255] |
|
380 | [255] | |
378 |
|
381 | |||
379 | $ hg tip -T '{get(extras, "branch")|shortdate}\n' |
|
382 | $ hg tip -T '{get(extras, "branch")|shortdate}\n' | |
380 | hg: parse error: invalid date: 'default' |
|
383 | hg: parse error: invalid date: 'default' | |
381 | (incompatible use of template filter 'shortdate') |
|
384 | (incompatible use of template filter 'shortdate') | |
382 | [255] |
|
385 | [255] | |
383 |
|
386 | |||
384 | Error in nested template: |
|
387 | Error in nested template: | |
385 |
|
388 | |||
386 | $ hg log -T '{"date' |
|
389 | $ hg log -T '{"date' | |
387 | hg: parse error at 2: unterminated string |
|
390 | hg: parse error at 2: unterminated string | |
388 | ({"date |
|
391 | ({"date | |
389 | ^ here) |
|
392 | ^ here) | |
390 | [255] |
|
393 | [255] | |
391 |
|
394 | |||
392 | $ hg log -T '{"foo{date|?}"}' |
|
395 | $ hg log -T '{"foo{date|?}"}' | |
393 | hg: parse error at 11: syntax error |
|
396 | hg: parse error at 11: syntax error | |
394 | ({"foo{date|?}"} |
|
397 | ({"foo{date|?}"} | |
395 | ^ here) |
|
398 | ^ here) | |
396 | [255] |
|
399 | [255] | |
397 |
|
400 | |||
398 | Thrown an error if a template function doesn't exist |
|
401 | Thrown an error if a template function doesn't exist | |
399 |
|
402 | |||
400 | $ hg tip --template '{foo()}\n' |
|
403 | $ hg tip --template '{foo()}\n' | |
401 | hg: parse error: unknown function 'foo' |
|
404 | hg: parse error: unknown function 'foo' | |
402 | [255] |
|
405 | [255] | |
403 |
|
406 | |||
404 | $ cd .. |
|
407 | $ cd .. | |
405 |
|
408 | |||
406 | Set up latesttag repository: |
|
409 | Set up latesttag repository: | |
407 |
|
410 | |||
408 | $ hg init latesttag |
|
411 | $ hg init latesttag | |
409 | $ cd latesttag |
|
412 | $ cd latesttag | |
410 |
|
413 | |||
411 | $ echo a > file |
|
414 | $ echo a > file | |
412 | $ hg ci -Am a -d '0 0' |
|
415 | $ hg ci -Am a -d '0 0' | |
413 | adding file |
|
416 | adding file | |
414 |
|
417 | |||
415 | $ echo b >> file |
|
418 | $ echo b >> file | |
416 | $ hg ci -m b -d '1 0' |
|
419 | $ hg ci -m b -d '1 0' | |
417 |
|
420 | |||
418 | $ echo c >> head1 |
|
421 | $ echo c >> head1 | |
419 | $ hg ci -Am h1c -d '2 0' |
|
422 | $ hg ci -Am h1c -d '2 0' | |
420 | adding head1 |
|
423 | adding head1 | |
421 |
|
424 | |||
422 | $ hg update -q 1 |
|
425 | $ hg update -q 1 | |
423 | $ echo d >> head2 |
|
426 | $ echo d >> head2 | |
424 | $ hg ci -Am h2d -d '3 0' |
|
427 | $ hg ci -Am h2d -d '3 0' | |
425 | adding head2 |
|
428 | adding head2 | |
426 | created new head |
|
429 | created new head | |
427 |
|
430 | |||
428 | $ echo e >> head2 |
|
431 | $ echo e >> head2 | |
429 | $ hg ci -m h2e -d '4 0' |
|
432 | $ hg ci -m h2e -d '4 0' | |
430 |
|
433 | |||
431 | $ hg merge -q |
|
434 | $ hg merge -q | |
432 | $ hg ci -m merge -d '5 -3600' |
|
435 | $ hg ci -m merge -d '5 -3600' | |
433 |
|
436 | |||
434 | $ hg tag -r 1 -m t1 -d '6 0' t1 |
|
437 | $ hg tag -r 1 -m t1 -d '6 0' t1 | |
435 | $ hg tag -r 2 -m t2 -d '7 0' t2 |
|
438 | $ hg tag -r 2 -m t2 -d '7 0' t2 | |
436 | $ hg tag -r 3 -m t3 -d '8 0' t3 |
|
439 | $ hg tag -r 3 -m t3 -d '8 0' t3 | |
437 | $ hg tag -r 4 -m t4 -d '4 0' t4 # older than t2, but should not matter |
|
440 | $ hg tag -r 4 -m t4 -d '4 0' t4 # older than t2, but should not matter | |
438 | $ hg tag -r 5 -m t5 -d '9 0' t5 |
|
441 | $ hg tag -r 5 -m t5 -d '9 0' t5 | |
439 | $ hg tag -r 3 -m at3 -d '10 0' at3 |
|
442 | $ hg tag -r 3 -m at3 -d '10 0' at3 | |
440 |
|
443 | |||
441 | $ cd .. |
|
444 | $ cd .. | |
442 |
|
445 | |||
443 | Test new-style inline templating: |
|
446 | Test new-style inline templating: | |
444 |
|
447 | |||
445 | $ hg log -R latesttag -r tip --template 'modified files: {file_mods % " {file}\n"}\n' |
|
448 | $ hg log -R latesttag -r tip --template 'modified files: {file_mods % " {file}\n"}\n' | |
446 | modified files: .hgtags |
|
449 | modified files: .hgtags | |
447 |
|
450 | |||
448 |
|
451 | |||
449 | $ hg log -R latesttag -r tip -T '{rev % "a"}\n' |
|
452 | $ hg log -R latesttag -r tip -T '{rev % "a"}\n' | |
450 | hg: parse error: 11 is not iterable of mappings |
|
453 | hg: parse error: 11 is not iterable of mappings | |
451 | (keyword 'rev' does not support map operation) |
|
454 | (keyword 'rev' does not support map operation) | |
452 | [255] |
|
455 | [255] | |
453 | $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "a"}\n' |
|
456 | $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "a"}\n' | |
454 | hg: parse error: None is not iterable of mappings |
|
457 | hg: parse error: None is not iterable of mappings | |
455 | [255] |
|
458 | [255] | |
456 | $ hg log -R latesttag -r tip -T '{extras % "{key}\n" % "{key}\n"}' |
|
459 | $ hg log -R latesttag -r tip -T '{extras % "{key}\n" % "{key}\n"}' | |
457 | hg: parse error: list of strings is not mappable |
|
460 | hg: parse error: list of strings is not mappable | |
458 | [255] |
|
461 | [255] | |
459 |
|
462 | |||
460 | Test new-style inline templating of non-list/dict type: |
|
463 | Test new-style inline templating of non-list/dict type: | |
461 |
|
464 | |||
462 | $ hg log -R latesttag -r tip -T '{manifest}\n' |
|
465 | $ hg log -R latesttag -r tip -T '{manifest}\n' | |
463 | 11:2bc6e9006ce2 |
|
466 | 11:2bc6e9006ce2 | |
464 | $ hg log -R latesttag -r tip -T 'string length: {manifest|count}\n' |
|
467 | $ hg log -R latesttag -r tip -T 'string length: {manifest|count}\n' | |
465 | string length: 15 |
|
468 | string length: 15 | |
466 | $ hg log -R latesttag -r tip -T '{manifest % "{rev}:{node}"}\n' |
|
469 | $ hg log -R latesttag -r tip -T '{manifest % "{rev}:{node}"}\n' | |
467 | 11:2bc6e9006ce29882383a22d39fd1f4e66dd3e2fc |
|
470 | 11:2bc6e9006ce29882383a22d39fd1f4e66dd3e2fc | |
468 |
|
471 | |||
469 | $ hg log -R latesttag -r tip -T '{get(extras, "branch") % "{key}: {value}\n"}' |
|
472 | $ hg log -R latesttag -r tip -T '{get(extras, "branch") % "{key}: {value}\n"}' | |
470 | branch: default |
|
473 | branch: default | |
471 | $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "{key}\n"}' |
|
474 | $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "{key}\n"}' | |
472 | hg: parse error: None is not iterable of mappings |
|
475 | hg: parse error: None is not iterable of mappings | |
473 | [255] |
|
476 | [255] | |
474 | $ hg log -R latesttag -r tip -T '{min(extras) % "{key}: {value}\n"}' |
|
477 | $ hg log -R latesttag -r tip -T '{min(extras) % "{key}: {value}\n"}' | |
475 | branch: default |
|
478 | branch: default | |
476 | $ hg log -R latesttag -l1 -T '{min(revset("0:9")) % "{rev}:{node|short}\n"}' |
|
479 | $ hg log -R latesttag -l1 -T '{min(revset("0:9")) % "{rev}:{node|short}\n"}' | |
477 | 0:ce3cec86e6c2 |
|
480 | 0:ce3cec86e6c2 | |
478 | $ hg log -R latesttag -l1 -T '{max(revset("0:9")) % "{rev}:{node|short}\n"}' |
|
481 | $ hg log -R latesttag -l1 -T '{max(revset("0:9")) % "{rev}:{node|short}\n"}' | |
479 | 9:fbc7cd862e9c |
|
482 | 9:fbc7cd862e9c | |
480 |
|
483 | |||
481 | Test dot operator precedence: |
|
484 | Test dot operator precedence: | |
482 |
|
485 | |||
483 | $ hg debugtemplate -R latesttag -r0 -v '{manifest.node|short}\n' |
|
486 | $ hg debugtemplate -R latesttag -r0 -v '{manifest.node|short}\n' | |
484 | (template |
|
487 | (template | |
485 | (| |
|
488 | (| | |
486 | (. |
|
489 | (. | |
487 | (symbol 'manifest') |
|
490 | (symbol 'manifest') | |
488 | (symbol 'node')) |
|
491 | (symbol 'node')) | |
489 | (symbol 'short')) |
|
492 | (symbol 'short')) | |
490 | (string '\n')) |
|
493 | (string '\n')) | |
491 | * keywords: manifest, node, rev |
|
494 | * keywords: manifest, node, rev | |
492 | * functions: formatnode, short |
|
495 | * functions: formatnode, short | |
493 | 89f4071fec70 |
|
496 | 89f4071fec70 | |
494 |
|
497 | |||
495 | (the following examples are invalid, but seem natural in parsing POV) |
|
498 | (the following examples are invalid, but seem natural in parsing POV) | |
496 |
|
499 | |||
497 | $ hg debugtemplate -R latesttag -r0 -v '{foo|bar.baz}\n' 2> /dev/null |
|
500 | $ hg debugtemplate -R latesttag -r0 -v '{foo|bar.baz}\n' 2> /dev/null | |
498 | (template |
|
501 | (template | |
499 | (| |
|
502 | (| | |
500 | (symbol 'foo') |
|
503 | (symbol 'foo') | |
501 | (. |
|
504 | (. | |
502 | (symbol 'bar') |
|
505 | (symbol 'bar') | |
503 | (symbol 'baz'))) |
|
506 | (symbol 'baz'))) | |
504 | (string '\n')) |
|
507 | (string '\n')) | |
505 | [255] |
|
508 | [255] | |
506 | $ hg debugtemplate -R latesttag -r0 -v '{foo.bar()}\n' 2> /dev/null |
|
509 | $ hg debugtemplate -R latesttag -r0 -v '{foo.bar()}\n' 2> /dev/null | |
507 | (template |
|
510 | (template | |
508 | (. |
|
511 | (. | |
509 | (symbol 'foo') |
|
512 | (symbol 'foo') | |
510 | (func |
|
513 | (func | |
511 | (symbol 'bar') |
|
514 | (symbol 'bar') | |
512 | None)) |
|
515 | None)) | |
513 | (string '\n')) |
|
516 | (string '\n')) | |
514 | * keywords: foo |
|
517 | * keywords: foo | |
515 | * functions: bar |
|
518 | * functions: bar | |
516 | [255] |
|
519 | [255] | |
517 |
|
520 | |||
518 | Test evaluation of dot operator: |
|
521 | Test evaluation of dot operator: | |
519 |
|
522 | |||
520 | $ hg log -R latesttag -l1 -T '{min(revset("0:9")).node}\n' |
|
523 | $ hg log -R latesttag -l1 -T '{min(revset("0:9")).node}\n' | |
521 | ce3cec86e6c26bd9bdfc590a6b92abc9680f1796 |
|
524 | ce3cec86e6c26bd9bdfc590a6b92abc9680f1796 | |
522 | $ hg log -R latesttag -r0 -T '{extras.branch}\n' |
|
525 | $ hg log -R latesttag -r0 -T '{extras.branch}\n' | |
523 | default |
|
526 | default | |
524 | $ hg log -R latesttag -r0 -T '{date.unixtime} {localdate(date, "+0200").tzoffset}\n' |
|
527 | $ hg log -R latesttag -r0 -T '{date.unixtime} {localdate(date, "+0200").tzoffset}\n' | |
525 | 0 -7200 |
|
528 | 0 -7200 | |
526 |
|
529 | |||
527 | $ hg log -R latesttag -l1 -T '{author.invalid}\n' |
|
530 | $ hg log -R latesttag -l1 -T '{author.invalid}\n' | |
528 | hg: parse error: 'test' is not a dictionary |
|
531 | hg: parse error: 'test' is not a dictionary | |
529 | (keyword 'author' does not support member operation) |
|
532 | (keyword 'author' does not support member operation) | |
530 | [255] |
|
533 | [255] | |
531 | $ hg log -R latesttag -l1 -T '{min("abc").invalid}\n' |
|
534 | $ hg log -R latesttag -l1 -T '{min("abc").invalid}\n' | |
532 | hg: parse error: 'a' is not a dictionary |
|
535 | hg: parse error: 'a' is not a dictionary | |
533 | [255] |
|
536 | [255] | |
534 |
|
537 | |||
535 | Test integer literal: |
|
538 | Test integer literal: | |
536 |
|
539 | |||
537 | $ hg debugtemplate -v '{(0)}\n' |
|
540 | $ hg debugtemplate -v '{(0)}\n' | |
538 | (template |
|
541 | (template | |
539 | (group |
|
542 | (group | |
540 | (integer '0')) |
|
543 | (integer '0')) | |
541 | (string '\n')) |
|
544 | (string '\n')) | |
542 | * keywords: |
|
545 | * keywords: | |
543 | * functions: |
|
546 | * functions: | |
544 | 0 |
|
547 | 0 | |
545 | $ hg debugtemplate -v '{(123)}\n' |
|
548 | $ hg debugtemplate -v '{(123)}\n' | |
546 | (template |
|
549 | (template | |
547 | (group |
|
550 | (group | |
548 | (integer '123')) |
|
551 | (integer '123')) | |
549 | (string '\n')) |
|
552 | (string '\n')) | |
550 | * keywords: |
|
553 | * keywords: | |
551 | * functions: |
|
554 | * functions: | |
552 | 123 |
|
555 | 123 | |
553 | $ hg debugtemplate -v '{(-4)}\n' |
|
556 | $ hg debugtemplate -v '{(-4)}\n' | |
554 | (template |
|
557 | (template | |
555 | (group |
|
558 | (group | |
556 | (negate |
|
559 | (negate | |
557 | (integer '4'))) |
|
560 | (integer '4'))) | |
558 | (string '\n')) |
|
561 | (string '\n')) | |
559 | * keywords: |
|
562 | * keywords: | |
560 | * functions: |
|
563 | * functions: | |
561 | -4 |
|
564 | -4 | |
562 | $ hg debugtemplate '{(-)}\n' |
|
565 | $ hg debugtemplate '{(-)}\n' | |
563 | hg: parse error at 3: not a prefix: ) |
|
566 | hg: parse error at 3: not a prefix: ) | |
564 | ({(-)}\n |
|
567 | ({(-)}\n | |
565 | ^ here) |
|
568 | ^ here) | |
566 | [255] |
|
569 | [255] | |
567 | $ hg debugtemplate '{(-a)}\n' |
|
570 | $ hg debugtemplate '{(-a)}\n' | |
568 | hg: parse error: negation needs an integer argument |
|
571 | hg: parse error: negation needs an integer argument | |
569 | [255] |
|
572 | [255] | |
570 |
|
573 | |||
571 | top-level integer literal is interpreted as symbol (i.e. variable name): |
|
574 | top-level integer literal is interpreted as symbol (i.e. variable name): | |
572 |
|
575 | |||
573 | $ hg debugtemplate -D 1=one -v '{1}\n' |
|
576 | $ hg debugtemplate -D 1=one -v '{1}\n' | |
574 | (template |
|
577 | (template | |
575 | (integer '1') |
|
578 | (integer '1') | |
576 | (string '\n')) |
|
579 | (string '\n')) | |
577 | * keywords: |
|
580 | * keywords: | |
578 | * functions: |
|
581 | * functions: | |
579 | one |
|
582 | one | |
580 | $ hg debugtemplate -D 1=one -v '{if("t", "{1}")}\n' |
|
583 | $ hg debugtemplate -D 1=one -v '{if("t", "{1}")}\n' | |
581 | (template |
|
584 | (template | |
582 | (func |
|
585 | (func | |
583 | (symbol 'if') |
|
586 | (symbol 'if') | |
584 | (list |
|
587 | (list | |
585 | (string 't') |
|
588 | (string 't') | |
586 | (template |
|
589 | (template | |
587 | (integer '1')))) |
|
590 | (integer '1')))) | |
588 | (string '\n')) |
|
591 | (string '\n')) | |
589 | * keywords: |
|
592 | * keywords: | |
590 | * functions: if |
|
593 | * functions: if | |
591 | one |
|
594 | one | |
592 | $ hg debugtemplate -D 1=one -v '{1|stringify}\n' |
|
595 | $ hg debugtemplate -D 1=one -v '{1|stringify}\n' | |
593 | (template |
|
596 | (template | |
594 | (| |
|
597 | (| | |
595 | (integer '1') |
|
598 | (integer '1') | |
596 | (symbol 'stringify')) |
|
599 | (symbol 'stringify')) | |
597 | (string '\n')) |
|
600 | (string '\n')) | |
598 | * keywords: |
|
601 | * keywords: | |
599 | * functions: stringify |
|
602 | * functions: stringify | |
600 | one |
|
603 | one | |
601 |
|
604 | |||
602 | unless explicit symbol is expected: |
|
605 | unless explicit symbol is expected: | |
603 |
|
606 | |||
604 | $ hg log -Ra -r0 -T '{desc|1}\n' |
|
607 | $ hg log -Ra -r0 -T '{desc|1}\n' | |
605 | hg: parse error: expected a symbol, got 'integer' |
|
608 | hg: parse error: expected a symbol, got 'integer' | |
606 | [255] |
|
609 | [255] | |
607 | $ hg log -Ra -r0 -T '{1()}\n' |
|
610 | $ hg log -Ra -r0 -T '{1()}\n' | |
608 | hg: parse error: expected a symbol, got 'integer' |
|
611 | hg: parse error: expected a symbol, got 'integer' | |
609 | [255] |
|
612 | [255] | |
610 |
|
613 | |||
611 | Test string literal: |
|
614 | Test string literal: | |
612 |
|
615 | |||
613 | $ hg debugtemplate -Ra -r0 -v '{"string with no template fragment"}\n' |
|
616 | $ hg debugtemplate -Ra -r0 -v '{"string with no template fragment"}\n' | |
614 | (template |
|
617 | (template | |
615 | (string 'string with no template fragment') |
|
618 | (string 'string with no template fragment') | |
616 | (string '\n')) |
|
619 | (string '\n')) | |
617 | * keywords: |
|
620 | * keywords: | |
618 | * functions: |
|
621 | * functions: | |
619 | string with no template fragment |
|
622 | string with no template fragment | |
620 | $ hg debugtemplate -Ra -r0 -v '{"template: {rev}"}\n' |
|
623 | $ hg debugtemplate -Ra -r0 -v '{"template: {rev}"}\n' | |
621 | (template |
|
624 | (template | |
622 | (template |
|
625 | (template | |
623 | (string 'template: ') |
|
626 | (string 'template: ') | |
624 | (symbol 'rev')) |
|
627 | (symbol 'rev')) | |
625 | (string '\n')) |
|
628 | (string '\n')) | |
626 | * keywords: rev |
|
629 | * keywords: rev | |
627 | * functions: |
|
630 | * functions: | |
628 | template: 0 |
|
631 | template: 0 | |
629 | $ hg debugtemplate -Ra -r0 -v '{r"rawstring: {rev}"}\n' |
|
632 | $ hg debugtemplate -Ra -r0 -v '{r"rawstring: {rev}"}\n' | |
630 | (template |
|
633 | (template | |
631 | (string 'rawstring: {rev}') |
|
634 | (string 'rawstring: {rev}') | |
632 | (string '\n')) |
|
635 | (string '\n')) | |
633 | * keywords: |
|
636 | * keywords: | |
634 | * functions: |
|
637 | * functions: | |
635 | rawstring: {rev} |
|
638 | rawstring: {rev} | |
636 | $ hg debugtemplate -Ra -r0 -v '{files % r"rawstring: {file}"}\n' |
|
639 | $ hg debugtemplate -Ra -r0 -v '{files % r"rawstring: {file}"}\n' | |
637 | (template |
|
640 | (template | |
638 | (% |
|
641 | (% | |
639 | (symbol 'files') |
|
642 | (symbol 'files') | |
640 | (string 'rawstring: {file}')) |
|
643 | (string 'rawstring: {file}')) | |
641 | (string '\n')) |
|
644 | (string '\n')) | |
642 | * keywords: files |
|
645 | * keywords: files | |
643 | * functions: |
|
646 | * functions: | |
644 | rawstring: {file} |
|
647 | rawstring: {file} | |
645 |
|
648 | |||
646 | Test string escaping: |
|
649 | Test string escaping: | |
647 |
|
650 | |||
648 | $ hg log -R latesttag -r 0 --template '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n' |
|
651 | $ hg log -R latesttag -r 0 --template '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n' | |
649 | > |
|
652 | > | |
650 | <>\n<[> |
|
653 | <>\n<[> | |
651 | <>\n<]> |
|
654 | <>\n<]> | |
652 | <>\n< |
|
655 | <>\n< | |
653 |
|
656 | |||
654 | $ hg log -R latesttag -r 0 \ |
|
657 | $ hg log -R latesttag -r 0 \ | |
655 | > --config ui.logtemplate='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n' |
|
658 | > --config ui.logtemplate='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n' | |
656 | > |
|
659 | > | |
657 | <>\n<[> |
|
660 | <>\n<[> | |
658 | <>\n<]> |
|
661 | <>\n<]> | |
659 | <>\n< |
|
662 | <>\n< | |
660 |
|
663 | |||
661 | $ hg log -R latesttag -r 0 -T esc \ |
|
664 | $ hg log -R latesttag -r 0 -T esc \ | |
662 | > --config templates.esc='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n' |
|
665 | > --config templates.esc='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n' | |
663 | > |
|
666 | > | |
664 | <>\n<[> |
|
667 | <>\n<[> | |
665 | <>\n<]> |
|
668 | <>\n<]> | |
666 | <>\n< |
|
669 | <>\n< | |
667 |
|
670 | |||
668 | $ cat <<'EOF' > esctmpl |
|
671 | $ cat <<'EOF' > esctmpl | |
669 | > changeset = '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n' |
|
672 | > changeset = '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n' | |
670 | > EOF |
|
673 | > EOF | |
671 | $ hg log -R latesttag -r 0 --style ./esctmpl |
|
674 | $ hg log -R latesttag -r 0 --style ./esctmpl | |
672 | > |
|
675 | > | |
673 | <>\n<[> |
|
676 | <>\n<[> | |
674 | <>\n<]> |
|
677 | <>\n<]> | |
675 | <>\n< |
|
678 | <>\n< | |
676 |
|
679 | |||
677 | Test string escaping of quotes: |
|
680 | Test string escaping of quotes: | |
678 |
|
681 | |||
679 | $ hg log -Ra -r0 -T '{"\""}\n' |
|
682 | $ hg log -Ra -r0 -T '{"\""}\n' | |
680 | " |
|
683 | " | |
681 | $ hg log -Ra -r0 -T '{"\\\""}\n' |
|
684 | $ hg log -Ra -r0 -T '{"\\\""}\n' | |
682 | \" |
|
685 | \" | |
683 | $ hg log -Ra -r0 -T '{r"\""}\n' |
|
686 | $ hg log -Ra -r0 -T '{r"\""}\n' | |
684 | \" |
|
687 | \" | |
685 | $ hg log -Ra -r0 -T '{r"\\\""}\n' |
|
688 | $ hg log -Ra -r0 -T '{r"\\\""}\n' | |
686 | \\\" |
|
689 | \\\" | |
687 |
|
690 | |||
688 |
|
691 | |||
689 | $ hg log -Ra -r0 -T '{"\""}\n' |
|
692 | $ hg log -Ra -r0 -T '{"\""}\n' | |
690 | " |
|
693 | " | |
691 | $ hg log -Ra -r0 -T '{"\\\""}\n' |
|
694 | $ hg log -Ra -r0 -T '{"\\\""}\n' | |
692 | \" |
|
695 | \" | |
693 | $ hg log -Ra -r0 -T '{r"\""}\n' |
|
696 | $ hg log -Ra -r0 -T '{r"\""}\n' | |
694 | \" |
|
697 | \" | |
695 | $ hg log -Ra -r0 -T '{r"\\\""}\n' |
|
698 | $ hg log -Ra -r0 -T '{r"\\\""}\n' | |
696 | \\\" |
|
699 | \\\" | |
697 |
|
700 | |||
698 | Test exception in quoted template. single backslash before quotation mark is |
|
701 | Test exception in quoted template. single backslash before quotation mark is | |
699 | stripped before parsing: |
|
702 | stripped before parsing: | |
700 |
|
703 | |||
701 | $ cat <<'EOF' > escquotetmpl |
|
704 | $ cat <<'EOF' > escquotetmpl | |
702 | > changeset = "\" \\" \\\" \\\\" {files % \"{file}\"}\n" |
|
705 | > changeset = "\" \\" \\\" \\\\" {files % \"{file}\"}\n" | |
703 | > EOF |
|
706 | > EOF | |
704 | $ cd latesttag |
|
707 | $ cd latesttag | |
705 | $ hg log -r 2 --style ../escquotetmpl |
|
708 | $ hg log -r 2 --style ../escquotetmpl | |
706 | " \" \" \\" head1 |
|
709 | " \" \" \\" head1 | |
707 |
|
710 | |||
708 | $ hg log -r 2 -T esc --config templates.esc='"{\"valid\"}\n"' |
|
711 | $ hg log -r 2 -T esc --config templates.esc='"{\"valid\"}\n"' | |
709 | valid |
|
712 | valid | |
710 | $ hg log -r 2 -T esc --config templates.esc="'"'{\'"'"'valid\'"'"'}\n'"'" |
|
713 | $ hg log -r 2 -T esc --config templates.esc="'"'{\'"'"'valid\'"'"'}\n'"'" | |
711 | valid |
|
714 | valid | |
712 |
|
715 | |||
713 | Test compatibility with 2.9.2-3.4 of escaped quoted strings in nested |
|
716 | Test compatibility with 2.9.2-3.4 of escaped quoted strings in nested | |
714 | _evalifliteral() templates (issue4733): |
|
717 | _evalifliteral() templates (issue4733): | |
715 |
|
718 | |||
716 | $ hg log -r 2 -T '{if(rev, "\"{rev}")}\n' |
|
719 | $ hg log -r 2 -T '{if(rev, "\"{rev}")}\n' | |
717 | "2 |
|
720 | "2 | |
718 | $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\"{rev}\")}")}\n' |
|
721 | $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\"{rev}\")}")}\n' | |
719 | "2 |
|
722 | "2 | |
720 | $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\"{rev}\\\")}\")}")}\n' |
|
723 | $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\"{rev}\\\")}\")}")}\n' | |
721 | "2 |
|
724 | "2 | |
722 |
|
725 | |||
723 | $ hg log -r 2 -T '{if(rev, "\\\"")}\n' |
|
726 | $ hg log -r 2 -T '{if(rev, "\\\"")}\n' | |
724 | \" |
|
727 | \" | |
725 | $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\\\\\"\")}")}\n' |
|
728 | $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\\\\\"\")}")}\n' | |
726 | \" |
|
729 | \" | |
727 | $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n' |
|
730 | $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n' | |
728 | \" |
|
731 | \" | |
729 |
|
732 | |||
730 | $ hg log -r 2 -T '{if(rev, r"\\\"")}\n' |
|
733 | $ hg log -r 2 -T '{if(rev, r"\\\"")}\n' | |
731 | \\\" |
|
734 | \\\" | |
732 | $ hg log -r 2 -T '{if(rev, "{if(rev, r\"\\\\\\\"\")}")}\n' |
|
735 | $ hg log -r 2 -T '{if(rev, "{if(rev, r\"\\\\\\\"\")}")}\n' | |
733 | \\\" |
|
736 | \\\" | |
734 | $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, r\\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n' |
|
737 | $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, r\\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n' | |
735 | \\\" |
|
738 | \\\" | |
736 |
|
739 | |||
737 | escaped single quotes and errors: |
|
740 | escaped single quotes and errors: | |
738 |
|
741 | |||
739 | $ hg log -r 2 -T "{if(rev, '{if(rev, \'foo\')}')}"'\n' |
|
742 | $ hg log -r 2 -T "{if(rev, '{if(rev, \'foo\')}')}"'\n' | |
740 | foo |
|
743 | foo | |
741 | $ hg log -r 2 -T "{if(rev, '{if(rev, r\'foo\')}')}"'\n' |
|
744 | $ hg log -r 2 -T "{if(rev, '{if(rev, r\'foo\')}')}"'\n' | |
742 | foo |
|
745 | foo | |
743 | $ hg log -r 2 -T '{if(rev, "{if(rev, \")}")}\n' |
|
746 | $ hg log -r 2 -T '{if(rev, "{if(rev, \")}")}\n' | |
744 | hg: parse error at 21: unterminated string |
|
747 | hg: parse error at 21: unterminated string | |
745 | ({if(rev, "{if(rev, \")}")}\n |
|
748 | ({if(rev, "{if(rev, \")}")}\n | |
746 | ^ here) |
|
749 | ^ here) | |
747 | [255] |
|
750 | [255] | |
748 | $ hg log -r 2 -T '{if(rev, \"\\"")}\n' |
|
751 | $ hg log -r 2 -T '{if(rev, \"\\"")}\n' | |
749 | hg: parse error: trailing \ in string |
|
752 | hg: parse error: trailing \ in string | |
750 | [255] |
|
753 | [255] | |
751 | $ hg log -r 2 -T '{if(rev, r\"\\"")}\n' |
|
754 | $ hg log -r 2 -T '{if(rev, r\"\\"")}\n' | |
752 | hg: parse error: trailing \ in string |
|
755 | hg: parse error: trailing \ in string | |
753 | [255] |
|
756 | [255] | |
754 |
|
757 | |||
755 | $ cd .. |
|
758 | $ cd .. | |
756 |
|
759 | |||
757 | Test leading backslashes: |
|
760 | Test leading backslashes: | |
758 |
|
761 | |||
759 | $ cd latesttag |
|
762 | $ cd latesttag | |
760 | $ hg log -r 2 -T '\{rev} {files % "\{file}"}\n' |
|
763 | $ hg log -r 2 -T '\{rev} {files % "\{file}"}\n' | |
761 | {rev} {file} |
|
764 | {rev} {file} | |
762 | $ hg log -r 2 -T '\\{rev} {files % "\\{file}"}\n' |
|
765 | $ hg log -r 2 -T '\\{rev} {files % "\\{file}"}\n' | |
763 | \2 \head1 |
|
766 | \2 \head1 | |
764 | $ hg log -r 2 -T '\\\{rev} {files % "\\\{file}"}\n' |
|
767 | $ hg log -r 2 -T '\\\{rev} {files % "\\\{file}"}\n' | |
765 | \{rev} \{file} |
|
768 | \{rev} \{file} | |
766 | $ cd .. |
|
769 | $ cd .. | |
767 |
|
770 | |||
768 | Test leading backslashes in "if" expression (issue4714): |
|
771 | Test leading backslashes in "if" expression (issue4714): | |
769 |
|
772 | |||
770 | $ cd latesttag |
|
773 | $ cd latesttag | |
771 | $ hg log -r 2 -T '{if("1", "\{rev}")} {if("1", r"\{rev}")}\n' |
|
774 | $ hg log -r 2 -T '{if("1", "\{rev}")} {if("1", r"\{rev}")}\n' | |
772 | {rev} \{rev} |
|
775 | {rev} \{rev} | |
773 | $ hg log -r 2 -T '{if("1", "\\{rev}")} {if("1", r"\\{rev}")}\n' |
|
776 | $ hg log -r 2 -T '{if("1", "\\{rev}")} {if("1", r"\\{rev}")}\n' | |
774 | \2 \\{rev} |
|
777 | \2 \\{rev} | |
775 | $ hg log -r 2 -T '{if("1", "\\\{rev}")} {if("1", r"\\\{rev}")}\n' |
|
778 | $ hg log -r 2 -T '{if("1", "\\\{rev}")} {if("1", r"\\\{rev}")}\n' | |
776 | \{rev} \\\{rev} |
|
779 | \{rev} \\\{rev} | |
777 | $ cd .. |
|
780 | $ cd .. | |
778 |
|
781 | |||
779 | "string-escape"-ed "\x5c\x786e" becomes r"\x6e" (once) or r"n" (twice) |
|
782 | "string-escape"-ed "\x5c\x786e" becomes r"\x6e" (once) or r"n" (twice) | |
780 |
|
783 | |||
781 | $ hg log -R a -r 0 --template '{if("1", "\x5c\x786e", "NG")}\n' |
|
784 | $ hg log -R a -r 0 --template '{if("1", "\x5c\x786e", "NG")}\n' | |
782 | \x6e |
|
785 | \x6e | |
783 | $ hg log -R a -r 0 --template '{if("1", r"\x5c\x786e", "NG")}\n' |
|
786 | $ hg log -R a -r 0 --template '{if("1", r"\x5c\x786e", "NG")}\n' | |
784 | \x5c\x786e |
|
787 | \x5c\x786e | |
785 | $ hg log -R a -r 0 --template '{if("", "NG", "\x5c\x786e")}\n' |
|
788 | $ hg log -R a -r 0 --template '{if("", "NG", "\x5c\x786e")}\n' | |
786 | \x6e |
|
789 | \x6e | |
787 | $ hg log -R a -r 0 --template '{if("", "NG", r"\x5c\x786e")}\n' |
|
790 | $ hg log -R a -r 0 --template '{if("", "NG", r"\x5c\x786e")}\n' | |
788 | \x5c\x786e |
|
791 | \x5c\x786e | |
789 |
|
792 | |||
790 | $ hg log -R a -r 2 --template '{ifeq("no perso\x6e", desc, "\x5c\x786e", "NG")}\n' |
|
793 | $ hg log -R a -r 2 --template '{ifeq("no perso\x6e", desc, "\x5c\x786e", "NG")}\n' | |
791 | \x6e |
|
794 | \x6e | |
792 | $ hg log -R a -r 2 --template '{ifeq(r"no perso\x6e", desc, "NG", r"\x5c\x786e")}\n' |
|
795 | $ hg log -R a -r 2 --template '{ifeq(r"no perso\x6e", desc, "NG", r"\x5c\x786e")}\n' | |
793 | \x5c\x786e |
|
796 | \x5c\x786e | |
794 | $ hg log -R a -r 2 --template '{ifeq(desc, "no perso\x6e", "\x5c\x786e", "NG")}\n' |
|
797 | $ hg log -R a -r 2 --template '{ifeq(desc, "no perso\x6e", "\x5c\x786e", "NG")}\n' | |
795 | \x6e |
|
798 | \x6e | |
796 | $ hg log -R a -r 2 --template '{ifeq(desc, r"no perso\x6e", "NG", r"\x5c\x786e")}\n' |
|
799 | $ hg log -R a -r 2 --template '{ifeq(desc, r"no perso\x6e", "NG", r"\x5c\x786e")}\n' | |
797 | \x5c\x786e |
|
800 | \x5c\x786e | |
798 |
|
801 | |||
799 | $ hg log -R a -r 8 --template '{join(files, "\n")}\n' |
|
802 | $ hg log -R a -r 8 --template '{join(files, "\n")}\n' | |
800 | fourth |
|
803 | fourth | |
801 | second |
|
804 | second | |
802 | third |
|
805 | third | |
803 | $ hg log -R a -r 8 --template '{join(files, r"\n")}\n' |
|
806 | $ hg log -R a -r 8 --template '{join(files, r"\n")}\n' | |
804 | fourth\nsecond\nthird |
|
807 | fourth\nsecond\nthird | |
805 |
|
808 | |||
806 | $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", "htm\x6c")}' |
|
809 | $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", "htm\x6c")}' | |
807 | <p> |
|
810 | <p> | |
808 | 1st |
|
811 | 1st | |
809 | </p> |
|
812 | </p> | |
810 | <p> |
|
813 | <p> | |
811 | 2nd |
|
814 | 2nd | |
812 | </p> |
|
815 | </p> | |
813 | $ hg log -R a -r 2 --template '{rstdoc(r"1st\n\n2nd", "html")}' |
|
816 | $ hg log -R a -r 2 --template '{rstdoc(r"1st\n\n2nd", "html")}' | |
814 | <p> |
|
817 | <p> | |
815 | 1st\n\n2nd |
|
818 | 1st\n\n2nd | |
816 | </p> |
|
819 | </p> | |
817 | $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", r"htm\x6c")}' |
|
820 | $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", r"htm\x6c")}' | |
818 | 1st |
|
821 | 1st | |
819 |
|
822 | |||
820 | 2nd |
|
823 | 2nd | |
821 |
|
824 | |||
822 | $ hg log -R a -r 2 --template '{strip(desc, "\x6e")}\n' |
|
825 | $ hg log -R a -r 2 --template '{strip(desc, "\x6e")}\n' | |
823 | o perso |
|
826 | o perso | |
824 | $ hg log -R a -r 2 --template '{strip(desc, r"\x6e")}\n' |
|
827 | $ hg log -R a -r 2 --template '{strip(desc, r"\x6e")}\n' | |
825 | no person |
|
828 | no person | |
826 | $ hg log -R a -r 2 --template '{strip("no perso\x6e", "\x6e")}\n' |
|
829 | $ hg log -R a -r 2 --template '{strip("no perso\x6e", "\x6e")}\n' | |
827 | o perso |
|
830 | o perso | |
828 | $ hg log -R a -r 2 --template '{strip(r"no perso\x6e", r"\x6e")}\n' |
|
831 | $ hg log -R a -r 2 --template '{strip(r"no perso\x6e", r"\x6e")}\n' | |
829 | no perso |
|
832 | no perso | |
830 |
|
833 | |||
831 | $ hg log -R a -r 2 --template '{sub("\\x6e", "\x2d", desc)}\n' |
|
834 | $ hg log -R a -r 2 --template '{sub("\\x6e", "\x2d", desc)}\n' | |
832 | -o perso- |
|
835 | -o perso- | |
833 | $ hg log -R a -r 2 --template '{sub(r"\\x6e", "-", desc)}\n' |
|
836 | $ hg log -R a -r 2 --template '{sub(r"\\x6e", "-", desc)}\n' | |
834 | no person |
|
837 | no person | |
835 | $ hg log -R a -r 2 --template '{sub("n", r"\x2d", desc)}\n' |
|
838 | $ hg log -R a -r 2 --template '{sub("n", r"\x2d", desc)}\n' | |
836 | \x2do perso\x2d |
|
839 | \x2do perso\x2d | |
837 | $ hg log -R a -r 2 --template '{sub("n", "\x2d", "no perso\x6e")}\n' |
|
840 | $ hg log -R a -r 2 --template '{sub("n", "\x2d", "no perso\x6e")}\n' | |
838 | -o perso- |
|
841 | -o perso- | |
839 | $ hg log -R a -r 2 --template '{sub("n", r"\x2d", r"no perso\x6e")}\n' |
|
842 | $ hg log -R a -r 2 --template '{sub("n", r"\x2d", r"no perso\x6e")}\n' | |
840 | \x2do perso\x6e |
|
843 | \x2do perso\x6e | |
841 |
|
844 | |||
842 | $ hg log -R a -r 8 --template '{files % "{file}\n"}' |
|
845 | $ hg log -R a -r 8 --template '{files % "{file}\n"}' | |
843 | fourth |
|
846 | fourth | |
844 | second |
|
847 | second | |
845 | third |
|
848 | third | |
846 |
|
849 | |||
847 | Test string escaping in nested expression: |
|
850 | Test string escaping in nested expression: | |
848 |
|
851 | |||
849 | $ hg log -R a -r 8 --template '{ifeq(r"\x6e", if("1", "\x5c\x786e"), join(files, "\x5c\x786e"))}\n' |
|
852 | $ hg log -R a -r 8 --template '{ifeq(r"\x6e", if("1", "\x5c\x786e"), join(files, "\x5c\x786e"))}\n' | |
850 | fourth\x6esecond\x6ethird |
|
853 | fourth\x6esecond\x6ethird | |
851 | $ hg log -R a -r 8 --template '{ifeq(if("1", r"\x6e"), "\x5c\x786e", join(files, "\x5c\x786e"))}\n' |
|
854 | $ hg log -R a -r 8 --template '{ifeq(if("1", r"\x6e"), "\x5c\x786e", join(files, "\x5c\x786e"))}\n' | |
852 | fourth\x6esecond\x6ethird |
|
855 | fourth\x6esecond\x6ethird | |
853 |
|
856 | |||
854 | $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", "\x5c\x786e"))}\n' |
|
857 | $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", "\x5c\x786e"))}\n' | |
855 | fourth\x6esecond\x6ethird |
|
858 | fourth\x6esecond\x6ethird | |
856 | $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", r"\x5c\x786e"))}\n' |
|
859 | $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", r"\x5c\x786e"))}\n' | |
857 | fourth\x5c\x786esecond\x5c\x786ethird |
|
860 | fourth\x5c\x786esecond\x5c\x786ethird | |
858 |
|
861 | |||
859 | $ hg log -R a -r 3:4 --template '{rev}:{sub(if("1", "\x6e"), ifeq(branch, "foo", r"\x5c\x786e", "\x5c\x786e"), desc)}\n' |
|
862 | $ hg log -R a -r 3:4 --template '{rev}:{sub(if("1", "\x6e"), ifeq(branch, "foo", r"\x5c\x786e", "\x5c\x786e"), desc)}\n' | |
860 | 3:\x6eo user, \x6eo domai\x6e |
|
863 | 3:\x6eo user, \x6eo domai\x6e | |
861 | 4:\x5c\x786eew bra\x5c\x786ech |
|
864 | 4:\x5c\x786eew bra\x5c\x786ech | |
862 |
|
865 | |||
863 | Test quotes in nested expression are evaluated just like a $(command) |
|
866 | Test quotes in nested expression are evaluated just like a $(command) | |
864 | substitution in POSIX shells: |
|
867 | substitution in POSIX shells: | |
865 |
|
868 | |||
866 | $ hg log -R a -r 8 -T '{"{"{rev}:{node|short}"}"}\n' |
|
869 | $ hg log -R a -r 8 -T '{"{"{rev}:{node|short}"}"}\n' | |
867 | 8:95c24699272e |
|
870 | 8:95c24699272e | |
868 | $ hg log -R a -r 8 -T '{"{"\{{rev}} \"{node|short}\""}"}\n' |
|
871 | $ hg log -R a -r 8 -T '{"{"\{{rev}} \"{node|short}\""}"}\n' | |
869 | {8} "95c24699272e" |
|
872 | {8} "95c24699272e" | |
870 |
|
873 | |||
871 | Test recursive evaluation: |
|
874 | Test recursive evaluation: | |
872 |
|
875 | |||
873 | $ hg init r |
|
876 | $ hg init r | |
874 | $ cd r |
|
877 | $ cd r | |
875 | $ echo a > a |
|
878 | $ echo a > a | |
876 | $ hg ci -Am '{rev}' |
|
879 | $ hg ci -Am '{rev}' | |
877 | adding a |
|
880 | adding a | |
878 | $ hg log -r 0 --template '{if(rev, desc)}\n' |
|
881 | $ hg log -r 0 --template '{if(rev, desc)}\n' | |
879 | {rev} |
|
882 | {rev} | |
880 | $ hg log -r 0 --template '{if(rev, "{author} {rev}")}\n' |
|
883 | $ hg log -r 0 --template '{if(rev, "{author} {rev}")}\n' | |
881 | test 0 |
|
884 | test 0 | |
882 |
|
885 | |||
883 | $ hg branch -q 'text.{rev}' |
|
886 | $ hg branch -q 'text.{rev}' | |
884 | $ echo aa >> aa |
|
887 | $ echo aa >> aa | |
885 | $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped' |
|
888 | $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped' | |
886 |
|
889 | |||
887 | $ hg log -l1 --template '{fill(desc, "20", author, branch)}' |
|
890 | $ hg log -l1 --template '{fill(desc, "20", author, branch)}' | |
888 | {node|short}desc to |
|
891 | {node|short}desc to | |
889 | text.{rev}be wrapped |
|
892 | text.{rev}be wrapped | |
890 | text.{rev}desc to be |
|
893 | text.{rev}desc to be | |
891 | text.{rev}wrapped (no-eol) |
|
894 | text.{rev}wrapped (no-eol) | |
892 | $ hg log -l1 --template '{fill(desc, "20", "{node|short}:", "text.{rev}:")}' |
|
895 | $ hg log -l1 --template '{fill(desc, "20", "{node|short}:", "text.{rev}:")}' | |
893 | bcc7ff960b8e:desc to |
|
896 | bcc7ff960b8e:desc to | |
894 | text.1:be wrapped |
|
897 | text.1:be wrapped | |
895 | text.1:desc to be |
|
898 | text.1:desc to be | |
896 | text.1:wrapped (no-eol) |
|
899 | text.1:wrapped (no-eol) | |
897 | $ hg log -l1 -T '{fill(desc, date, "", "")}\n' |
|
900 | $ hg log -l1 -T '{fill(desc, date, "", "")}\n' | |
898 | hg: parse error: fill expects an integer width |
|
901 | hg: parse error: fill expects an integer width | |
899 | [255] |
|
902 | [255] | |
900 |
|
903 | |||
901 | $ hg log -l 1 --template '{sub(r"[0-9]", "-", author)}' |
|
904 | $ hg log -l 1 --template '{sub(r"[0-9]", "-", author)}' | |
902 | {node|short} (no-eol) |
|
905 | {node|short} (no-eol) | |
903 | $ hg log -l 1 --template '{sub(r"[0-9]", "-", "{node|short}")}' |
|
906 | $ hg log -l 1 --template '{sub(r"[0-9]", "-", "{node|short}")}' | |
904 | bcc-ff---b-e (no-eol) |
|
907 | bcc-ff---b-e (no-eol) | |
905 |
|
908 | |||
906 | $ cat >> .hg/hgrc <<EOF |
|
909 | $ cat >> .hg/hgrc <<EOF | |
907 | > [extensions] |
|
910 | > [extensions] | |
908 | > color= |
|
911 | > color= | |
909 | > [color] |
|
912 | > [color] | |
910 | > mode=ansi |
|
913 | > mode=ansi | |
911 | > text.{rev} = red |
|
914 | > text.{rev} = red | |
912 | > text.1 = green |
|
915 | > text.1 = green | |
913 | > EOF |
|
916 | > EOF | |
914 | $ hg log --color=always -l 1 --template '{label(branch, "text\n")}' |
|
917 | $ hg log --color=always -l 1 --template '{label(branch, "text\n")}' | |
915 | \x1b[0;31mtext\x1b[0m (esc) |
|
918 | \x1b[0;31mtext\x1b[0m (esc) | |
916 | $ hg log --color=always -l 1 --template '{label("text.{rev}", "text\n")}' |
|
919 | $ hg log --color=always -l 1 --template '{label("text.{rev}", "text\n")}' | |
917 | \x1b[0;32mtext\x1b[0m (esc) |
|
920 | \x1b[0;32mtext\x1b[0m (esc) | |
918 |
|
921 | |||
919 | $ cd .. |
|
922 | $ cd .. | |
920 |
|
923 | |||
921 | Test bad template with better error message |
|
924 | Test bad template with better error message | |
922 |
|
925 | |||
923 | $ hg log -Gv -R a --template '{desc|user()}' |
|
926 | $ hg log -Gv -R a --template '{desc|user()}' | |
924 | hg: parse error: expected a symbol, got 'func' |
|
927 | hg: parse error: expected a symbol, got 'func' | |
925 | [255] |
|
928 | [255] | |
926 |
|
929 | |||
927 | Test broken string escapes: |
|
930 | Test broken string escapes: | |
928 |
|
931 | |||
929 | $ hg log -T "bogus\\" -R a |
|
932 | $ hg log -T "bogus\\" -R a | |
930 | hg: parse error: trailing \ in string |
|
933 | hg: parse error: trailing \ in string | |
931 | [255] |
|
934 | [255] | |
932 | $ hg log -T "\\xy" -R a |
|
935 | $ hg log -T "\\xy" -R a | |
933 | hg: parse error: invalid \x escape* (glob) |
|
936 | hg: parse error: invalid \x escape* (glob) | |
934 | [255] |
|
937 | [255] | |
935 |
|
938 | |||
936 | Templater supports aliases of symbol and func() styles: |
|
939 | Templater supports aliases of symbol and func() styles: | |
937 |
|
940 | |||
938 | $ hg clone -q a aliases |
|
941 | $ hg clone -q a aliases | |
939 | $ cd aliases |
|
942 | $ cd aliases | |
940 | $ cat <<EOF >> .hg/hgrc |
|
943 | $ cat <<EOF >> .hg/hgrc | |
941 | > [templatealias] |
|
944 | > [templatealias] | |
942 | > r = rev |
|
945 | > r = rev | |
943 | > rn = "{r}:{node|short}" |
|
946 | > rn = "{r}:{node|short}" | |
944 | > status(c, files) = files % "{c} {file}\n" |
|
947 | > status(c, files) = files % "{c} {file}\n" | |
945 | > utcdate(d) = localdate(d, "UTC") |
|
948 | > utcdate(d) = localdate(d, "UTC") | |
946 | > EOF |
|
949 | > EOF | |
947 |
|
950 | |||
948 | $ hg debugtemplate -vr0 '{rn} {utcdate(date)|isodate}\n' |
|
951 | $ hg debugtemplate -vr0 '{rn} {utcdate(date)|isodate}\n' | |
949 | (template |
|
952 | (template | |
950 | (symbol 'rn') |
|
953 | (symbol 'rn') | |
951 | (string ' ') |
|
954 | (string ' ') | |
952 | (| |
|
955 | (| | |
953 | (func |
|
956 | (func | |
954 | (symbol 'utcdate') |
|
957 | (symbol 'utcdate') | |
955 | (symbol 'date')) |
|
958 | (symbol 'date')) | |
956 | (symbol 'isodate')) |
|
959 | (symbol 'isodate')) | |
957 | (string '\n')) |
|
960 | (string '\n')) | |
958 | * expanded: |
|
961 | * expanded: | |
959 | (template |
|
962 | (template | |
960 | (template |
|
963 | (template | |
961 | (symbol 'rev') |
|
964 | (symbol 'rev') | |
962 | (string ':') |
|
965 | (string ':') | |
963 | (| |
|
966 | (| | |
964 | (symbol 'node') |
|
967 | (symbol 'node') | |
965 | (symbol 'short'))) |
|
968 | (symbol 'short'))) | |
966 | (string ' ') |
|
969 | (string ' ') | |
967 | (| |
|
970 | (| | |
968 | (func |
|
971 | (func | |
969 | (symbol 'localdate') |
|
972 | (symbol 'localdate') | |
970 | (list |
|
973 | (list | |
971 | (symbol 'date') |
|
974 | (symbol 'date') | |
972 | (string 'UTC'))) |
|
975 | (string 'UTC'))) | |
973 | (symbol 'isodate')) |
|
976 | (symbol 'isodate')) | |
974 | (string '\n')) |
|
977 | (string '\n')) | |
975 | * keywords: date, node, rev |
|
978 | * keywords: date, node, rev | |
976 | * functions: isodate, localdate, short |
|
979 | * functions: isodate, localdate, short | |
977 | 0:1e4e1b8f71e0 1970-01-12 13:46 +0000 |
|
980 | 0:1e4e1b8f71e0 1970-01-12 13:46 +0000 | |
978 |
|
981 | |||
979 | $ hg debugtemplate -vr0 '{status("A", file_adds)}' |
|
982 | $ hg debugtemplate -vr0 '{status("A", file_adds)}' | |
980 | (template |
|
983 | (template | |
981 | (func |
|
984 | (func | |
982 | (symbol 'status') |
|
985 | (symbol 'status') | |
983 | (list |
|
986 | (list | |
984 | (string 'A') |
|
987 | (string 'A') | |
985 | (symbol 'file_adds')))) |
|
988 | (symbol 'file_adds')))) | |
986 | * expanded: |
|
989 | * expanded: | |
987 | (template |
|
990 | (template | |
988 | (% |
|
991 | (% | |
989 | (symbol 'file_adds') |
|
992 | (symbol 'file_adds') | |
990 | (template |
|
993 | (template | |
991 | (string 'A') |
|
994 | (string 'A') | |
992 | (string ' ') |
|
995 | (string ' ') | |
993 | (symbol 'file') |
|
996 | (symbol 'file') | |
994 | (string '\n')))) |
|
997 | (string '\n')))) | |
995 | * keywords: file, file_adds |
|
998 | * keywords: file, file_adds | |
996 | * functions: |
|
999 | * functions: | |
997 | A a |
|
1000 | A a | |
998 |
|
1001 | |||
999 | A unary function alias can be called as a filter: |
|
1002 | A unary function alias can be called as a filter: | |
1000 |
|
1003 | |||
1001 | $ hg debugtemplate -vr0 '{date|utcdate|isodate}\n' |
|
1004 | $ hg debugtemplate -vr0 '{date|utcdate|isodate}\n' | |
1002 | (template |
|
1005 | (template | |
1003 | (| |
|
1006 | (| | |
1004 | (| |
|
1007 | (| | |
1005 | (symbol 'date') |
|
1008 | (symbol 'date') | |
1006 | (symbol 'utcdate')) |
|
1009 | (symbol 'utcdate')) | |
1007 | (symbol 'isodate')) |
|
1010 | (symbol 'isodate')) | |
1008 | (string '\n')) |
|
1011 | (string '\n')) | |
1009 | * expanded: |
|
1012 | * expanded: | |
1010 | (template |
|
1013 | (template | |
1011 | (| |
|
1014 | (| | |
1012 | (func |
|
1015 | (func | |
1013 | (symbol 'localdate') |
|
1016 | (symbol 'localdate') | |
1014 | (list |
|
1017 | (list | |
1015 | (symbol 'date') |
|
1018 | (symbol 'date') | |
1016 | (string 'UTC'))) |
|
1019 | (string 'UTC'))) | |
1017 | (symbol 'isodate')) |
|
1020 | (symbol 'isodate')) | |
1018 | (string '\n')) |
|
1021 | (string '\n')) | |
1019 | * keywords: date |
|
1022 | * keywords: date | |
1020 | * functions: isodate, localdate |
|
1023 | * functions: isodate, localdate | |
1021 | 1970-01-12 13:46 +0000 |
|
1024 | 1970-01-12 13:46 +0000 | |
1022 |
|
1025 | |||
1023 | Aliases should be applied only to command arguments and templates in hgrc. |
|
1026 | Aliases should be applied only to command arguments and templates in hgrc. | |
1024 | Otherwise, our stock styles and web templates could be corrupted: |
|
1027 | Otherwise, our stock styles and web templates could be corrupted: | |
1025 |
|
1028 | |||
1026 | $ hg log -r0 -T '{rn} {utcdate(date)|isodate}\n' |
|
1029 | $ hg log -r0 -T '{rn} {utcdate(date)|isodate}\n' | |
1027 | 0:1e4e1b8f71e0 1970-01-12 13:46 +0000 |
|
1030 | 0:1e4e1b8f71e0 1970-01-12 13:46 +0000 | |
1028 |
|
1031 | |||
1029 | $ hg log -r0 --config ui.logtemplate='"{rn} {utcdate(date)|isodate}\n"' |
|
1032 | $ hg log -r0 --config ui.logtemplate='"{rn} {utcdate(date)|isodate}\n"' | |
1030 | 0:1e4e1b8f71e0 1970-01-12 13:46 +0000 |
|
1033 | 0:1e4e1b8f71e0 1970-01-12 13:46 +0000 | |
1031 |
|
1034 | |||
1032 | $ cat <<EOF > tmpl |
|
1035 | $ cat <<EOF > tmpl | |
1033 | > changeset = 'nothing expanded:{rn}\n' |
|
1036 | > changeset = 'nothing expanded:{rn}\n' | |
1034 | > EOF |
|
1037 | > EOF | |
1035 | $ hg log -r0 --style ./tmpl |
|
1038 | $ hg log -r0 --style ./tmpl | |
1036 | nothing expanded: |
|
1039 | nothing expanded: | |
1037 |
|
1040 | |||
1038 | Aliases in formatter: |
|
1041 | Aliases in formatter: | |
1039 |
|
1042 | |||
1040 | $ hg branches -T '{pad(branch, 7)} {rn}\n' |
|
1043 | $ hg branches -T '{pad(branch, 7)} {rn}\n' | |
1041 | default 6:d41e714fe50d |
|
1044 | default 6:d41e714fe50d | |
1042 | foo 4:bbe44766e73d |
|
1045 | foo 4:bbe44766e73d | |
1043 |
|
1046 | |||
1044 | Aliases should honor HGPLAIN: |
|
1047 | Aliases should honor HGPLAIN: | |
1045 |
|
1048 | |||
1046 | $ HGPLAIN= hg log -r0 -T 'nothing expanded:{rn}\n' |
|
1049 | $ HGPLAIN= hg log -r0 -T 'nothing expanded:{rn}\n' | |
1047 | nothing expanded: |
|
1050 | nothing expanded: | |
1048 | $ HGPLAINEXCEPT=templatealias hg log -r0 -T '{rn}\n' |
|
1051 | $ HGPLAINEXCEPT=templatealias hg log -r0 -T '{rn}\n' | |
1049 | 0:1e4e1b8f71e0 |
|
1052 | 0:1e4e1b8f71e0 | |
1050 |
|
1053 | |||
1051 | Unparsable alias: |
|
1054 | Unparsable alias: | |
1052 |
|
1055 | |||
1053 | $ hg debugtemplate --config templatealias.bad='x(' -v '{bad}' |
|
1056 | $ hg debugtemplate --config templatealias.bad='x(' -v '{bad}' | |
1054 | (template |
|
1057 | (template | |
1055 | (symbol 'bad')) |
|
1058 | (symbol 'bad')) | |
1056 | abort: bad definition of template alias "bad": at 2: not a prefix: end |
|
1059 | abort: bad definition of template alias "bad": at 2: not a prefix: end | |
1057 | [255] |
|
1060 | [255] | |
1058 | $ hg log --config templatealias.bad='x(' -T '{bad}' |
|
1061 | $ hg log --config templatealias.bad='x(' -T '{bad}' | |
1059 | abort: bad definition of template alias "bad": at 2: not a prefix: end |
|
1062 | abort: bad definition of template alias "bad": at 2: not a prefix: end | |
1060 | [255] |
|
1063 | [255] | |
1061 |
|
1064 | |||
1062 | $ cd .. |
|
1065 | $ cd .. | |
1063 |
|
1066 | |||
1064 | Test that template function in extension is registered as expected |
|
1067 | Test that template function in extension is registered as expected | |
1065 |
|
1068 | |||
1066 | $ cd a |
|
1069 | $ cd a | |
1067 |
|
1070 | |||
1068 | $ cat <<EOF > $TESTTMP/customfunc.py |
|
1071 | $ cat <<EOF > $TESTTMP/customfunc.py | |
1069 | > from mercurial import registrar |
|
1072 | > from mercurial import registrar | |
1070 | > |
|
1073 | > | |
1071 | > templatefunc = registrar.templatefunc() |
|
1074 | > templatefunc = registrar.templatefunc() | |
1072 | > |
|
1075 | > | |
1073 | > @templatefunc(b'custom()') |
|
1076 | > @templatefunc(b'custom()') | |
1074 | > def custom(context, mapping, args): |
|
1077 | > def custom(context, mapping, args): | |
1075 | > return b'custom' |
|
1078 | > return b'custom' | |
1076 | > EOF |
|
1079 | > EOF | |
1077 | $ cat <<EOF > .hg/hgrc |
|
1080 | $ cat <<EOF > .hg/hgrc | |
1078 | > [extensions] |
|
1081 | > [extensions] | |
1079 | > customfunc = $TESTTMP/customfunc.py |
|
1082 | > customfunc = $TESTTMP/customfunc.py | |
1080 | > EOF |
|
1083 | > EOF | |
1081 |
|
1084 | |||
1082 | $ hg log -r . -T "{custom()}\n" --config customfunc.enabled=true |
|
1085 | $ hg log -r . -T "{custom()}\n" --config customfunc.enabled=true | |
1083 | custom |
|
1086 | custom | |
1084 |
|
1087 | |||
1085 | $ cd .. |
|
1088 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now