Mercurial comes with it's own http server (hg serve) that can either be used as an ad-hoc rcs server for a single repo or a convenient way to browse a repo. When used as the latter, clicking on a filename link without pygments installed produces the following: from pygments import highlight File "/usr/lib64/python2.7/site-packages/mercurial/demandimport.py", line 130, in _demandimport mod = _hgextimport(_origimport, name, globals, locals) File "/usr/lib64/python2.7/site-packages/mercurial/demandimport.py", line 43, in _hgextimport return importfunc(name, globals, *args) ImportError: No module named pygments And the file does not get displayed in the browser. I realize that some people will choose not to use the built-in http server and thus have no need for pygments, so perhaps it should be a use flag or something added to the post-inst message explaining that pygments may be required to use the http server. dev-vcs/mercurial-3.0 Actually looking at the ebuild I see the "test" flag pulls in pygments in DEPEND (but not RDEPEND).
This seems to be Mercurial bug, because Pygments should be required only when `highlight` extension is enabled. I'll try to investigate.
Reported: http://bz.selenic.com/show_bug.cgi?id=4254
(In reply to Albert W. Hopkins from comment #0) Albert, here's what Mercurial devs say: > It works just fine for me without pygments. > > Can you show a full trace? > > Are you absolutely sure the highlight extension isn't enabled? Check 'hg > showconfig extensions' as the hgweb user.
(In reply to Nikolaj Sjujskij from comment #3) > (In reply to Albert W. Hopkins from comment #0) > Albert, here's what Mercurial devs say: > > > It works just fine for me without pygments. > > > > Can you show a full trace? > > > > Are you absolutely sure the highlight extension isn't enabled? Check 'hg > > showconfig extensions' as the hgweb user. It is correct that I did have the highlight extension enabled. I never noticed it was enabled. It does in fact work w/o the pygments if the extension is turned off. I think that perhaps pygments was installed somehow on my system before, perhaps as a dependency of something else, and that in time it was no longer a dependency and thus was depcleaned out, then Mercurial started to break. Indeed, the help for the highlight extension does mention. highlight syntax highlighting for hgweb (requires Pygments) Sorry to have wasted resources on this. It is neither a hard requirement nor undocumented. This can be closed out.
ok thx Nik