Le 10/11/2010 10:54, gh a écrit :
> 
> gh <[email protected]> added the comment:
> 
> 2010/11/9 Florent Becker <[email protected]>:
>>
>> Florent Becker <[email protected]> added the comment:
>>
>>> The good thing is that repositories with that _darcs/pristine.none
>>> file keep on being recognized as NoPristine repositories, so from the
>>> retro-compatibility point of view, I think this change is OK.
>>
>> Can you add a test that we keep this file when it exists?
> 
> I have tried writing such a test but when you think about the possible
> cases you get:
> 
> * either test that "darcs repair" leaves pristine.none in a hashed
> repository, which is a useless test since hashed repos always have a
> hashed prsitine.
> * either test that "darcs repair" leaves pristine.none in an OF
> repository. I tried to do that but I realized that "darcs repair"
> never works in an OF repository without the _darcs/pristine/
> directory, before or after this bundle. So "darcs repair" just fails
> in that case.
> 
> In short, the fix for issue1977 in this bundle does not fix the case
> of OF repositories, but only for hashed repositories. OTOH it does not
> degrade the behaviour of darcs for the OF case.
> 
> Since by looking at the code it is clear that no pristine.none or
> current.none file is removed, I suggest we can do without such a test,
> what do you think?
> 
I agree on that, no need to test if previous behaviour was buggy anyway.

> 
>> hunk ./src/Darcs/Repository/Pristine.hs 116
>>>      bug "3 HashedPristine is not implemented yet."
>>>
>>>  createPristineFromWorking :: Pristine -> IO ()
>>> -createPristineFromWorking (NoPristine _) = return ()
>>> +createPristineFromWorking NoPristine = return ()
>>>  createPristineFromWorking (PlainPristine n) = cloneTreeExcept
>> [darcsdir] "." n
>>>  createPristineFromWorking HashedPristine =
>>>      bug "HashedPristine is not implemented yet."
>>
>> ok (isn't the  bug "HashedPristine is not implemented yet." a lie?)
>>
> 
> Yes the bug strings are wrong: these cases can never be reacher in the
> current state of the code.
> Writing a patch for that. What a plate of spaghetti.
> 

If we remove enough of them, we get to go to some fancy italian for next
sprint.
> 
>>>  easyCreatePartialsPristineDirectoryTree :: FilePathLike fp => [fp] ->
>> Pristine
>>>                                          -> FilePath -> IO Bool
>>> -easyCreatePartialsPristineDirectoryTree _ (NoPristine _) _ = return
>> False
>>> +easyCreatePartialsPristineDirectoryTree _ NoPristine _ = return False
>>>  easyCreatePartialsPristineDirectoryTree prefs (PlainPristine n) p
>>>   = clonePartialsTree n p (map toFilePath prefs) >> return True
>>>  easyCreatePartialsPristineDirectoryTree _ HashedPristine _ =
>>
>> A haddock for easy… would be welcome.
> 
> OK I'll try.
> 
Thanks, applying in the meantime,

Florent

_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to