[PATCH] Partially-cached gits are now cleaned up instead of persisting.

Dan Firth dan.firth at codethink.co.uk
Thu Oct 10 12:57:42 BST 2013


On 08/10/13 17:26, Lars Wirzenius wrote:
> On Mon, Oct 07, 2013 at 04:08:42PM +0100, Richard Maw wrote:
>> On Mon, Oct 07, 2013 at 02:49:12PM +0100, Daniel Firth wrote:
>>> @@ -259,16 +276,20 @@ class LocalRepoCache(object):
>>>                   return self.get_repo(reponame)
>>>               else:
>>>                   errors.append(error)
>>> -
>>>           repourl = self._resolver.pull_url(reponame)
>>>           path = self._cache_name(repourl)
>>> +        tmp_path = self._mkdtemp(self._cachedir)
>>> +        target = os.path.join(tmp_path, "actual")
>>>           try:
>>> -            self._git(['clone', '--mirror', '-n', repourl, path])
>>> +            self._git(['clone', '--mirror', '-n', repourl, target])
>> I also suggested cloning directory into the directory you got from
>> mkdtemp, since that removes the need for the _rmtree in the success
>> cleanup case.
> I think we should do this change when merging.
>
>> However, it's already acceptable, and I'll give it a +1, whether you
>> decide to tidy that up further or not.
> +1 from me assuming the change above is done at merge time. (No need
> for reviewing that change, if ./check --full continues to work.)
>
I don't think this works like everyone thinks it works, cloning directly 
into that directory breaks the testsuite in several places.

Dan



More information about the baserock-dev mailing list