[PATCH v2] version: show enabled extensions (issue4209)

Augie Fackler raf at durin42.com
Tue Jun 17 12:21:30 CDT 2014


On Sat, Jun 14, 2014 at 12:05:07AM +0300, anatoly techtonik wrote:
> On Thu, Jun 12, 2014 at 5:05 AM, Greg Ward <greg at gerg.ca> wrote:
>
> > > +        maxnamelen = max(len(n) for n in names)
> > > +        for i,n in enumerate(names):
> >
> > This shows that you didn't run contrib/check-code.py. Should be a
> > space after the comma.
> >
>
> Awesome tool. Is it available as a pre-commit hook?
>
>
> >py ../contrib/check-code.py extensions.py
> extensions.py:374:
>  >           and callable(module.get_version)):
>  callable not available in Python 3, use getattr(f, '__call__', None)
>
> Hmm.. Another Python 3 wart?
> Should the correct hint be hasattr(module.getversion, '__call__')?
> (util.safehasattr)

The hint could actually stand to be safehasattr.

> Or should I ignore this Python 3 warning?

No, make check-code happy. Let's not make the python 3 port any harder
than it needs to be.

>
>
>  > +            ui.write("  %s  %s\n" % (n.ljust(maxnamelen), vers[i]))
> >
> > You can do the justification in the format string, something like
> >
> >   ui.write("  %*s  %s\n" % (maxnamelen, n, vers[i]))
> >
> > (untested!).
>
>
> Works with nice effect - right justification, but looks better IMO.

> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list