Author: Ben Franksen <ben.franksen@online.de>
Date: Fri Sep 29 22:09:08 CEST 2017
* refactored convert darcs-2 command
There is no need to merge anything when converting, we can just add the
patches to the new repo, committing our changes every 100 patches like we
did before.
To get the types right was a challenge. I added checkRepoIsNoRebase to
Darcs.Repository.Job so as not to pollute the command implementation
with a
host of obscure singleton types. Using foldFL_M requires two separate
newtype wrappers (W2 and W3) because the procedures we want to fold
simultaneously change two and three witnesses, respectively, and not just
the last one. It may be possible to encapsulate this somehow, but I leave
that to future refactorings. In spite of all that effort, we still need to
coerce the repo parameter in two places, which I extensively
documented: one
to work around the types of finalizeRepositoryChanges and
revertRepositoryChanges (which are not precise enough) and another one to
work around the type of withRepoLock (which is too restrictive).
Attachments
|