Show More
@@ -1,788 +1,789 | |||
|
1 | 1 | test-abort-checkin.t |
|
2 | 2 | test-absorb-edit-lines.t |
|
3 | 3 | test-absorb-filefixupstate.py |
|
4 | 4 | test-absorb-phase.t |
|
5 | 5 | test-absorb-rename.t |
|
6 | 6 | test-absorb-strip.t |
|
7 | 7 | test-absorb-unfinished.t |
|
8 | 8 | test-absorb.t |
|
9 | 9 | test-acl.t |
|
10 | 10 | test-add.t |
|
11 | 11 | test-addremove-similar.t |
|
12 | 12 | test-addremove.t |
|
13 | 13 | test-alias.t |
|
14 | 14 | test-amend-subrepo.t |
|
15 | 15 | test-amend.t |
|
16 | 16 | test-ancestor.py |
|
17 | 17 | test-annotate.py |
|
18 | 18 | test-annotate.t |
|
19 | 19 | test-arbitraryfilectx.t |
|
20 | 20 | test-archive-symlinks.t |
|
21 | 21 | test-archive.t |
|
22 | 22 | test-atomictempfile.py |
|
23 | 23 | test-audit-path.t |
|
24 | 24 | test-audit-subrepo.t |
|
25 | 25 | test-automv.t |
|
26 | 26 | test-backout.t |
|
27 | 27 | test-backwards-remove.t |
|
28 | 28 | test-bad-extension.t |
|
29 | 29 | test-bad-pull.t |
|
30 | 30 | test-basic.t |
|
31 | 31 | test-batching.py |
|
32 | 32 | test-bdiff.py |
|
33 | 33 | test-bheads.t |
|
34 | 34 | test-bisect.t |
|
35 | 35 | test-bisect2.t |
|
36 | 36 | test-bisect3.t |
|
37 | 37 | test-blackbox.t |
|
38 | 38 | test-bookflow.t |
|
39 | 39 | test-bookmarks-corner-case.t |
|
40 | 40 | test-bookmarks-current.t |
|
41 | 41 | test-bookmarks-merge.t |
|
42 | 42 | test-bookmarks-pushpull.t |
|
43 | 43 | test-bookmarks-rebase.t |
|
44 | 44 | test-bookmarks-strip.t |
|
45 | 45 | test-bookmarks.t |
|
46 | 46 | test-branch-change.t |
|
47 | 47 | test-branch-option.t |
|
48 | 48 | test-branch-tag-confict.t |
|
49 | 49 | test-branches.t |
|
50 | 50 | test-bugzilla.t |
|
51 | 51 | test-bundle-phases.t |
|
52 | 52 | test-bundle-r.t |
|
53 | 53 | test-bundle-type.t |
|
54 | 54 | test-bundle-vs-outgoing.t |
|
55 | 55 | test-bundle.t |
|
56 | 56 | test-bundle2-exchange.t |
|
57 | 57 | test-bundle2-format.t |
|
58 | 58 | test-bundle2-multiple-changegroups.t |
|
59 | 59 | test-bundle2-pushback.t |
|
60 | 60 | test-bundle2-remote-changegroup.t |
|
61 | 61 | test-cache-abuse.t |
|
62 | 62 | test-cappedreader.py |
|
63 | 63 | test-casecollision-merge.t |
|
64 | 64 | test-casecollision.t |
|
65 | 65 | test-casefolding.t |
|
66 | 66 | test-cat.t |
|
67 | 67 | test-cbor.py |
|
68 | 68 | test-censor.t |
|
69 | 69 | test-changelog-exec.t |
|
70 | 70 | test-check-code.t |
|
71 | 71 | test-check-commit.t |
|
72 | 72 | test-check-config.t |
|
73 | 73 | test-check-execute.t |
|
74 | 74 | test-check-help.t |
|
75 | 75 | test-check-interfaces.py |
|
76 | 76 | test-check-module-imports.t |
|
77 | 77 | test-check-py3-compat.t |
|
78 | 78 | test-check-pyflakes.t |
|
79 | 79 | test-check-pylint.t |
|
80 | 80 | test-check-shbang.t |
|
81 | 81 | test-children.t |
|
82 | 82 | test-churn.t |
|
83 | 83 | test-clone-cgi.t |
|
84 | 84 | test-clone-pull-corruption.t |
|
85 | 85 | test-clone-r.t |
|
86 | 86 | test-clone-uncompressed.t |
|
87 | 87 | test-clone-update-order.t |
|
88 | 88 | test-clone.t |
|
89 | 89 | test-clonebundles.t |
|
90 | 90 | test-close-head.t |
|
91 | 91 | test-commandserver.t |
|
92 | 92 | test-commit-amend.t |
|
93 | 93 | test-commit-interactive-curses.t |
|
94 | 94 | test-commit-interactive.t |
|
95 | 95 | test-commit-multiple.t |
|
96 | 96 | test-commit-unresolved.t |
|
97 | 97 | test-commit.t |
|
98 | 98 | test-committer.t |
|
99 | 99 | test-completion.t |
|
100 | 100 | test-config-env.py |
|
101 | 101 | test-config.t |
|
102 | 102 | test-conflict.t |
|
103 | 103 | test-confused-revert.t |
|
104 | 104 | test-context-metadata.t |
|
105 | 105 | test-context.py |
|
106 | 106 | test-contrib-check-code.t |
|
107 | 107 | test-contrib-check-commit.t |
|
108 | 108 | test-contrib-dumprevlog.t |
|
109 | 109 | test-contrib-emacs.t |
|
110 | 110 | test-contrib-perf.t |
|
111 | 111 | test-contrib-relnotes.t |
|
112 | 112 | test-contrib-testparseutil.t |
|
113 | 113 | test-contrib.t |
|
114 | 114 | test-convert-authormap.t |
|
115 | 115 | test-convert-clonebranches.t |
|
116 | 116 | test-convert-cvs-branch.t |
|
117 | 117 | test-convert-cvs-detectmerge.t |
|
118 | 118 | test-convert-cvs-synthetic.t |
|
119 | 119 | test-convert-cvs.t |
|
120 | 120 | test-convert-cvsnt-mergepoints.t |
|
121 | 121 | test-convert-datesort.t |
|
122 | 122 | test-convert-filemap.t |
|
123 | 123 | test-convert-git.t |
|
124 | 124 | test-convert-hg-sink.t |
|
125 | 125 | test-convert-hg-source.t |
|
126 | 126 | test-convert-hg-startrev.t |
|
127 | 127 | test-convert-identity.t |
|
128 | 128 | test-convert-mtn.t |
|
129 | 129 | test-convert-splicemap.t |
|
130 | 130 | test-convert-svn-sink.t |
|
131 | 131 | test-convert-tagsbranch-topology.t |
|
132 | 132 | test-convert.t |
|
133 | 133 | test-copies-in-changeset.t |
|
134 | 134 | test-copies-unrelated.t |
|
135 | 135 | test-copies.t |
|
136 | 136 | test-copy-move-merge.t |
|
137 | 137 | test-copy.t |
|
138 | 138 | test-copytrace-heuristics.t |
|
139 | 139 | test-custom-filters.t |
|
140 | 140 | test-debugbuilddag.t |
|
141 | 141 | test-debugbundle.t |
|
142 | 142 | test-debugcommands.t |
|
143 | 143 | test-debugextensions.t |
|
144 | 144 | test-debugindexdot.t |
|
145 | 145 | test-debugrename.t |
|
146 | 146 | test-default-push.t |
|
147 | 147 | test-demandimport.py |
|
148 | 148 | test-devel-warnings.t |
|
149 | 149 | test-diff-antipatience.t |
|
150 | 150 | test-diff-binary-file.t |
|
151 | 151 | test-diff-change.t |
|
152 | 152 | test-diff-color.t |
|
153 | 153 | test-diff-copy-depth.t |
|
154 | 154 | test-diff-hashes.t |
|
155 | 155 | test-diff-ignore-whitespace.t |
|
156 | 156 | test-diff-indent-heuristic.t |
|
157 | 157 | test-diff-issue2761.t |
|
158 | 158 | test-diff-newlines.t |
|
159 | 159 | test-diff-reverse.t |
|
160 | 160 | test-diff-subdir.t |
|
161 | 161 | test-diff-unified.t |
|
162 | 162 | test-diff-upgrade.t |
|
163 | 163 | test-diffdir.t |
|
164 | 164 | test-diffstat.t |
|
165 | 165 | test-directaccess.t |
|
166 | 166 | test-dirstate-backup.t |
|
167 | 167 | test-dirstate-nonnormalset.t |
|
168 | 168 | test-dirstate-race.t |
|
169 | 169 | test-dirstate-race2.t |
|
170 | 170 | test-dirstate.t |
|
171 | 171 | test-dispatch.py |
|
172 | 172 | test-dispatch.t |
|
173 | 173 | test-doctest.py |
|
174 | 174 | test-double-merge.t |
|
175 | 175 | test-drawdag.t |
|
176 | 176 | test-duplicateoptions.py |
|
177 | 177 | test-editor-filename.t |
|
178 | 178 | test-empty-dir.t |
|
179 | 179 | test-empty-file.t |
|
180 | 180 | test-empty-group.t |
|
181 | 181 | test-empty.t |
|
182 | 182 | test-encode.t |
|
183 | 183 | test-encoding-align.t |
|
184 | 184 | test-encoding-func.py |
|
185 | 185 | test-encoding-textwrap.t |
|
186 | 186 | test-encoding.t |
|
187 | 187 | test-eol-add.t |
|
188 | 188 | test-eol-clone.t |
|
189 | 189 | test-eol-hook.t |
|
190 | 190 | test-eol-patch.t |
|
191 | 191 | test-eol-tag.t |
|
192 | 192 | test-eol-update.t |
|
193 | 193 | test-eol.t |
|
194 | 194 | test-eolfilename.t |
|
195 | 195 | test-excessive-merge.t |
|
196 | 196 | test-exchange-obsmarkers-case-A1.t |
|
197 | 197 | test-exchange-obsmarkers-case-A2.t |
|
198 | 198 | test-exchange-obsmarkers-case-A3.t |
|
199 | 199 | test-exchange-obsmarkers-case-A4.t |
|
200 | 200 | test-exchange-obsmarkers-case-A5.t |
|
201 | 201 | test-exchange-obsmarkers-case-A6.t |
|
202 | 202 | test-exchange-obsmarkers-case-A7.t |
|
203 | 203 | test-exchange-obsmarkers-case-B1.t |
|
204 | 204 | test-exchange-obsmarkers-case-B2.t |
|
205 | 205 | test-exchange-obsmarkers-case-B3.t |
|
206 | 206 | test-exchange-obsmarkers-case-B4.t |
|
207 | 207 | test-exchange-obsmarkers-case-B5.t |
|
208 | 208 | test-exchange-obsmarkers-case-B6.t |
|
209 | 209 | test-exchange-obsmarkers-case-B7.t |
|
210 | 210 | test-exchange-obsmarkers-case-C1.t |
|
211 | 211 | test-exchange-obsmarkers-case-C2.t |
|
212 | 212 | test-exchange-obsmarkers-case-C3.t |
|
213 | 213 | test-exchange-obsmarkers-case-C4.t |
|
214 | 214 | test-exchange-obsmarkers-case-D1.t |
|
215 | 215 | test-exchange-obsmarkers-case-D2.t |
|
216 | 216 | test-exchange-obsmarkers-case-D3.t |
|
217 | 217 | test-exchange-obsmarkers-case-D4.t |
|
218 | 218 | test-execute-bit.t |
|
219 | 219 | test-export.t |
|
220 | 220 | test-extdata.t |
|
221 | 221 | test-extdiff.t |
|
222 | 222 | test-extension-timing.t |
|
223 | 223 | test-extension.t |
|
224 | 224 | test-extensions-afterloaded.t |
|
225 | 225 | test-extensions-wrapfunction.py |
|
226 | 226 | test-extra-filelog-entry.t |
|
227 | 227 | test-fastannotate-corrupt.t |
|
228 | 228 | test-fastannotate-diffopts.t |
|
229 | 229 | test-fastannotate-hg.t |
|
230 | 230 | test-fastannotate-perfhack.t |
|
231 | 231 | test-fastannotate-protocol.t |
|
232 | 232 | test-fastannotate-renames.t |
|
233 | 233 | test-fastannotate-revmap.py |
|
234 | 234 | test-fastannotate.t |
|
235 | 235 | test-fetch.t |
|
236 | 236 | test-filebranch.t |
|
237 | 237 | test-filecache.py |
|
238 | 238 | test-filelog.py |
|
239 | 239 | test-fileset-generated.t |
|
240 | 240 | test-fileset.t |
|
241 | 241 | test-fix-metadata.t |
|
242 | 242 | test-fix-topology.t |
|
243 | 243 | test-fix.t |
|
244 | 244 | test-flagprocessor.t |
|
245 | 245 | test-flags.t |
|
246 | 246 | test-fncache.t |
|
247 | 247 | test-gendoc-da.t |
|
248 | 248 | test-gendoc-de.t |
|
249 | 249 | test-gendoc-el.t |
|
250 | 250 | test-gendoc-fr.t |
|
251 | 251 | test-gendoc-it.t |
|
252 | 252 | test-gendoc-ja.t |
|
253 | 253 | test-gendoc-pt_BR.t |
|
254 | 254 | test-gendoc-ro.t |
|
255 | 255 | test-gendoc-ru.t |
|
256 | 256 | test-gendoc-sv.t |
|
257 | 257 | test-gendoc-zh_CN.t |
|
258 | 258 | test-gendoc-zh_TW.t |
|
259 | 259 | test-gendoc.t |
|
260 | 260 | test-generaldelta.t |
|
261 | 261 | test-getbundle.t |
|
262 | 262 | test-git-export.t |
|
263 | 263 | test-githelp.t |
|
264 | 264 | test-globalopts.t |
|
265 | 265 | test-glog-beautifygraph.t |
|
266 | 266 | test-glog-topological.t |
|
267 | 267 | test-glog.t |
|
268 | 268 | test-gpg.t |
|
269 | 269 | test-graft.t |
|
270 | 270 | test-grep.t |
|
271 | 271 | test-hardlinks.t |
|
272 | 272 | test-help-hide.t |
|
273 | 273 | test-help.t |
|
274 | 274 | test-hg-parseurl.py |
|
275 | 275 | test-hghave.t |
|
276 | 276 | test-hgignore.t |
|
277 | 277 | test-hgk.t |
|
278 | 278 | test-hgrc.t |
|
279 | 279 | test-hgweb-annotate-whitespace.t |
|
280 | 280 | test-hgweb-auth.py |
|
281 | 281 | test-hgweb-bundle.t |
|
282 | 282 | test-hgweb-commands.t |
|
283 | 283 | test-hgweb-csp.t |
|
284 | 284 | test-hgweb-descend-empties.t |
|
285 | 285 | test-hgweb-diffs.t |
|
286 | 286 | test-hgweb-empty.t |
|
287 | 287 | test-hgweb-filelog.t |
|
288 | 288 | test-hgweb-json.t |
|
289 | 289 | test-hgweb-no-path-info.t |
|
290 | 290 | test-hgweb-no-request-uri.t |
|
291 | 291 | test-hgweb-non-interactive.t |
|
292 | 292 | test-hgweb-raw.t |
|
293 | 293 | test-hgweb-removed.t |
|
294 | 294 | test-hgweb-symrev.t |
|
295 | 295 | test-hgweb.t |
|
296 | 296 | test-hgwebdir-paths.py |
|
297 | 297 | test-hgwebdir.t |
|
298 | 298 | test-hgwebdirsym.t |
|
299 | test-highlight.t | |
|
299 | 300 | test-histedit-arguments.t |
|
300 | 301 | test-histedit-base.t |
|
301 | 302 | test-histedit-bookmark-motion.t |
|
302 | 303 | test-histedit-commute.t |
|
303 | 304 | test-histedit-drop.t |
|
304 | 305 | test-histedit-edit.t |
|
305 | 306 | test-histedit-fold-non-commute.t |
|
306 | 307 | test-histedit-fold.t |
|
307 | 308 | test-histedit-merge-tools.t |
|
308 | 309 | test-histedit-no-backup.t |
|
309 | 310 | test-histedit-no-change.t |
|
310 | 311 | test-histedit-non-commute-abort.t |
|
311 | 312 | test-histedit-non-commute.t |
|
312 | 313 | test-histedit-obsolete.t |
|
313 | 314 | test-histedit-outgoing.t |
|
314 | 315 | test-histedit-templates.t |
|
315 | 316 | test-http-api-httpv2.t |
|
316 | 317 | test-http-api.t |
|
317 | 318 | test-http-bad-server.t |
|
318 | 319 | test-http-branchmap.t |
|
319 | 320 | test-http-bundle1.t |
|
320 | 321 | test-http-clone-r.t |
|
321 | 322 | test-http-permissions.t |
|
322 | 323 | test-http-protocol.t |
|
323 | 324 | test-http-proxy.t |
|
324 | 325 | test-http.t |
|
325 | 326 | test-https.t |
|
326 | 327 | test-hybridencode.py |
|
327 | 328 | test-i18n.t |
|
328 | 329 | test-identify.t |
|
329 | 330 | test-impexp-branch.t |
|
330 | 331 | test-import-bypass.t |
|
331 | 332 | test-import-context.t |
|
332 | 333 | test-import-eol.t |
|
333 | 334 | test-import-git.t |
|
334 | 335 | test-import-merge.t |
|
335 | 336 | test-import-unknown.t |
|
336 | 337 | test-import.t |
|
337 | 338 | test-imports-checker.t |
|
338 | 339 | test-incoming-outgoing.t |
|
339 | 340 | test-infinitepush-bundlestore.t |
|
340 | 341 | test-infinitepush-ci.t |
|
341 | 342 | test-infinitepush.t |
|
342 | 343 | test-inherit-mode.t |
|
343 | 344 | test-init.t |
|
344 | 345 | test-install.t |
|
345 | 346 | test-issue1089.t |
|
346 | 347 | test-issue1102.t |
|
347 | 348 | test-issue1175.t |
|
348 | 349 | test-issue1306.t |
|
349 | 350 | test-issue1438.t |
|
350 | 351 | test-issue1502.t |
|
351 | 352 | test-issue1802.t |
|
352 | 353 | test-issue1877.t |
|
353 | 354 | test-issue1993.t |
|
354 | 355 | test-issue2137.t |
|
355 | 356 | test-issue3084.t |
|
356 | 357 | test-issue4074.t |
|
357 | 358 | test-issue522.t |
|
358 | 359 | test-issue586.t |
|
359 | 360 | test-issue5979.t |
|
360 | 361 | test-issue612.t |
|
361 | 362 | test-issue619.t |
|
362 | 363 | test-issue660.t |
|
363 | 364 | test-issue672.t |
|
364 | 365 | test-issue842.t |
|
365 | 366 | test-journal-exists.t |
|
366 | 367 | test-journal-share.t |
|
367 | 368 | test-journal.t |
|
368 | 369 | test-keyword.t |
|
369 | 370 | test-known.t |
|
370 | 371 | test-largefiles-cache.t |
|
371 | 372 | test-largefiles-misc.t |
|
372 | 373 | test-largefiles-small-disk.t |
|
373 | 374 | test-largefiles-update.t |
|
374 | 375 | test-largefiles-wireproto.t |
|
375 | 376 | test-largefiles.t |
|
376 | 377 | test-lfconvert.t |
|
377 | 378 | test-lfs-bundle.t |
|
378 | 379 | test-lfs-largefiles.t |
|
379 | 380 | test-lfs-pointer.py |
|
380 | 381 | test-lfs-serve.t |
|
381 | 382 | test-lfs-test-server.t |
|
382 | 383 | test-lfs.t |
|
383 | 384 | test-linelog.py |
|
384 | 385 | test-linerange.py |
|
385 | 386 | test-locate.t |
|
386 | 387 | test-lock-badness.t |
|
387 | 388 | test-lock.py |
|
388 | 389 | test-log-exthook.t |
|
389 | 390 | test-log-linerange.t |
|
390 | 391 | test-log.t |
|
391 | 392 | test-logexchange.t |
|
392 | 393 | test-logtoprocess.t |
|
393 | 394 | test-lrucachedict.py |
|
394 | 395 | test-mactext.t |
|
395 | 396 | test-mailmap.t |
|
396 | 397 | test-manifest-merging.t |
|
397 | 398 | test-manifest.py |
|
398 | 399 | test-manifest.t |
|
399 | 400 | test-match.py |
|
400 | 401 | test-mdiff.py |
|
401 | 402 | test-merge-changedelete.t |
|
402 | 403 | test-merge-closedheads.t |
|
403 | 404 | test-merge-commit.t |
|
404 | 405 | test-merge-criss-cross.t |
|
405 | 406 | test-merge-default.t |
|
406 | 407 | test-merge-force.t |
|
407 | 408 | test-merge-halt.t |
|
408 | 409 | test-merge-internal-tools-pattern.t |
|
409 | 410 | test-merge-local.t |
|
410 | 411 | test-merge-no-file-change.t |
|
411 | 412 | test-merge-remove.t |
|
412 | 413 | test-merge-revert.t |
|
413 | 414 | test-merge-revert2.t |
|
414 | 415 | test-merge-subrepos.t |
|
415 | 416 | test-merge-symlinks.t |
|
416 | 417 | test-merge-tools.t |
|
417 | 418 | test-merge-types.t |
|
418 | 419 | test-merge1.t |
|
419 | 420 | test-merge10.t |
|
420 | 421 | test-merge2.t |
|
421 | 422 | test-merge4.t |
|
422 | 423 | test-merge5.t |
|
423 | 424 | test-merge6.t |
|
424 | 425 | test-merge7.t |
|
425 | 426 | test-merge8.t |
|
426 | 427 | test-merge9.t |
|
427 | 428 | test-minifileset.py |
|
428 | 429 | test-minirst.py |
|
429 | 430 | test-missing-capability.t |
|
430 | 431 | test-mq-eol.t |
|
431 | 432 | test-mq-git.t |
|
432 | 433 | test-mq-guards.t |
|
433 | 434 | test-mq-header-date.t |
|
434 | 435 | test-mq-header-from.t |
|
435 | 436 | test-mq-merge.t |
|
436 | 437 | test-mq-missingfiles.t |
|
437 | 438 | test-mq-pull-from-bundle.t |
|
438 | 439 | test-mq-qclone-http.t |
|
439 | 440 | test-mq-qdelete.t |
|
440 | 441 | test-mq-qdiff.t |
|
441 | 442 | test-mq-qfold.t |
|
442 | 443 | test-mq-qgoto.t |
|
443 | 444 | test-mq-qimport-fail-cleanup.t |
|
444 | 445 | test-mq-qimport.t |
|
445 | 446 | test-mq-qnew.t |
|
446 | 447 | test-mq-qpush-exact.t |
|
447 | 448 | test-mq-qpush-fail.t |
|
448 | 449 | test-mq-qqueue.t |
|
449 | 450 | test-mq-qrefresh-interactive.t |
|
450 | 451 | test-mq-qrefresh-replace-log-message.t |
|
451 | 452 | test-mq-qrefresh.t |
|
452 | 453 | test-mq-qrename.t |
|
453 | 454 | test-mq-qsave.t |
|
454 | 455 | test-mq-safety.t |
|
455 | 456 | test-mq-subrepo-svn.t |
|
456 | 457 | test-mq-subrepo.t |
|
457 | 458 | test-mq-symlinks.t |
|
458 | 459 | test-mq.t |
|
459 | 460 | test-mv-cp-st-diff.t |
|
460 | 461 | test-narrow-acl.t |
|
461 | 462 | test-narrow-archive.t |
|
462 | 463 | test-narrow-clone-no-ellipsis.t |
|
463 | 464 | test-narrow-clone-non-narrow-server.t |
|
464 | 465 | test-narrow-clone-nonlinear.t |
|
465 | 466 | test-narrow-clone-stream.t |
|
466 | 467 | test-narrow-clone.t |
|
467 | 468 | test-narrow-commit.t |
|
468 | 469 | test-narrow-copies.t |
|
469 | 470 | test-narrow-debugcommands.t |
|
470 | 471 | test-narrow-debugrebuilddirstate.t |
|
471 | 472 | test-narrow-exchange-merges.t |
|
472 | 473 | test-narrow-exchange.t |
|
473 | 474 | test-narrow-expanddirstate.t |
|
474 | 475 | test-narrow-merge.t |
|
475 | 476 | test-narrow-patch.t |
|
476 | 477 | test-narrow-patterns.t |
|
477 | 478 | test-narrow-pull.t |
|
478 | 479 | test-narrow-rebase.t |
|
479 | 480 | test-narrow-shallow-merges.t |
|
480 | 481 | test-narrow-shallow.t |
|
481 | 482 | test-narrow-share.t |
|
482 | 483 | test-narrow-sparse.t |
|
483 | 484 | test-narrow-strip.t |
|
484 | 485 | test-narrow-trackedcmd.t |
|
485 | 486 | test-narrow-update.t |
|
486 | 487 | test-narrow-widen-no-ellipsis.t |
|
487 | 488 | test-narrow-widen.t |
|
488 | 489 | test-narrow.t |
|
489 | 490 | test-nested-repo.t |
|
490 | 491 | test-newbranch.t |
|
491 | 492 | test-newcgi.t |
|
492 | 493 | test-newercgi.t |
|
493 | 494 | test-nointerrupt.t |
|
494 | 495 | test-notify-changegroup.t |
|
495 | 496 | test-obshistory.t |
|
496 | 497 | test-obsmarker-template.t |
|
497 | 498 | test-obsmarkers-effectflag.t |
|
498 | 499 | test-obsolete-bounds-checking.t |
|
499 | 500 | test-obsolete-bundle-strip.t |
|
500 | 501 | test-obsolete-changeset-exchange.t |
|
501 | 502 | test-obsolete-checkheads.t |
|
502 | 503 | test-obsolete-distributed.t |
|
503 | 504 | test-obsolete-divergent.t |
|
504 | 505 | test-obsolete-tag-cache.t |
|
505 | 506 | test-obsolete.t |
|
506 | 507 | test-oldcgi.t |
|
507 | 508 | test-origbackup-conflict.t |
|
508 | 509 | test-pager-legacy.t |
|
509 | 510 | test-pager.t |
|
510 | 511 | test-parents.t |
|
511 | 512 | test-parse-date.t |
|
512 | 513 | test-parseindex.t |
|
513 | 514 | test-parseindex2.py |
|
514 | 515 | test-patch-offset.t |
|
515 | 516 | test-patch.t |
|
516 | 517 | test-patchbomb-bookmark.t |
|
517 | 518 | test-patchbomb-tls.t |
|
518 | 519 | test-patchbomb.t |
|
519 | 520 | test-pathconflicts-basic.t |
|
520 | 521 | test-pathconflicts-merge.t |
|
521 | 522 | test-pathconflicts-update.t |
|
522 | 523 | test-pathencode.py |
|
523 | 524 | test-paths.t |
|
524 | 525 | test-pending.t |
|
525 | 526 | test-permissions.t |
|
526 | 527 | test-phabricator.t |
|
527 | 528 | test-phase-archived.t |
|
528 | 529 | test-phases-exchange.t |
|
529 | 530 | test-phases.t |
|
530 | 531 | test-profile.t |
|
531 | 532 | test-progress.t |
|
532 | 533 | test-propertycache.py |
|
533 | 534 | test-pull-branch.t |
|
534 | 535 | test-pull-bundle.t |
|
535 | 536 | test-pull-http.t |
|
536 | 537 | test-pull-permission.t |
|
537 | 538 | test-pull-pull-corruption.t |
|
538 | 539 | test-pull-r.t |
|
539 | 540 | test-pull-update.t |
|
540 | 541 | test-pull.t |
|
541 | 542 | test-purge.t |
|
542 | 543 | test-push-cgi.t |
|
543 | 544 | test-push-checkheads-partial-C1.t |
|
544 | 545 | test-push-checkheads-partial-C2.t |
|
545 | 546 | test-push-checkheads-partial-C3.t |
|
546 | 547 | test-push-checkheads-partial-C4.t |
|
547 | 548 | test-push-checkheads-pruned-B1.t |
|
548 | 549 | test-push-checkheads-pruned-B2.t |
|
549 | 550 | test-push-checkheads-pruned-B3.t |
|
550 | 551 | test-push-checkheads-pruned-B4.t |
|
551 | 552 | test-push-checkheads-pruned-B5.t |
|
552 | 553 | test-push-checkheads-pruned-B6.t |
|
553 | 554 | test-push-checkheads-pruned-B7.t |
|
554 | 555 | test-push-checkheads-pruned-B8.t |
|
555 | 556 | test-push-checkheads-superceed-A1.t |
|
556 | 557 | test-push-checkheads-superceed-A2.t |
|
557 | 558 | test-push-checkheads-superceed-A3.t |
|
558 | 559 | test-push-checkheads-superceed-A4.t |
|
559 | 560 | test-push-checkheads-superceed-A5.t |
|
560 | 561 | test-push-checkheads-superceed-A6.t |
|
561 | 562 | test-push-checkheads-superceed-A7.t |
|
562 | 563 | test-push-checkheads-superceed-A8.t |
|
563 | 564 | test-push-checkheads-unpushed-D1.t |
|
564 | 565 | test-push-checkheads-unpushed-D2.t |
|
565 | 566 | test-push-checkheads-unpushed-D3.t |
|
566 | 567 | test-push-checkheads-unpushed-D4.t |
|
567 | 568 | test-push-checkheads-unpushed-D5.t |
|
568 | 569 | test-push-checkheads-unpushed-D6.t |
|
569 | 570 | test-push-checkheads-unpushed-D7.t |
|
570 | 571 | test-push-http.t |
|
571 | 572 | test-push-race.t |
|
572 | 573 | test-push-warn.t |
|
573 | 574 | test-push.t |
|
574 | 575 | test-pushvars.t |
|
575 | 576 | test-qrecord.t |
|
576 | 577 | test-rebase-abort.t |
|
577 | 578 | test-rebase-backup.t |
|
578 | 579 | test-rebase-base-flag.t |
|
579 | 580 | test-rebase-bookmarks.t |
|
580 | 581 | test-rebase-brute-force.t |
|
581 | 582 | test-rebase-cache.t |
|
582 | 583 | test-rebase-check-restore.t |
|
583 | 584 | test-rebase-collapse.t |
|
584 | 585 | test-rebase-conflicts.t |
|
585 | 586 | test-rebase-dest.t |
|
586 | 587 | test-rebase-detach.t |
|
587 | 588 | test-rebase-emptycommit.t |
|
588 | 589 | test-rebase-inmemory.t |
|
589 | 590 | test-rebase-interruptions.t |
|
590 | 591 | test-rebase-issue-noparam-single-rev.t |
|
591 | 592 | test-rebase-legacy.t |
|
592 | 593 | test-rebase-mq-skip.t |
|
593 | 594 | test-rebase-mq.t |
|
594 | 595 | test-rebase-named-branches.t |
|
595 | 596 | test-rebase-newancestor.t |
|
596 | 597 | test-rebase-obsolete.t |
|
597 | 598 | test-rebase-parameters.t |
|
598 | 599 | test-rebase-partial.t |
|
599 | 600 | test-rebase-pull.t |
|
600 | 601 | test-rebase-rename.t |
|
601 | 602 | test-rebase-scenario-global.t |
|
602 | 603 | test-rebase-templates.t |
|
603 | 604 | test-rebase-transaction.t |
|
604 | 605 | test-rebuildstate.t |
|
605 | 606 | test-record.t |
|
606 | 607 | test-releasenotes-formatting.t |
|
607 | 608 | test-releasenotes-merging.t |
|
608 | 609 | test-releasenotes-parsing.t |
|
609 | 610 | test-relink.t |
|
610 | 611 | test-remote-hidden.t |
|
611 | 612 | test-remotefilelog-bad-configs.t |
|
612 | 613 | test-remotefilelog-bgprefetch.t |
|
613 | 614 | test-remotefilelog-blame.t |
|
614 | 615 | test-remotefilelog-bundle2.t |
|
615 | 616 | test-remotefilelog-bundles.t |
|
616 | 617 | test-remotefilelog-cacheprocess.t |
|
617 | 618 | test-remotefilelog-clone-tree.t |
|
618 | 619 | test-remotefilelog-clone.t |
|
619 | 620 | test-remotefilelog-corrupt-cache.t |
|
620 | 621 | test-remotefilelog-datapack.py |
|
621 | 622 | test-remotefilelog-gc.t |
|
622 | 623 | test-remotefilelog-gcrepack.t |
|
623 | 624 | test-remotefilelog-histpack.py |
|
624 | 625 | test-remotefilelog-http.t |
|
625 | 626 | test-remotefilelog-keepset.t |
|
626 | 627 | test-remotefilelog-linknodes.t |
|
627 | 628 | test-remotefilelog-local.t |
|
628 | 629 | test-remotefilelog-log.t |
|
629 | 630 | test-remotefilelog-partial-shallow.t |
|
630 | 631 | test-remotefilelog-permissions.t |
|
631 | 632 | test-remotefilelog-prefetch.t |
|
632 | 633 | test-remotefilelog-pull-noshallow.t |
|
633 | 634 | test-remotefilelog-push-pull.t |
|
634 | 635 | test-remotefilelog-repack-fast.t |
|
635 | 636 | test-remotefilelog-repack.t |
|
636 | 637 | test-remotefilelog-share.t |
|
637 | 638 | test-remotefilelog-sparse.t |
|
638 | 639 | test-remotefilelog-tags.t |
|
639 | 640 | test-remotefilelog-wireproto.t |
|
640 | 641 | test-remove.t |
|
641 | 642 | test-removeemptydirs.t |
|
642 | 643 | test-rename-after-merge.t |
|
643 | 644 | test-rename-dir-merge.t |
|
644 | 645 | test-rename-merge1.t |
|
645 | 646 | test-rename-merge2.t |
|
646 | 647 | test-rename.t |
|
647 | 648 | test-repair-strip.t |
|
648 | 649 | test-repo-compengines.t |
|
649 | 650 | test-requires.t |
|
650 | 651 | test-resolve.t |
|
651 | 652 | test-revert-flags.t |
|
652 | 653 | test-revert-interactive.t |
|
653 | 654 | test-revert-unknown.t |
|
654 | 655 | test-revert.t |
|
655 | 656 | test-revisions.t |
|
656 | 657 | test-revlog-ancestry.py |
|
657 | 658 | test-revlog-group-emptyiter.t |
|
658 | 659 | test-revlog-mmapindex.t |
|
659 | 660 | test-revlog-packentry.t |
|
660 | 661 | test-revlog-raw.py |
|
661 | 662 | test-revlog-v2.t |
|
662 | 663 | test-revlog.t |
|
663 | 664 | test-revset-dirstate-parents.t |
|
664 | 665 | test-revset-legacy-lookup.t |
|
665 | 666 | test-revset-outgoing.t |
|
666 | 667 | test-revset.t |
|
667 | 668 | test-revset2.t |
|
668 | 669 | test-rollback.t |
|
669 | 670 | test-run-tests.py |
|
670 | 671 | test-run-tests.t |
|
671 | 672 | test-rust-ancestor.py |
|
672 | 673 | test-rust-discovery.py |
|
673 | 674 | test-schemes.t |
|
674 | 675 | test-serve.t |
|
675 | 676 | test-server-view.t |
|
676 | 677 | test-setdiscovery.t |
|
677 | 678 | test-share-bookmarks.t |
|
678 | 679 | test-share.t |
|
679 | 680 | test-shelve.t |
|
680 | 681 | test-shelve2.t |
|
681 | 682 | test-show-stack.t |
|
682 | 683 | test-show-work.t |
|
683 | 684 | test-show.t |
|
684 | 685 | test-simple-update.t |
|
685 | 686 | test-simplekeyvaluefile.py |
|
686 | 687 | test-simplemerge.py |
|
687 | 688 | test-single-head.t |
|
688 | 689 | test-sparse-clear.t |
|
689 | 690 | test-sparse-clone.t |
|
690 | 691 | test-sparse-import.t |
|
691 | 692 | test-sparse-merges.t |
|
692 | 693 | test-sparse-profiles.t |
|
693 | 694 | test-sparse-requirement.t |
|
694 | 695 | test-sparse-verbose-json.t |
|
695 | 696 | test-sparse.t |
|
696 | 697 | test-split.t |
|
697 | 698 | test-ssh-bundle1.t |
|
698 | 699 | test-ssh-clone-r.t |
|
699 | 700 | test-ssh-proto-unbundle.t |
|
700 | 701 | test-ssh-proto.t |
|
701 | 702 | test-ssh-repoerror.t |
|
702 | 703 | test-ssh.t |
|
703 | 704 | test-sshserver.py |
|
704 | 705 | test-stack.t |
|
705 | 706 | test-static-http.t |
|
706 | 707 | test-status-color.t |
|
707 | 708 | test-status-inprocess.py |
|
708 | 709 | test-status-rev.t |
|
709 | 710 | test-status-terse.t |
|
710 | 711 | test-status.t |
|
711 | 712 | test-storage.py |
|
712 | 713 | test-stream-bundle-v2.t |
|
713 | 714 | test-strict.t |
|
714 | 715 | test-strip-cross.t |
|
715 | 716 | test-strip.t |
|
716 | 717 | test-subrepo-deep-nested-change.t |
|
717 | 718 | test-subrepo-git.t |
|
718 | 719 | test-subrepo-missing.t |
|
719 | 720 | test-subrepo-paths.t |
|
720 | 721 | test-subrepo-recursion.t |
|
721 | 722 | test-subrepo-relative-path.t |
|
722 | 723 | test-subrepo-svn.t |
|
723 | 724 | test-subrepo.t |
|
724 | 725 | test-symlink-os-yes-fs-no.py |
|
725 | 726 | test-symlink-placeholder.t |
|
726 | 727 | test-symlinks.t |
|
727 | 728 | test-tag.t |
|
728 | 729 | test-tags.t |
|
729 | 730 | test-template-basic.t |
|
730 | 731 | test-template-functions.t |
|
731 | 732 | test-template-keywords.t |
|
732 | 733 | test-template-map.t |
|
733 | 734 | test-tools.t |
|
734 | 735 | test-transplant.t |
|
735 | 736 | test-treediscovery-legacy.t |
|
736 | 737 | test-treediscovery.t |
|
737 | 738 | test-treemanifest.t |
|
738 | 739 | test-trusted.py |
|
739 | 740 | test-ui-color.py |
|
740 | 741 | test-ui-config.py |
|
741 | 742 | test-ui-verbosity.py |
|
742 | 743 | test-unamend.t |
|
743 | 744 | test-unbundlehash.t |
|
744 | 745 | test-uncommit.t |
|
745 | 746 | test-unified-test.t |
|
746 | 747 | test-unionrepo.t |
|
747 | 748 | test-unrelated-pull.t |
|
748 | 749 | test-up-local-change.t |
|
749 | 750 | test-update-atomic.t |
|
750 | 751 | test-update-branches.t |
|
751 | 752 | test-update-dest.t |
|
752 | 753 | test-update-issue1456.t |
|
753 | 754 | test-update-names.t |
|
754 | 755 | test-update-reverse.t |
|
755 | 756 | test-upgrade-repo.t |
|
756 | 757 | test-url-download.t |
|
757 | 758 | test-url-rev.t |
|
758 | 759 | test-url.py |
|
759 | 760 | test-username-newline.t |
|
760 | 761 | test-util.py |
|
761 | 762 | test-verify.t |
|
762 | 763 | test-walk.t |
|
763 | 764 | test-walkrepo.py |
|
764 | 765 | test-websub.t |
|
765 | 766 | test-win32text.t |
|
766 | 767 | test-wireproto-caching.t |
|
767 | 768 | test-wireproto-clientreactor.py |
|
768 | 769 | test-wireproto-command-branchmap.t |
|
769 | 770 | test-wireproto-command-capabilities.t |
|
770 | 771 | test-wireproto-command-changesetdata.t |
|
771 | 772 | test-wireproto-command-filedata.t |
|
772 | 773 | test-wireproto-command-filesdata.t |
|
773 | 774 | test-wireproto-command-heads.t |
|
774 | 775 | test-wireproto-command-known.t |
|
775 | 776 | test-wireproto-command-listkeys.t |
|
776 | 777 | test-wireproto-command-lookup.t |
|
777 | 778 | test-wireproto-command-manifestdata.t |
|
778 | 779 | test-wireproto-command-pushkey.t |
|
779 | 780 | test-wireproto-command-rawstorefiledata.t |
|
780 | 781 | test-wireproto-content-redirects.t |
|
781 | 782 | test-wireproto-exchangev2.t |
|
782 | 783 | test-wireproto-framing.py |
|
783 | 784 | test-wireproto-serverreactor.py |
|
784 | 785 | test-wireproto.py |
|
785 | 786 | test-wireproto.t |
|
786 | 787 | test-worker.t |
|
787 | 788 | test-wsgirequest.py |
|
788 | 789 | test-xdg.t |
@@ -1,96 +1,98 | |||
|
1 | 1 | # highlight - syntax highlighting in hgweb, based on Pygments |
|
2 | 2 | # |
|
3 | 3 | # Copyright 2008, 2009 Patrick Mezard <pmezard@gmail.com> and others |
|
4 | 4 | # |
|
5 | 5 | # This software may be used and distributed according to the terms of the |
|
6 | 6 | # GNU General Public License version 2 or any later version. |
|
7 | 7 | # |
|
8 | 8 | # The original module was split in an interface and an implementation |
|
9 | 9 | # file to defer pygments loading and speedup extension setup. |
|
10 | 10 | |
|
11 | 11 | """syntax highlighting for hgweb (requires Pygments) |
|
12 | 12 | |
|
13 | 13 | It depends on the Pygments syntax highlighting library: |
|
14 | 14 | http://pygments.org/ |
|
15 | 15 | |
|
16 | 16 | There are the following configuration options:: |
|
17 | 17 | |
|
18 | 18 | [web] |
|
19 | 19 | pygments_style = <style> (default: colorful) |
|
20 | 20 | highlightfiles = <fileset> (default: size('<5M')) |
|
21 | 21 | highlightonlymatchfilename = <bool> (default False) |
|
22 | 22 | |
|
23 | 23 | ``highlightonlymatchfilename`` will only highlight files if their type could |
|
24 | 24 | be identified by their filename. When this is not enabled (the default), |
|
25 | 25 | Pygments will try very hard to identify the file type from content and any |
|
26 | 26 | match (even matches with a low confidence score) will be used. |
|
27 | 27 | """ |
|
28 | 28 | |
|
29 | 29 | from __future__ import absolute_import |
|
30 | 30 | |
|
31 | 31 | from . import highlight |
|
32 | 32 | from mercurial.hgweb import ( |
|
33 | 33 | webcommands, |
|
34 | 34 | webutil, |
|
35 | 35 | ) |
|
36 | 36 | |
|
37 | 37 | from mercurial import ( |
|
38 | 38 | extensions, |
|
39 | pycompat, | |
|
39 | 40 | ) |
|
40 | 41 | |
|
41 | 42 | # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for |
|
42 | 43 | # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should |
|
43 | 44 | # be specifying the version(s) of Mercurial they are tested with, or |
|
44 | 45 | # leave the attribute unspecified. |
|
45 | 46 | testedwith = 'ships-with-hg-core' |
|
46 | 47 | |
|
47 | 48 | def pygmentize(web, field, fctx, tmpl): |
|
48 | 49 | style = web.config('web', 'pygments_style', 'colorful') |
|
49 | 50 | expr = web.config('web', 'highlightfiles', "size('<5M')") |
|
50 | 51 | filenameonly = web.configbool('web', 'highlightonlymatchfilename', False) |
|
51 | 52 | |
|
52 | 53 | ctx = fctx.changectx() |
|
53 | 54 | m = ctx.matchfileset(expr) |
|
54 | 55 | if m(fctx.path()): |
|
55 | 56 | highlight.pygmentize(field, fctx, style, tmpl, |
|
56 | 57 | guessfilenameonly=filenameonly) |
|
57 | 58 | |
|
58 | 59 | def filerevision_highlight(orig, web, fctx): |
|
59 | 60 | mt = web.res.headers['Content-Type'] |
|
60 | 61 | # only pygmentize for mimetype containing 'html' so we both match |
|
61 | 62 | # 'text/html' and possibly 'application/xhtml+xml' in the future |
|
62 | 63 | # so that we don't have to touch the extension when the mimetype |
|
63 | 64 | # for a template changes; also hgweb optimizes the case that a |
|
64 | 65 | # raw file is sent using rawfile() and doesn't call us, so we |
|
65 | 66 | # can't clash with the file's content-type here in case we |
|
66 | 67 | # pygmentize a html file |
|
67 | 68 | if 'html' in mt: |
|
68 | 69 | pygmentize(web, 'fileline', fctx, web.tmpl) |
|
69 | 70 | |
|
70 | 71 | return orig(web, fctx) |
|
71 | 72 | |
|
72 | 73 | def annotate_highlight(orig, web): |
|
73 | 74 | mt = web.res.headers['Content-Type'] |
|
74 | 75 | if 'html' in mt: |
|
75 | 76 | fctx = webutil.filectx(web.repo, web.req) |
|
76 | 77 | pygmentize(web, 'annotateline', fctx, web.tmpl) |
|
77 | 78 | |
|
78 | 79 | return orig(web) |
|
79 | 80 | |
|
80 | 81 | def generate_css(web): |
|
81 | 82 | pg_style = web.config('web', 'pygments_style', 'colorful') |
|
82 | fmter = highlight.HtmlFormatter(style=pg_style) | |
|
83 | fmter = highlight.HtmlFormatter(style=pycompat.sysstr(pg_style)) | |
|
83 | 84 | web.res.headers['Content-Type'] = 'text/css' |
|
85 | style_defs = fmter.get_style_defs(pycompat.sysstr('')) | |
|
84 | 86 | web.res.setbodybytes(''.join([ |
|
85 | 87 | '/* pygments_style = %s */\n\n' % pg_style, |
|
86 |
|
|
|
88 | pycompat.bytestr(style_defs), | |
|
87 | 89 | ])) |
|
88 | 90 | return web.res.sendresponse() |
|
89 | 91 | |
|
90 | 92 | def extsetup(ui): |
|
91 | 93 | # monkeypatch in the new version |
|
92 | 94 | extensions.wrapfunction(webcommands, '_filerevision', |
|
93 | 95 | filerevision_highlight) |
|
94 | 96 | extensions.wrapfunction(webcommands, 'annotate', annotate_highlight) |
|
95 | 97 | webcommands.highlightcss = generate_css |
|
96 | 98 | webcommands.__all__.append('highlightcss') |
@@ -1,97 +1,99 | |||
|
1 | 1 | # highlight.py - highlight extension implementation file |
|
2 | 2 | # |
|
3 | 3 | # Copyright 2007-2009 Adam Hupp <adam@hupp.org> and others |
|
4 | 4 | # |
|
5 | 5 | # This software may be used and distributed according to the terms of the |
|
6 | 6 | # GNU General Public License version 2 or any later version. |
|
7 | 7 | # |
|
8 | 8 | # The original module was split in an interface and an implementation |
|
9 | 9 | # file to defer pygments loading and speedup extension setup. |
|
10 | 10 | |
|
11 | 11 | from __future__ import absolute_import |
|
12 | 12 | |
|
13 | 13 | from mercurial import demandimport |
|
14 | 14 | demandimport.IGNORES.update(['pkgutil', 'pkg_resources', '__main__']) |
|
15 | 15 | |
|
16 | 16 | from mercurial import ( |
|
17 | 17 | encoding, |
|
18 | pycompat, | |
|
18 | 19 | ) |
|
19 | 20 | |
|
20 | 21 | from mercurial.utils import ( |
|
21 | 22 | stringutil, |
|
22 | 23 | ) |
|
23 | 24 | |
|
24 | 25 | with demandimport.deactivated(): |
|
25 | 26 | import pygments |
|
26 | 27 | import pygments.formatters |
|
27 | 28 | import pygments.lexers |
|
28 | 29 | import pygments.plugin |
|
29 | 30 | import pygments.util |
|
30 | 31 | |
|
31 | 32 | for unused in pygments.plugin.find_plugin_lexers(): |
|
32 | 33 | pass |
|
33 | 34 | |
|
34 | 35 | highlight = pygments.highlight |
|
35 | 36 | ClassNotFound = pygments.util.ClassNotFound |
|
36 | 37 | guess_lexer = pygments.lexers.guess_lexer |
|
37 | 38 | guess_lexer_for_filename = pygments.lexers.guess_lexer_for_filename |
|
38 | 39 | TextLexer = pygments.lexers.TextLexer |
|
39 | 40 | HtmlFormatter = pygments.formatters.HtmlFormatter |
|
40 | 41 | |
|
41 | 42 | SYNTAX_CSS = ('\n<link rel="stylesheet" href="{url}highlightcss" ' |
|
42 | 43 | 'type="text/css" />') |
|
43 | 44 | |
|
44 | 45 | def pygmentize(field, fctx, style, tmpl, guessfilenameonly=False): |
|
45 | 46 | |
|
46 | 47 | # append a <link ...> to the syntax highlighting css |
|
47 | 48 | tmpl.load('header') |
|
48 | 49 | old_header = tmpl.cache['header'] |
|
49 | 50 | if SYNTAX_CSS not in old_header: |
|
50 | 51 | new_header = old_header + SYNTAX_CSS |
|
51 | 52 | tmpl.cache['header'] = new_header |
|
52 | 53 | |
|
53 | 54 | text = fctx.data() |
|
54 | 55 | if stringutil.binary(text): |
|
55 | 56 | return |
|
56 | 57 | |
|
57 | 58 | # str.splitlines() != unicode.splitlines() because "reasons" |
|
58 | 59 | for c in "\x0c\x1c\x1d\x1e": |
|
59 | 60 | if c in text: |
|
60 | 61 | text = text.replace(c, '') |
|
61 | 62 | |
|
62 | 63 | # Pygments is best used with Unicode strings: |
|
63 | 64 | # <http://pygments.org/docs/unicode/> |
|
64 | text = text.decode(encoding.encoding, 'replace') | |
|
65 | text = text.decode(pycompat.sysstr(encoding.encoding), 'replace') | |
|
65 | 66 | |
|
66 | 67 | # To get multi-line strings right, we can't format line-by-line |
|
67 | 68 | try: |
|
68 | lexer = guess_lexer_for_filename(fctx.path(), text[:1024], | |
|
69 | path = pycompat.sysstr(fctx.path()) | |
|
70 | lexer = guess_lexer_for_filename(path, text[:1024], | |
|
69 | 71 | stripnl=False) |
|
70 | 72 | except (ClassNotFound, ValueError): |
|
71 | 73 | # guess_lexer will return a lexer if *any* lexer matches. There is |
|
72 | 74 | # no way to specify a minimum match score. This can give a high rate of |
|
73 | 75 | # false positives on files with an unknown filename pattern. |
|
74 | 76 | if guessfilenameonly: |
|
75 | 77 | return |
|
76 | 78 | |
|
77 | 79 | try: |
|
78 | 80 | lexer = guess_lexer(text[:1024], stripnl=False) |
|
79 | 81 | except (ClassNotFound, ValueError): |
|
80 | 82 | # Don't highlight unknown files |
|
81 | 83 | return |
|
82 | 84 | |
|
83 | 85 | # Don't highlight text files |
|
84 | 86 | if isinstance(lexer, TextLexer): |
|
85 | 87 | return |
|
86 | 88 | |
|
87 | formatter = HtmlFormatter(nowrap=True, style=style) | |
|
89 | formatter = HtmlFormatter(nowrap=True, style=pycompat.sysstr(style)) | |
|
88 | 90 | |
|
89 | 91 | colorized = highlight(text, lexer, formatter) |
|
90 | coloriter = (s.encode(encoding.encoding, 'replace') | |
|
92 | coloriter = (s.encode(pycompat.sysstr(encoding.encoding), 'replace') | |
|
91 | 93 | for s in colorized.splitlines()) |
|
92 | 94 | |
|
93 | 95 | tmpl._filters['colorize'] = lambda x: next(coloriter) |
|
94 | 96 | |
|
95 | 97 | oldl = tmpl.cache[field] |
|
96 | 98 | newl = oldl.replace('line|escape', 'line|colorize') |
|
97 | 99 | tmpl.cache[field] = newl |
General Comments 0
You need to be logged in to leave comments.
Login now