[PATCH 3 of 6 mergedriver] mergestate: add a constructor that sets up a fresh merge state

Martin von Zweigbergk martinvonz at google.com
Tue Nov 17 18:57:07 CST 2015


On Tue, Nov 17, 2015 at 4:49 PM Siddharth Agarwal <sid at less-broken.com>
wrote:

> On 11/17/15 16:33, Martin von Zweigbergk wrote:
> > I agree, but I'd rather have something that sounds like it does
> > something also return something than have something that sounds like
> > it only return something also do something. Unexpected side-effects
> > are worse than unexpected return values. It's pretty common to have
> > methods like list.pop() that modify the list and return something,
> > after all. Not a perfect analogy, I know. Maybe some other name?
>
> OK -- did 'fresh' not convey that to you?
>

I think the reason it didn't convey that is because I read your explanation
saying that you didn't like 'reset' because it is more like an action, so I
interpreted that as saying that 'fresh' is not an action. If I had just
seen the method name without a motivation, I'm not sure what I would have
thought. I would probably have looked at the docstring, which does say that
it removes state on disk.


>
> 'new' is similar but is a massively overloaded term in programming.
>
> What about 'newreset'? Then the other one, which I'm calling 'read'
> right now, can be 'newread'.
>
> - Siddharth
>

I think I would prefer mergestate.clean(). I would not be surprised that it
returns the clean state. But then again, perhaps 'fresh' would also be fine
if looking at it without preconception. You pick. If you choose to keep
'fresh', I can just queue the series.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20151118/9b1d8f86/attachment.html>


More information about the Mercurial-devel mailing list