<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-size:12.8px">This patch does print '"buglink": null' if buglink isn't defined, but<br></span><span style="font-size:12.8px">'"testedwith": ""' if testedwith is undefined. It seems inconsistent.</span></blockquote><div><br></div><div>Right, i changed to show "" instead in PATCH V2. In json it seems more reasonable, let me now what you think.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-size:12.8px">I might be too nitpicky, but why not use the original testedwith variable?</span></blockquote><div><br></div><div>Original string value was split to be list of versions, thanks to that in my view method is more readable. If You think otherwise i will change it, i stay with this behaviour in PATCH V5 because now all values beside extname are guarded to not show None value by:</div><div>value or ""</div><div>and it seems consistent</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-size:12.8px">If I were you, I would add an extension that has no buglink nor testedwith,<br></span><span style="font-size:12.8px">and load it by extensions.foo=foo.py.</span></blockquote><div><br></div><div>Done this in PATCH V5 </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-size:12.8px">There's no branching for "buglink <op> testedwith".</span></blockquote><div><br></div><div>I dont understand what you meant </div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-09-24 15:05 GMT+02:00 Yuya Nishihara <span dir="ltr"><<a href="mailto:yuya@tcha.org" target="_blank">yuya@tcha.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, 23 Sep 2015 23:32:25 +0200, liscju wrote:<br>
> # HG changeset patch<br>
> # User liscju <<a href="mailto:piotr.listkiewicz@gmail.com">piotr.listkiewicz@gmail.com</a>><br>
> # Date 1441896787 -7200<br>
> #      Thu Sep 10 16:53:07 2015 +0200<br>
> # Node ID 682511eeaa61ac914e2455bc1dddf1c41211bfd1<br>
> # Parent  ea489d94e1dc1fc3dc1dcbef1c86c18c49605ed1<br>
> mercurial: add debugextensions command (issue4676)<br>
<br>
</span><div><div class="h5">> +@command('debugextensions', formatteropts, [], norepo=True)<br>
> +def debugextensions(ui, **opts):<br>
> +    '''show information about active extensions'''<br>
> +    exts = extensions.extensions(ui)<br>
> +    fm = ui.formatter('debugextensions', opts)<br>
> +    for extname, extmod in sorted(exts, key=operator.itemgetter(0)):<br>
> +        extsource = extmod.__file__<br>
> +        exttestedwith = getattr(extmod, 'testedwith', None)<br>
> +        if exttestedwith is not None:<br>
> +            exttestedwith = exttestedwith.split()<br>
> +        extbuglink = getattr(extmod, 'buglink', None)<br>
> +<br>
> +        fm.startitem()<br>
> +<br>
> +        if ui.quiet or ui.verbose:<br>
> +            fm.write('name', '%s\n', extname)<br>
> +        else:<br>
> +            fm.write('name', '%s', extname)<br>
> +            if not exttestedwith:<br>
> +                fm.plain(_(' (untested!)\n'))<br>
> +            else:<br>
> +                if exttestedwith == ['internal'] or \<br>
> +                                util.version() in exttestedwith:<br>
> +                    fm.plain('\n')<br>
> +                else:<br>
> +                    lasttestedversion = exttestedwith[-1]<br>
> +                    fm.plain(' (%s!)\n' % lasttestedversion)<br>
> +<br>
> +        fm.condwrite(ui.verbose and extsource, 'source',<br>
> +                 _('  location: %s\n'), extsource)<br>
> +<br>
> +        fm.condwrite(ui.verbose and exttestedwith, 'testedwith',<br>
> +                 _('  tested with: %s\n'), ' '.join(exttestedwith or []))<br>
<br>
</div></div>I might be too nitpicky, but why not use the original testedwith variable?<br>
<br>
This patch does print '"buglink": null' if buglink isn't defined, but<br>
'"testedwith": ""' if testedwith is undefined. It seems inconsistent.<br>
<br>
> How many test case should i add: with mocked extensions with/without<br>
> testedwith,with/without buglink etc or just for mocked extension without<br>
> testedwith?<br>
<br>
If I were you, I would add an extension that has no buglink nor testedwith,<br>
and load it by extensions.foo=foo.py.<br>
There's no branching for "buglink <op> testedwith".<br>
<br>
Regards,<br>
</blockquote></div><br></div>