[PATCH 6 of 7] context: add obsolete related function to changectx

Matt Mackall mpm at selenic.com
Fri Jun 1 15:52:14 CDT 2012


On Thu, 2012-05-24 at 10:42 +0200, Pierre-Yves David wrote:
> >> ctx.replmarkers(): yield markerctx for marker making this changeset a
> >> remplacement
> > 
> > For both of these, we should lose "markers" and name them obsoleted()
> > and replaced().
> 
> We need to be careful here, we have tons of various useful information
> to access regarding obsolete marker. We need a consistent naming
> there. But we may need to wait until we have a wider panel of
> user-code to freeze it:

And my point is "that naming should not include the string 'marker'
because 'marker' is content-free filler". It's like prefixing your
function names with "do": of course it's going to "do" something, it's
code.

An ideal name will be unambiguous about the direction of the action.
This is tricky. Consider:

 X obsoleted Y   vs   X is obsoleted by Y
 X replaced Y    vs   X is replaced by Y

Both are reasonable interpretations of X.obsmarkers() or X.replmarkers()
In fact, one of them is implicitly using the first column while the
other is implicitly using the second.

Now with a name like X.obsoleters(), we can be pretty sure we're going
to get the things that make X obsolete. Now we just need a name that
conveys the opposite direction.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list