[darcs-devel] [patch2201] remove most of Darcs.Patch.RepoType (and 12 more)

Ben Franksen bugs at darcs.net
Wed Jun 9 14:50:14 UTC 2021

New submission from Ben Franksen <ben.franksen at online.de>:

Here is the first batch of "interesting" changes that redefines the rt
(RepoType) parameter and removes the witness for the tentative state. It
also makes all repo state follow the transaction protocol.

I am not screening this bundle immediately to leave room for discussion, as
these are quite far-reaching changes.

13 patches for repository http://darcs.net/screened:

patch 241eb0fdc7c2f731dca0386aee7b6ab2f6e0fa61
Author: Ben Franksen <ben.franksen at online.de>
Date:   Tue Jan 19 16:00:23 CET 2021
  * remove most of Darcs.Patch.RepoType
  This removes the type distinction between repos with and without a rebase in
  progress. The 'rt :: RepoType' type parameter (and its kind RepoType) are
  kept for now, in case we ever want to re-introduce such a type distinction
  for some other purpose.

patch 00777493abb3256e84992afb3d2d47f1c2d57111
Author: Ben Franksen <ben.franksen at online.de>
Date:   Wed Feb 24 23:57:16 CET 2021
  * remove rt::RepoType type parameter from PatchSet and PatchInfoAnd

patch 4c85d8b43eaae6410724e9d19a2532fc84960952
Author: Ben Franksen <ben.franksen at online.de>
Date:   Thu Feb 25 00:04:03 CET 2021
  * re-type the rt type parameter to AccessType=RO|RW
  This patch does not yet go the full way of changing all Repository access
  procedures, only some of the central pieces: revertRepositoryChanges and
  finalizeRepositoryChanges, withRepoLock, repo creation and identification.
  Commands that call withRepoLock now take the lock even when --dry-run is in
  effect. This fixes a potential race condition because in dry-run mode these
  commands still modified the tentative state on disk. Instead, the dry-run
  option is now evaluated in the finalizing procedures (which includes,
  currently, addPendingDiffToPending and addToPending).

patch 5c084c8f97a20c5291fedadfef4c226a875f29c3
Author: Ben Franksen <ben.franksen at online.de>
Date:   Thu Feb 25 16:45:59 CET 2021
  * convert D.R.Hashed functions to take access typed Repository
  All procedures in D.R.Hashed that access the tentative state now take a
  Repository 'RW, while 'readPatches' stays polymorphic, but reads the
  tentative or the recorded state, depending on the Repository access type
  parameter. This required to export SAccessType from D.R.InternalTypes and
  return that type from repoAccessType, so that pattern matching on the result
  forces unification of the Repository's access type.

patch 64008265cf5bb7b1e0619d286cb70d9b4ec54b08
Author: Ben Franksen <ben.franksen at online.de>
Date:   Sat Feb 27 09:49:25 CET 2021
  * convert size-prefixed pristine when we start a transaction
  We must not modify _darcs/hashed_inventory except when finalizing a

patch ecfc634b88fdf307c247e05b3797e8f9cc44d76e
Author: Ben Franksen <ben.franksen at online.de>
Date:   Thu Feb 25 22:27:10 CET 2021
  * writeTentativeInventory now takes a Repository argument

patch 3fd6d87619d098cdeadbe6316f7887c29f7141e9
Author: Ben Franksen <ben.franksen at online.de>
Date:   Sat Feb 27 11:23:18 CET 2021
  * convert D.R.Pristine to assign the correct access type parameters
  The same schema as in D.R.Hashed applies: functions that modify the
  tentative pristine are only available for 'RW typed repos, those that only
  read pristine decide at runtime which files to read and stay polymorphic.
  A special (and ugly) case is replacePristine which has a case for 'RO typed
  repos, which should only be used when creating a fresh repo. The 'RW case
  now modifies the tentative pristine, so we need to add missing finalization
  in the repair and optimize pristine commands.

patch d2669ee09f8598b4054e2f663b3aa08abc147623
Author: Ben Franksen <ben.franksen at online.de>
Date:   Mon Mar  1 16:27:02 CET 2021
  * fix rt ~ 'RO in AskAboutDeps

patch ba73b15970f91c8d37e80c83c1ff8a32b475a391
Author: Ben Franksen <ben.franksen at online.de>
Date:   Sat Feb 27 11:14:54 CET 2021
  * replace readTentativePristine with the generalized readPristine
  The latter now now does the right thing for both RO and RW repos.

patch f31a6374dcee92fc0312ed1245cf7ba504f9b871
Author: Ben Franksen <ben.franksen at online.de>
Date:   Thu Feb 25 12:54:51 CET 2021
  * lock/unlock inside revert/finalizeRepositoryChanges
  This has the disadvantage that intermediate commits also unlock the
  repository for a short time. However, intermediate commits are mostly
  unnecessary, the only remaining instance is in convert darcs-2, which will
  soon become obsolete anyway.

patch 524d393e6dbb75218508be13ed74dc4487a03dd5
Author: Ben Franksen <ben.franksen at online.de>
Date:   Mon Mar  1 16:16:35 CET 2021
  * remove the tentative state witness parameter for Repository
  Since we now distinguish at the type level and at runtime whether we are in
  a transaction or not, it no longer makes sense to keep the distinction
  between the recorded and the tentative state: inside a transaction the
  recorded state is irrelevant and should be ignored, while outside a
  transaction the tentative state should be ignored and only the recorded
  state is relevant. When we start a transaction both states coincide by
  definition (we throw away any existing tentative state). When we end a
  transaction, we throw away the recorded state and overwrite it with the
  tentative one.
  Note that not all of Darcs.Repository has been changed yet to follow the
  transaction protocol yet, in particular the pending and unrevert states.
  This will be done in a later patch because the distinction between recorded
  and tentative state gets in the way of making the decision at runtime when
  reading the state. Also note that while this patch touches many lines of
  code, the changes are very systematic and mostly mechanical.

patch c36151bdd403a6516afe1d022ef0fc55aaacaf1f
Author: Ben Franksen <ben.franksen at online.de>
Date:   Wed Mar  3 15:12:32 CET 2021
  * make D.R.Traverse procedures RW so they work on the tentative state
  This required fixing convert import where cleanRepository was called after
  finalizing the transaction.

patch 878794434cee4b9ca72dad57e90c5a6e51748827
Author: Ben Franksen <ben.franksen at online.de>
Date:   Tue Mar  2 10:29:35 CET 2021
  * make pending and unrevert follow transaction protocol
  This means that all modifications are made to the tentative versions and
  that we define and systematically use revert/finalize.
  Note that the implementations of revertTentativeUnrevert and
  finalizeTentativeUnrevert are tricky: the case where we have no unrevert
  bundle present must be handled carefully.

files: patch-preview.txt, remove-most-of-darcs_patch_repotype.dpatch, unnamed
messages: 22879
nosy: bf
status: needs-screening
title: remove most of Darcs.Patch.RepoType (and 12 more)

Darcs bug tracker <bugs at darcs.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-preview.txt
Type: text/x-darcs-patch
Size: 220673 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20210609/ffec045d/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: remove-most-of-darcs_patch_repotype.dpatch
Type: application/x-darcs-patch
Size: 223012 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20210609/ffec045d/attachment-0003.bin>
-------------- next part --------------

More information about the darcs-devel mailing list