[PATCH 1 of 2] bundlerevlog: extract 'baserevision' method
lopek at fb.com
Tue Aug 27 13:34:14 CDT 2013
> From: Augie Fackler [mailto:raf at durin42.com]
> Sent: Tuesday, August 27, 2013 10:26 AM
> To: Wojciech Lopata
> Cc: mercurial-devel at selenic.com
> Subject: Re: [PATCH 1 of 2] bundlerevlog: extract 'baserevision' method
> On Tue, Aug 27, 2013 at 1:20 PM, Wojciech Lopata <lopek at fb.com> wrote:
> >> Is this change (and the other ones like it) actually necessary? Is
> >> filelog.filelog.revision not currently the same as revlog.revlog.revision?
> >> (That is: couldn't this use the method from the base class for now?)
> > First of all, I need this change only in bundlemanifest (in bundlefilelog and bundlechangelog I added it only for consistency)
> What I meant was, "do you actually need to do this explicit forwarding
> of the method to the superclass, since that's what would happen if you
> didn't add this particular line?" - I understand adding the hook for a
> tinymanifest extension :)
To make sure it is clear - http://pastebin.com/MEkgDDzs - that's what I mean by 'replacing class'.
Why overriding ' baserevision ' in bundlemanifest class in the way I do it makes sense? When my extension is loaded and manifest class is replaced, semantic of
class bundlemanifest(bundlerevlog, manifest.manifest)
class bundlemanifest(bundlerevlog, tinymanifest)
Similarly, manifest.manifest.revision means now tinymanifest.revision. And this is not revlog.revlog.revision.
If we go with only creating 'baserevision' hook, without overriding it in bundlemanifest, I will need to put something like this in my extension's code: http://pastebin.com/BXLGWFET. Same with unionrepo. This is basically a copy&paste, so I wanted to avoid it, but if we still disagree on overriding 'baserevision' in bundlemanifest, I can go with it.
More information about the Mercurial-devel