[PATCH 3 of 6 mergedriver] mergestate: add a constructor that sets up a fresh merge state
Martin von Zweigbergk
martinvonz at google.com
Wed Nov 18 00:33:20 UTC 2015
On Tue, Nov 17, 2015 at 4:25 PM Siddharth Agarwal <sid at less-broken.com>
wrote:
> On 11/17/15 16:20, Martin von Zweigbergk wrote:
> > When I saw patch 4/6, I was wondering how the merge state got removed
> > from disk. It turns out that ms.reset() does that. So this method
> > (fresh()) *is* a method for performing an action after all, right?
>
> Right, but something like mergestate.reset() returning a new merge state
> sounds really weird to my (admittedly non-native) ears.
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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-devel/attachments/20151118/e784e536/attachment-0002.html>
More information about the Mercurial-devel
mailing list