[PATCH 2 of 3] move store walking from streamclone.py into store.py

Adrian Buehlmann adrian at cadifra.com
Mon Jul 21 16:28:10 CDT 2008


On 21.07.2008 23:08, Adrian Buehlmann wrote:
> On 21.07.2008 22:15, Matt Mackall wrote:
>> On Mon, 2008-07-21 at 21:43 +0200, Adrian Buehlmann wrote:
>>> # HG changeset patch
>>> # User Adrian Buehlmann <adrian at cadifra.com>
>>> # Date 1216645162 -7200
>>> # Node ID 00e5d2425f873233e06ed3c6631211ce49935c84
>>> # Parent  a7f1babd458d9cb5b6db1b6d326624ab355b4268
>>> move store walking from streamclone.py into store.py
>> This is looking quite promising.
> 
> Great!
> 
>>> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
>>> --- a/mercurial/localrepo.py
>>> +++ b/mercurial/localrepo.py
>>> @@ -60,14 +60,9 @@
>>>              if r not in self.supported:
>>>                  raise repo.RepoError(_("requirement '%s' not supported") % r)
>>>  
>>> -        # setup store
>>>          if "store" in requirements:
>>> -            self.encodefn = store.encodefilename
>>> -            self.decodefn = store.decodefilename
>>>              self.spath = os.path.join(self.path, "store")
>>>          else:
>>> -            self.encodefn = lambda x: x
>>> -            self.decodefn = lambda x: x
>>>              self.spath = self.path
>> Seems like we ought to get spath from store.path, no? Then this if logic
>> can vanish entirely.
> 
> Hmm. Yes, why not. I'll try that.
> 

On second thought, the problem is again statichttprepo:

Compare (localrepo.py):

         if "store" in requirements:
             self.spath = os.path.join(self.path, "store")

with (statichttprepo.py):

         if "store" in requirements:
             self.spath = self.path + "/store"

This starts me thinking whether it might be a layering violation to try
moving the logic which defines the base path of the store into store.py.

Maybe the store should not try to figure out by itself where it ought
to be, no?






More information about the Mercurial-devel mailing list