On Sat, 1 Apr 2017 15:56:25 -0700, Jun Wu wrote: > Excerpts from Yuya Nishihara's message of 2017-04-01 23:39:34 +0900: > > > > + yield (section, item, (value, source)) > > > > We might want to keep filename and line number separately in future version. > > Since there are other sources like "setconfig", "--config", "--verbose", and > the new "$ENVNAME", maybe "source" needs to a tuple or something more > complex / typed. But it's probably another series.
Yeah, that's kinda unrelated topic to the core functions in this series. I just recalled someone (Mathias?) wanted to get source filenames. > The immutable configs (other than fileconfig) do not assume the format of > the tuple "(section, item, value)". So if we do change it to "(section, > item, (value, ('file', path, line)))", other objects won't need change. > > > > +class filteredconfig(abstractimmutableconfig): > > > > + """immutable config that changes other configs""" > > > > + > > > > + def __init__(self, title, subconfig, filters=None): > > > > + """ > > > > + filters: a dict-ish, {section: filterfunc or sortdict-ish} > > > > + a filterfunc takes sortdict-ish and returns > > > > sortdict-ish > > > > + a sortdict-ish will replace the section directly > > > > + """ > > > > So this is more like "map" operation? I thought filterfunc would return > > booleans. > > It should probably be renamed to "transformfunc". and "transformedconfig" respectively, maybe. _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel