Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/webcommands.py @ 24078:e44586d9c207
webcommands: move help import into help command handler
A subsequent patch will introduce an import cycle between mercurial.help
and mercurial.hgweb.webcommands. Break the cycle by moving the import of
mercurial.help into the web command that actually needs it.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Fri, 06 Feb 2015 22:47:48 -0800 |
parents | e8046ca0405d |
children | ff42de48193c |
comparison
equal
deleted
inserted
replaced
24077:e8046ca0405d | 24078:e44586d9c207 |
---|---|
11 from mercurial.node import short, hex | 11 from mercurial.node import short, hex |
12 from mercurial import util | 12 from mercurial import util |
13 from common import paritygen, staticfile, get_contact, ErrorResponse | 13 from common import paritygen, staticfile, get_contact, ErrorResponse |
14 from common import HTTP_OK, HTTP_FORBIDDEN, HTTP_NOT_FOUND | 14 from common import HTTP_OK, HTTP_FORBIDDEN, HTTP_NOT_FOUND |
15 from mercurial import graphmod, patch | 15 from mercurial import graphmod, patch |
16 from mercurial import help as helpmod | |
17 from mercurial import scmutil | 16 from mercurial import scmutil |
18 from mercurial.i18n import _ | 17 from mercurial.i18n import _ |
19 from mercurial.error import ParseError, RepoLookupError, Abort | 18 from mercurial.error import ParseError, RepoLookupError, Abort |
20 from mercurial import revset | 19 from mercurial import revset |
21 | 20 |
1081 return doc | 1080 return doc |
1082 | 1081 |
1083 @webcommand('help') | 1082 @webcommand('help') |
1084 def help(web, req, tmpl): | 1083 def help(web, req, tmpl): |
1085 from mercurial import commands # avoid cycle | 1084 from mercurial import commands # avoid cycle |
1085 from mercurial import help as helpmod # avoid cycle | |
1086 | 1086 |
1087 topicname = req.form.get('node', [None])[0] | 1087 topicname = req.form.get('node', [None])[0] |
1088 if not topicname: | 1088 if not topicname: |
1089 def topics(**map): | 1089 def topics(**map): |
1090 for entries, summary, _doc in helpmod.helptable: | 1090 for entries, summary, _doc in helpmod.helptable: |