[PATCH v2] version: show enabled extensions (issue4209)
Greg Ward
greg at gerg.ca
Sat Jun 14 20:24:17 CDT 2014
On 14 June 2014, anatoly techtonik said:
> 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?
Good idea. Why don't you set one up and report how it went?
http://mercurial.selenic.com/wiki/Hook
> > + 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.
Oops, my mistake. IMHO left justification is preferred here. This
should do it:
ui.write(" %-*s %s\n" % (maxnamelen, n, vers[i]))
Greg
--
Greg Ward http://www.gerg.ca
<greg at gerg.ca> @gergdotca
More information about the Mercurial-devel
mailing list