"prettify" patchbomb?

Thomas Arendsen Hein thomas at intevation.de
Fri Dec 28 09:10:40 CST 2007


* Christian Ebert <blacktrash at gmx.net> [20071227 18:59]:
> * Thomas Arendsen Hein on Thursday, December 20, 2007 at 11:06:23 +0100
> > * Christian Ebert <blacktrash at gmx.net> [20071218 02:41]:
> >> BTW, patchbomb "violates"
> >> <http://www.selenic.com/mercurial/wiki/index.cgi/Basic_Coding_Style>
> >> in several places (overlong lines, no linebreak after colon
> >> etc.), should I "prettify" it?
> >
> > Sure, that would be nice.
> 
> Right. I'll wait until the inline/attach patch has gone thru
> though.

mpm pushed your overlong lines patch from the 18th.

> >> Also, the use of opts.get is a bit inflationary, imo. Do
> >> something like: "obundle = opts.get('bundle')", and then reuse
> >> obundle? Or is opts.get preferred?
> >
> > opts.get is more explicit, so I'd prefer that unless there are
> > noticeable performance penalties, but I don't think this is the case
> > for patchbomb. An exception for this would be if you say e.g.
> >  bundle = opts.get('bundle') or foobar
> > (or some other magic after reading the option) in which case the
> > bundle variable has an additional meaning besides just being a copy
> > of the option.
> 
> Ok. And there's no preferred/canonical way concerning
> opts.get('bundle') vs. opts['bundle'] ?

opts.get is the safer (and more convenient) thing to use, because
people directly calling functions in commands.py will not have to
pass uninteresting options or adjust their python code for new
options.

Thomas

-- 
thomas at intevation.de - http://intevation.de/~thomas/ - OpenPGP key: 0x5816791A
Intevation GmbH, Osnabrueck - Register: Amtsgericht Osnabrueck, HR B 18998
Geschaeftsfuehrer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner


More information about the Mercurial-devel mailing list