##// END OF EJS Templates
interfaces: convert `repository.ipeerconnection` from zope `Attribute` attrs...
interfaces: convert `repository.ipeerconnection` from zope `Attribute` attrs This is the same transformation as b455dfddfed0 did for dirstate. Since type annotations are wrapped up in this transformation (the file syntax is such that *some* type needs to be declared, even if `Any`), this can be done piecemeal. See that commit for more background detail. Initially, I imported `uimod` here, delayed to the type checking phase, like a bunch of other modules are currently doing. That caused a problem with pytype no longer inferring types in some seemingly unrelated modules, which was also mentioned in a1c0f19e7cb4. None of the following applies to this commit, because dropping the import and aliasing `Ui = Any` until we get a Protocol class in place avoids this issue. But for posterity, the exact problem was that pytype 2023.11.21 on Python 3.10.11 stopped inferring the (currently undeclared) `int` type of the following attributes in `mercurial.revlog`, switching them to `Any`. - COMP_MODE_INLINE - REVIDX_DEFAULT_FLAGS - REVIDX_ELLIPSIS - REVIDX_EXTSTORED - REVIDX_FLAGS_ORDER - REVIDX_HASCOPIESINFO - REVIDX_ISCENSORED - REVIDX_RAWTEXT_CHANGING_FLAGS That had cascading effects on `hgext.remotefilelog.shallowutil`, `mercurial.metadata`, and `mercurial.pure.parsers`, mostly on return types it was no longer able to infer. These fields above are imported directly through a couple of `mercurial.revlogutils` modules. Unfortunately, explicitly typing those original fields only preserved the type for `COMP_MODE_INLINE`. The only difference I see is this field is defined in `mercurial/revlogutils/__init__.py`, and the rest are defined in `mercurial/revlogutils/constants.py`, but I don't know the significance of that. The `mercurial/revlogutils/*.pyi` files have the correct type with or without the explicit typing when the import is present- it's only the `revlog` module's imports that seem to be affected. And since they are direct imports, there's no way that I know of to assign a type, like there would be if there was a field assignment. There is an import cycle of sorts here when importing ui, that is likely the problem: interfaces.repository -> ui -> utils.urlutil -> revlogutils.constants -> interfaces.repository Running `ls -gGrt --time-style=full` on the associated *.pyi files that get generated showed that `revlog.pyi` was created before the `revlogutils` files. I tried moving the import of `utils.urlutil` in `mercurial.ui` into `ui.paths()` instead of a top level import, and that didn't help. It could be argued that `ui.pyi` would need the import anyway because `ui.paths()` returns an instance of `utils.urlutil.paths`, but pytype is currently typing that as `Any`, because it gets confused by the `@util.propertycache` decorator (replacing that with `Any`), and it dropped the import of `utils.urlutil` as expected with that change. I'm a little skeptical that cycle is a problem though, because `interfaces.repository` also started importing `utils.urlutil` here, which means there's this cycle that's not a problem: interfaces.repository -> utils.urlutil -> revlogutils.constants -> interfaces.repository PyCharm is also able to sniff out the types in `mercurial.revlog` with the import, so I'm not sure if this is a bug/limitation in pytype, or what.

File last commit:

r32758:cba4461a default
r53360:0cfcc276 default
Show More
helptopics.tmpl
48 lines | 1.3 KiB | application/x-cheetah | CheetahLexer
Augie Fackler
web: add a help view for getting hg help output
r12666 {header}
<title>Help: {title}</title>
</head>
<body>
<div class="container">
<div class="menu">
<div class="logo">
Steven Stallion
hgweb: support alternate logo url...
r13964 <a href="{logourl}">
Thomas Arendsen Hein
hgweb: urlescape all urls, HTML escape repo/tag/branch/... names...
r18526 <img src="{staticurl|urlescape}{logoimg}" alt="mercurial" /></a>
Augie Fackler
web: add a help view for getting hg help output
r12666 </div>
<ul>
Thomas Arendsen Hein
hgweb: urlescape all urls, HTML escape repo/tag/branch/... names...
r18526 <li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">log</a></li>
<li><a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a></li>
<li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
<li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
<li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
Augie Fackler
web: add a help view for getting hg help output
r12666 </ul>
<ul>
Gregory Szorc
templates: support linking to main help page...
r27580 {if(subindex,
'<li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>',
'<li class="active">help</li>'
)}
Augie Fackler
web: add a help view for getting hg help output
r12666 </ul>
</div>
<div class="main">
Angel Ezquerra <angel.ezquerra at gmail.com>
hgweb: add a "URL breadcrumb" to the index and repository pages...
r18258 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
Gregory Szorc
hgweb: consolidate search form for paper...
r32758 {searchform}
Augie Fackler
web: add a help view for getting hg help output
r12666 <table class="bigtable">
av6
hgweb: make anchor name actually match its href on help index page
r30019 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
Augie Fackler
web: add a help view for getting hg help output
r12666 {topics % helpentry}
Gregory Szorc
templates: make earlycommands and othercommands optional...
r27578 {if(earlycommands, '
Augie Fackler
web: add a help view for getting hg help output
r12666 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
{earlycommands % helpentry}
Gregory Szorc
templates: make earlycommands and othercommands optional...
r27578 ')}
Augie Fackler
web: add a help view for getting hg help output
r12666
Gregory Szorc
templates: make earlycommands and othercommands optional...
r27578 {if(othercommands, '
Augie Fackler
web: add a help view for getting hg help output
r12666 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
{othercommands % helpentry}
Gregory Szorc
templates: make earlycommands and othercommands optional...
r27578 ')}
Augie Fackler
web: add a help view for getting hg help output
r12666 </table>
</div>
</div>
{footer}