[PATCH 1 of 6 V2 RFC] localrepo: introduce shared method to check if a repository is shared

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sun Jan 4 01:10:56 CST 2015



On 01/03/2015 08:38 AM, Angel Ezquerra wrote:
> On Wed, Dec 31, 2014 at 1:54 AM, Pierre-Yves David
> <pierre-yves.david at ens-lyon.org> wrote:
>>
>>
>> On 12/30/2014 04:46 PM, Angel Ezquerra wrote:
>>>
>>> On Tue, Dec 30, 2014 at 11:00 PM, Pierre-Yves David
>>> <pierre-yves.david at ens-lyon.org> wrote:
 >>>>
>>>> On 12/26/2014 03:46 AM, Angel Ezquerra wrote:
>>> The problem is that the localrepository.sharedpath property is not
>>> private and people are already using it, comparing it to
>>> localrepository.path, to check if a repository is shared. I think this
>>> is bad form and also limits the ways in which we can change the way
>>> shared subrepos are implemented. My solution was to commit the crime
>>> and add a new method to localrepository :-> (then we could make
>>> sharedpath private). Do you think adding a function in the share
>>> extension would solve the problem? My feeling is that it would not.
>>
>>
>> The function will behave as the method:
>>
>>    shared(repo) → None or 'shared' or 'full'
>>
>> And it will be requested to use it instead of check attribute
>
> The problem with this is that I'd like to make the
> localrepository.sharedpath property private (i.e. rename it into
> _sharedpath) to make it clear that it must not be accessed from other
> classes. But then the shared function would need to access that
> private property which seems wrong.

I kind of agree it feels wrong, but lets says they are private to the 
shared extensions. (only defined and accessed there).


-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list