darcs

Patch 1730 add RepoPatchV3 aka camp conflictors, now with almost complete integration

Title add RepoPatchV3 aka camp conflictors, now with almost complete integration
Superseder Nosy List bfrk, ganesh
Related Issues
Status accepted Assigned To ganesh
Milestone

Created on 2018-09-15.10:35:55 by bfrk, last changed 2019-08-06.09:45:19 by ganesh.

Files
File name Status Uploaded Type Edit Remove
add-some-functions-we-need-for-v3-to-darcs_patch_ident.dpatch dead bfrk, 2019-06-12.12:12:54 application/x-darcs-patch
add-some-functions-we-need-for-v3-to-darcs_patch_ident.dpatch bfrk, 2019-06-12.17:46:09 application/x-darcs-patch
patch-preview.txt bfrk, 2019-06-12.12:12:54 text/x-darcs-patch
patch-preview.txt bfrk, 2019-06-12.17:46:09 text/x-darcs-patch
unnamed bfrk, 2019-06-12.12:12:54 text/plain
unnamed bfrk, 2019-06-12.17:46:09 text/plain
See mailing list archives for discussion on individual patches.
Messages
msg20312 (view) Author: bfrk Date: 2018-09-15.10:35:50
This is my V3 branch, squached to a few (large) patches.

I will not screen it yet but I have uploaded it to
https://hub.darcs.net/bf/darcs-bf-v3, review at your leisure.

The addition of the V3 stuff to the test suite is unfortunately mixed with a
number of refactoring and cleanup changes there. If this hurts review I am
willing to spend some effort to separate them out.

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

patch 4d3f3b0d8738657b041fbf49cd84881254a799fd
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Sep 15 10:56:21 CEST 2018
  * add class IdEq2 to Darcs.Patch.Ident
  
  This allows a faster equality test for FLs of patches with identity.

patch b40a076b8098ae0c6b34748d1c4d0c7ccfaf59ed
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Sep 15 10:53:07 CEST 2018
  * add some functions we need for V3 to Darcs.Patch.Ident

patch f6f36653b6567ef844d231db2b1b134349d5a684
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Sep 15 09:50:19 CEST 2018
  * add RepoPatchV3 aka camp conflictors

patch 802a2f2a075a8c7aeb0d85ad9306c9b3c68e8a71
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Sep 15 10:06:22 CEST 2018
  * add V3 stuff to the test suite (quickcheck tests only)
Attachments
msg20456 (view) Author: bfrk Date: 2018-11-12.21:00:21
This patch will most probably no longer apply cleanly. As I have 
explained on the list, I am exploring the possibility of turning this 
into a pure optimization for V1 Mergers, getting rid of prim patch 
identifiers, and obviating the need for a new and incompatible patch 
format.
msg20627 (view) Author: bfrk Date: 2019-01-23.21:38:52
This is a literal copy of my email to @darcs-devel, posted here for
reference.

------------
As mentioned in my comments to http://bugs.darcs.net/issue2614 it is now
clear that we cannot solve the inconsistencies of the existing darcs
patch formats using "merge-by-value" as this leads to a loss of
permutivity. The only solution is to move forward toward
RepoPatchV3/Camp which is based on /named/ prim patches. These are
wrappers around our current prim patch types that add an identifier
which consists of the hash of the meta data of the named patch to which
they belong, together with a counter to distinguish between the several
prims inside a named patch (assigned when it is recorded). The counter
would not be strictly necessary to get the theory right, but adding it
makes many of the operations on V3 patches a lot more efficient:
equality of named prim patches in the same (pre or post) context reduces
to equality of their identifiers; we can also define an Ord instance and
use Data.Set to store e.g. the set of conflicting (contexted) patches in
a Conflictor.

It is important to note, however, that when we work with prim patches
directly, i.e. outside the implementation of RepoPatchVX, we usually
want to handle the underlying unnamed prim patches: unrecorded changes
and rebase fixups are not part of a Named patch, they are anonymous.
Thus I believe it is best to let (PrimOf p) remain the unnamed prim type
underlying a RepoPatch, even for RepoPatchV3.

The major stumbling block to the integration of named prim patches (i.e.
prim patches with identifiers) into the class based patch interfaces is
the class FromPrim with its fromPrim method to construct a patch of type
p out of a prim patch of type (PrimOf p). Named prims cannot have
instances for that class, at least not cleanly, because to construct a
named prim we need the ingredients for the identifier.

I have been working on minimizing the use of fromPrim throughout the
code base. After a few rounds of refactorings I arrived at a situation
where the overloaded fromPrim is really only needed for the rebase
implementation and --for the time being-- the functions anonymous and
infopatch from Darcs.Patch.Named (which now take prims as input). (Not
counted here are uses of fromPrim inside the implementation of
RepoPatchV1 and RepoPatchV2 as these do not affect the general RepoPatch
API.) The Named constructor infopatch will need to be adapted to create
appropriate identifiers for the prims it gets passed.

Problematic are the anonymous constructor and the remaining uses of
fromPrim inside the rebase implementation. The use case here is the
same: to commute/merge prims with Named patches. I have been thinking of
using a really dirty hack here: randomly generate (hopefully) unique
prim patch identifiers and wrap that with unsafePerformIO. This would
allow us to lift an arbitrary prim to a RepoPatchV3. But note that the
implementation of RepoPatchV3 stores prim patches /with/ identifiers
inside conflictors; if a conflictor stores a reference to some anonymous
prim patch this would be very bad!

So we can do that only if we can guarantee that the identifiers we
conjured out of thin air are never stored inside a regular Named patch
of the repository. In particular, we should never use merge with
anonymously created Named patches and then store the resulting patches
in the repo!

I believe that for the rebase patch this will work because the only way
to leave the rebase patch is via unsuspend and that should flatten out
all existing conflictors (using effect) and thus never create a patch
that contains a Conflictor. I have not yet investigated all uses of the
anonymous constructor, so I can't say yet whether these may prove critical.
------------

Update: I have checked all uses of anonymous and I believe they are all
safe. Will send a preparation bundle for screened with the FromPrim
refactors and another one to update the V3 implementation, with the
first steps taken towards full integration.
msg20654 (view) Author: bfrk Date: 2019-02-14.08:24:56
This bundle superseded the earlier one. It contains full integration of the
new patch format. All tests pass, but one or two minor features are not yet
implemented, see below for details.

I made no change whatsoever to the core algorithms (commute, merge, etc)
relative to the patch bundle I sent previously, only a minor refactor with
regard to the way PrimPatchIds are embedded in the representation.
Particularly, the NamedPrim wrapper is now fully hidden inside the
RepoPatchV3 implementation i.e. PrimOf (RepoPatchV3 prim) ~ prim ~ whatever
the underlying (unnamed) prim patch format is (i.e. usually V1).

The last big hurdle was to implement resolveConflicts. For this to work with
V3 I had to change the type of that method and this required a certain
amount of changes downstream. In particular, we have to pass the whole
history whenever we merge patches because the conflict resolution for V3
requires that. Instead of adding yet another parameter to functions that
already take more parameters than looks healthy, I chose to wrap all passed
patches as a (Fork common us them), where common is a PatchSet starting at
the Origin. This works out nicely due to the laziness of PatchSets, which
are only evaluated (and read from disk) as far as needed. The algorithm for
conflict resolution is documented in detail in the code.

A rather dirty hack makes this algorithm for resolveConflicts work when
unsuspending patches. The function forceCommutePrim (applied to the fixups
of a patch and the suspended patch itself) violated the assumption that a
patch we conflict with must be found somewhere in the context. To fix that
the patches contained in the resulting WDDNamed are now prefixed with @fixup
:>: invert fixup@.

One thing I am planning to do but haven't begun yet is to re-implement the
function that produces the actual conflict markup (mangleUnravelled) for
NamedPrims, taking advantage of the PrimPatchIds to improve the markup so it
includes the hashes of the originating named patches.

Not yet implemented is conversion from earlier formats to darcs-3.

Also not yet implemented is check/repair: I am using the default methods
that are just stubs that don't do anything interesting. The problem here is
that we cannot lift an operation on a list of prims to a list of NamedPrims
if this involves adding or removing prims, which is what the implementation
for Prim.V1 does. This needs to be refactored to handle one prim at a time
which I haven't done yet.

Similarly, showing hunks with surrounding context for v3 patches is
disabled for now. The code that shows a series of hunks with context is a
mess; it bypasses showContextPatch and re-implements showing for V1 prims.
This needs to be cleaned up first.


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

patch 201588ce705f87b17bcb800c113b91d75d3a450e
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 16:50:41 CET 2019
  * add some functions we need for V3 to Darcs.Patch.Ident

patch 2ab2d6ea7d3b4299dee37bc81e36fa35bc9c035d
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:45:13 CET 2019
  * add RepoPatchV3 aka camp conflictors

patch 41d9f81cb0bb0c89d3589440cd2959d0b5df7361
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:45:38 CET 2019
  * add V3 stuff to the test suite (quickcheck tests only)

patch 39e45329fa32f4a682ba1e557ee756a7a1d74327
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * renamed fromPrim to fromAnonymousPrim

patch 9e6f89e0479a740cf4b7ff28150f5f9d284cb400
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * add prim patch identifier when constructing Named patches
  
  This re-adds method fromPrim to class FromPrim, this time with additional
  parameters to construct the identifier. This is then used in function
  infopatch instead of fromAnonymousPrim.

patch d0bbd4aa6e41c41459f09e64239d74f2e64d5850
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * move Darcs.Patch.V3.Prim to Darcs.Patch.Prim.Named
  
  This is actually a fully generic wrapper for any PrimPatch type and
  technically not tied to V3.

patch 3a797b9fc225df6dbb031b29307f4e30c891fa6c
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * add new Darcs3 format option

patch f6b41d01a4487e2d5004f5175113d9dfd90ecc98
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * trivial refactor in D.R.Create

patch 0107cb750c63795b3cd1fb17f94478102ab7dc5d
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * allow runnign the test scripts with darcs-3 format

patch 47609c8e55be5be81dfed655514762c51140f343
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * adapt test skip based on repo format
  
  Now that we have three formats, we can no longer assume that skip-formats
  darcs-1 implies test is run only for darcs-2.

patch 4e79a8698e04ff031c1f3697114777357ce26ac8
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb  9 14:43:32 CET 2019
  * fix in the QC generator for prim patch IDs

patch 2c68e35e4a324ece160ff5e50bdfdaa21c3491ec
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb  9 14:51:59 CET 2019
  * fix instance MightBeEmptyHunk for NamedPrim
  
  Property effectPreserving fails for Prim.V1 empty hunks, and so it does for
  its NamedPrim wrapper.

patch 1b723556f68d6ea9fcc71b9348c74a2c2163a4d5
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb  9 13:27:16 CET 2019
  * separate class Summary out from class Conflict
  
  This prepares a change in the type and meaning of resolveConflicts but makes
  sense independently. The method conflictedEffect is used only to generate a
  summary for potentially conflicted patches and thus has been moved to the
  new class Summary. The class Conflict gets a new method isConflicted which
  just returns whether a patch is conflicted or not.
  Incidentally this gets rid of a number of unneeded instances for Conflict
  with nonsense/dummy implementations for resolveConflicts (such as for Named,
  PatchInfoAnd, RebaseChange, and RebaseSelect).

patch 160164bb4f50312093ab83c721488caea21ffe8e
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb  9 17:10:00 CET 2019
  * add Darcs.Util.Graph
  
  This contains an efficient algorithm to determine maximal independent sets
  of an undirected graph.

patch d61e91e261ee659ff98225948038258dc7df0a34
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 10 13:43:32 CET 2019
  * fix a typo in a comment

patch fffd7cd29873f3c9f5529c79bb859ac86e51887a
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 10 19:28:06 CET 2019
  * fix cloning of darcs-3 format repos

patch 7cd237bf9a779540fe19c332e759e359a1b4cb0d
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 10 21:48:03 CET 2019
  * bugfix in instance ShowContextPatch for NamedPrim

patch dc879f6671f4dbff633ebeeb635a83e8d05337ac
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 10 23:09:51 CET 2019
  * hack: disable showContextSeries for darcs-3 format
  
  The code (in Darcs.Patch.Viewing) that implements showContextSeries messily
  re-implements showing for FLs of primitive patches (hunks in particular),
  circumventing the ShowPatchBasic instance. This means that it cannot take
  prim patch IDs into account since these are added to prim patches as a
  wrapper. This would not be a big problem for display but it is one when we
  use showContextPatch to create a patch bundle because it means that hunks
  are stored without the prim patch ID and thus cannot be read.
  
  The temporary "fix" here is to disable showContextSeries by adding a new
  ListFormatV3, until the context showing code is cleaned up to pass the
  correct prim show function down into showContextSeries.

patch dcceaa03b5ae8ce0c7670e056a1f6ef9eec8aa16
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Feb 12 18:17:39 CET 2019
  * show the PrimPatchId only ForStorage, not ForDisplay
  
  The PrimPatchId is not useful to the user and clutters up the output when
  --verbose is in effect. It also allows more test scripts to pass without
  having to adapt them.

patch f6fa434b182eb283aec29cc5ea8a077cb2c70923
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Feb 12 18:21:32 CET 2019
  * fix expected output in look_for_moves test for darcs-3
  
  The place where we have to adapt the test is when we test teh output of
  'darcs log --machine-readable' which uses the ForStorage format option, so
  we have to expect the hash line before the content.

patch 1850f72913a5057fb12bbfeeff5b5e93ce278c37
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Feb 12 18:36:09 CET 2019
  * tests/pull.sh: expect the correct behavior for darcs-3, too

patch d22ee446187b4954744092a410530b23d2866aad
Author: Ben Franksen <ben.franksen@online.de>
Date:   Wed Feb 13 09:23:01 CET 2019
  * disable repair tests when format is darcs-3
  
  Repairing currently means that we add or drop prims from a sequence, and we
  cannot lift that to NamedPrims. Doing this right requires considerable
  refactors to the Repair interface(s), so this is postponed for now.

patch e46cc62d1d40c0f98d33b7d850efcc172d3b6be6
Author: Ben Franksen <ben.franksen@online.de>
Date:   Wed Feb 13 18:20:58 CET 2019
  * fix rebase unsuspend for v3 with a dirty hack
  
  See comment in the code for the why and how.

patch dcb2738aa6f37a04a803b5b92e7c000f22ecd32e
Author: Ben Franksen <ben.franksen@online.de>
Date:   Wed Feb 13 18:24:09 CET 2019
  * change the type of resolveConflicts
  
  It now gets two RLs of patches as input and produces a simple (not nested)
  list of resolutions. The change in the input type(s) has been done because
  otherwise a RepoPatchV3 cannot correctly implement resolveConflicts, which
  requires that we know the transitive set of conflicting patches for each
  conflict. But a V3 conflictor contains only the patches that directly
  conflict. The separation into two input RLs is so that we can still resolve
  only the conflicts inside a (trailing) segment of all patches in a repo,
  which is how we call it when merging patches.
  
  There are no longer instances of class Conflict for RLs and FLs. Instead, we
  offer the stand-alone function combineConflicts and use that in the
  implementation of resolveConflicts for RepoPatchV1/2.
  
  The change in the result type is just a cleanup: instead of adding the
  mangled resolutions as a first element and then taking the head (in
  standardResolution) we now replace the inner list with the mangled version.
  
  Passing the full context to resolveConflicts requires a number changes
  downstream. This is not strictly needed for V1/V2 which ignore the context,
  so we could pass undefined, but we need to make this change for V3 anyway.
  Instead of adding yet another parameter to all functions involved, we now
  pass a (Fork common us them) which cleans up type signatures (and
  incidentally some of the code, too).

patch 1a5c552ad9c8192fc3254f3e3dfcdd7c1ee525dd
Author: Ben Franksen <ben.franksen@online.de>
Date:   Wed Feb 13 20:14:19 CET 2019
  * implement resolveConflicts for RepoPatchV3
Attachments
msg20751 (view) Author: bfrk Date: 2019-06-12.12:10:48
Sorry for the very large bundle. It obsoletes all previous bundles I sent.
Applies cleanly to screened and I already pulled out all the minor refactors
that are independent of the v3 additions and refactors. It has v3 patch
format fully integrated and passes all tests, though I had to disable some
(e.g. for repair), see the long comments for details. Not yet contained is a
command to convert repos to the new format which is still work in progress.

54 patches for repository /home/ben/src/darcs/sent:

patch 201588ce705f87b17bcb800c113b91d75d3a450e
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 16:50:41 CET 2019
  * add some functions we need for V3 to Darcs.Patch.Ident

patch 2ab2d6ea7d3b4299dee37bc81e36fa35bc9c035d
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:45:13 CET 2019
  * add RepoPatchV3 aka camp conflictors

patch 41d9f81cb0bb0c89d3589440cd2959d0b5df7361
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:45:38 CET 2019
  * add V3 stuff to the test suite (quickcheck tests only)

patch 39e45329fa32f4a682ba1e557ee756a7a1d74327
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * renamed fromPrim to fromAnonymousPrim

patch 9e6f89e0479a740cf4b7ff28150f5f9d284cb400
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * add prim patch identifier when constructing Named patches
  
  This re-adds method fromPrim to class FromPrim, this time with additional
  parameters to construct the identifier. This is then used in function
  infopatch instead of fromAnonymousPrim.

patch d0bbd4aa6e41c41459f09e64239d74f2e64d5850
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * move Darcs.Patch.V3.Prim to Darcs.Patch.Prim.Named
  
  This is actually a fully generic wrapper for any PrimPatch type and
  technically not tied to V3.

patch 3a797b9fc225df6dbb031b29307f4e30c891fa6c
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * add new Darcs3 format option

patch f6b41d01a4487e2d5004f5175113d9dfd90ecc98
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * trivial refactor in D.R.Create

patch 0107cb750c63795b3cd1fb17f94478102ab7dc5d
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * allow runnign the test scripts with darcs-3 format

patch 47609c8e55be5be81dfed655514762c51140f343
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * adapt test skip based on repo format
  
  Now that we have three formats, we can no longer assume that skip-formats
  darcs-1 implies test is run only for darcs-2.

patch f7fc2f06d8e41aeeafb76ddf2457fbca1b3c04e2
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * restore alphabetical order of exposed-modules in darcs.cabal

patch 4e79a8698e04ff031c1f3697114777357ce26ac8
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb  9 14:43:32 CET 2019
  * fix in the QC generator for prim patch IDs

patch 2c68e35e4a324ece160ff5e50bdfdaa21c3491ec
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb  9 14:51:59 CET 2019
  * fix instance MightBeEmptyHunk for NamedPrim
  
  Property effectPreserving fails for Prim.V1 empty hunks, and so it does for
  its NamedPrim wrapper.

patch 1b723556f68d6ea9fcc71b9348c74a2c2163a4d5
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb  9 13:27:16 CET 2019
  * separate class Summary out from class Conflict
  
  This prepares a change in the type and meaning of resolveConflicts but makes
  sense independently. The method conflictedEffect is used only to generate a
  summary for potentially conflicted patches and thus has been moved to the
  new class Summary. The class Conflict gets a new method isConflicted which
  just returns whether a patch is conflicted or not.
  Incidentally this gets rid of a number of unneeded instances for Conflict
  with nonsense/dummy implementations for resolveConflicts (such as for Named,
  PatchInfoAnd, RebaseChange, and RebaseSelect).

patch 160164bb4f50312093ab83c721488caea21ffe8e
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb  9 17:10:00 CET 2019
  * add Darcs.Util.Graph
  
  This contains an efficient algorithm to determine maximal independent sets
  of an undirected graph.

patch d61e91e261ee659ff98225948038258dc7df0a34
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 10 13:43:32 CET 2019
  * fix a typo in a comment

patch fffd7cd29873f3c9f5529c79bb859ac86e51887a
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 10 19:28:06 CET 2019
  * fix cloning of darcs-3 format repos

patch 7cd237bf9a779540fe19c332e759e359a1b4cb0d
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 10 21:48:03 CET 2019
  * bugfix in instance ShowContextPatch for NamedPrim

patch dc879f6671f4dbff633ebeeb635a83e8d05337ac
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 10 23:09:51 CET 2019
  * hack: disable showContextSeries for darcs-3 format
  
  The code (in Darcs.Patch.Viewing) that implements showContextSeries messily
  re-implements showing for FLs of primitive patches (hunks in particular),
  circumventing the ShowPatchBasic instance. This means that it cannot take
  prim patch IDs into account since these are added to prim patches as a
  wrapper. This would not be a big problem for display but it is one when we
  use showContextPatch to create a patch bundle because it means that hunks
  are stored without the prim patch ID and thus cannot be read.
  
  The temporary "fix" here is to disable showContextSeries by adding a new
  ListFormatV3, until the context showing code is cleaned up to pass the
  correct prim show function down into showContextSeries.

patch dcceaa03b5ae8ce0c7670e056a1f6ef9eec8aa16
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Feb 12 18:17:39 CET 2019
  * show the PrimPatchId only ForStorage, not ForDisplay
  
  The PrimPatchId is not useful to the user and clutters up the output when
  --verbose is in effect. It also allows more test scripts to pass without
  having to adapt them.

patch f6fa434b182eb283aec29cc5ea8a077cb2c70923
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Feb 12 18:21:32 CET 2019
  * fix expected output in look_for_moves test for darcs-3
  
  The place where we have to adapt the test is when we test teh output of
  'darcs log --machine-readable' which uses the ForStorage format option, so
  we have to expect the hash line before the content.

patch 1850f72913a5057fb12bbfeeff5b5e93ce278c37
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Feb 12 18:36:09 CET 2019
  * tests/pull.sh: expect the correct behavior for darcs-3, too

patch d22ee446187b4954744092a410530b23d2866aad
Author: Ben Franksen <ben.franksen@online.de>
Date:   Wed Feb 13 09:23:01 CET 2019
  * disable repair tests when format is darcs-3
  
  Repairing currently means that we add or drop prims from a sequence, and we
  cannot lift that to NamedPrims. Doing this right requires considerable
  refactors to the Repair interface(s), so this is postponed for now.

patch e46cc62d1d40c0f98d33b7d850efcc172d3b6be6
Author: Ben Franksen <ben.franksen@online.de>
Date:   Wed Feb 13 18:20:58 CET 2019
  * fix rebase unsuspend for v3 with a dirty hack
  
  See comment in the code for the why and how.

patch dcb2738aa6f37a04a803b5b92e7c000f22ecd32e
Author: Ben Franksen <ben.franksen@online.de>
Date:   Wed Feb 13 18:24:09 CET 2019
  * change the type of resolveConflicts
  
  It now gets two RLs of patches as input and produces a simple (not nested)
  list of resolutions. The change in the input type(s) has been done because
  otherwise a RepoPatchV3 cannot correctly implement resolveConflicts, which
  requires that we know the transitive set of conflicting patches for each
  conflict. But a V3 conflictor contains only the patches that directly
  conflict. The separation into two input RLs is so that we can still resolve
  only the conflicts inside a (trailing) segment of all patches in a repo,
  which is how we call it when merging patches.
  
  There are no longer instances of class Conflict for RLs and FLs. Instead, we
  offer the stand-alone function combineConflicts and use that in the
  implementation of resolveConflicts for RepoPatchV1/2.
  
  The change in the result type is just a cleanup: instead of adding the
  mangled resolutions as a first element and then taking the head (in
  standardResolution) we now replace the inner list with the mangled version.
  
  Passing the full context to resolveConflicts requires a number changes
  downstream. This is not strictly needed for V1/V2 which ignore the context,
  so we could pass undefined, but we need to make this change for V3 anyway.
  Instead of adding yet another parameter to all functions involved, we now
  pass a (Fork common us them) which cleans up type signatures (and
  incidentally some of the code, too).

patch 1a5c552ad9c8192fc3254f3e3dfcdd7c1ee525dd
Author: Ben Franksen <ben.franksen@online.de>
Date:   Wed Feb 13 20:14:19 CET 2019
  * implement resolveConflicts for RepoPatchV3

patch cb7f2f109d05d80e662b019e9fb581cbea757e78
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb 15 12:12:30 CET 2019
  * add a number of INLINE or INLINABLE pragmas

patch d06188e92994e0f9d27b6c4c0164c781ecdc099f
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb 15 16:58:17 CET 2019
  * fix prop_conflictsCommutePastConflictor
  
  The property was almost correct but not quite. Indeed, patches we conflict
  with may not individually commute past the conflictor because of
  dependencies between these patches. However we can always commute them to a
  contiguous segment right before the conflictor, and then commute them past
  the conflictor as a whole.

patch 3a78254c82d906c54ca487b5b383293804e67255
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb 15 17:12:23 CET 2019
  * add more detailed comments for some cases of findConflicts

patch e11285095b9b167b32e4ae1a160d41a69d378dcb
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb 16 12:37:44 CET 2019
  * optimize parsing of PrimPatchId
  
  Profiling showed that a lot of time was spent inside b16Dec when reading v3
  patches. We now read the SHA1 directly off the ByteString which is much
  faster than going via b16Dec and binary decoding. Also fail properly in the
  parse monad if the hash is malformed rather than calling error.

patch 0cae5acc67078b6cc2b6b0cbe5137a19522ec553
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 17 12:12:56 CET 2019
  * replace our own patch parser with attoparsec
  
  We already depend on attoparsec for convert import and its functionality and
  implementation is quite similar to our self-written parser monad. I have
  checked that this does not impact performance negatively.

patch 27448d5c3ee98412c4331329bbcf874c8e87812f
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 17 12:22:58 CET 2019
  * take advantage of attoparsec error message for patches and inventories
  
  This changes the return type of readPatch and parseInventory from Maybe to
  Either String. Attoparsec's error messages are weak but that's still better
  than none at all.

patch bbe57ddc7d2380c0d2b2f568f32b1e1c7ab6d659
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 17 17:20:19 CET 2019
  * replace parseStrictly with parse everywhere
  
  This is not a simple rename but changes the output type from Maybe to Either
  String throughout.

patch 2ef519691d75adbcef8638f7164f9184fb2911a8
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 17 17:27:57 CET 2019
  * clean up import and export lists in Darcs.Patch.Read

patch 3dc3501824692790cf4bcfa487416c76b77073c8
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 17 21:32:00 CET 2019
  * restore alphabetical order of modules in darcs.cabal

patch 540e1ba36f410a94eed62b2a6e4b8cd6273d117d
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 17 21:50:01 CET 2019
  * do white space en/decoding directly on the ByteStrings

patch f0c8eecb250f549298d5bcb541c46f1f0d18d6e6
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb 22 15:00:25 CET 2019
  * optimize ctxNoConflicts

patch 6251fd817e81f40523eae8d0556a8d657d736593
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb 22 15:01:40 CET 2019
  * break overlong lines in Darcs.Patch.Ident

patch b8386798be44a17c5e33cfaa130da7f94fc60941
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb 22 15:02:39 CET 2019
  * add a comment to commutePast

patch 964b37023032a7405527cbf429de569db669a192
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb 23 10:46:47 CET 2019
  * fold partialPermutivity into permutivity property

patch 0c5d7571d3f67fb78c470b6c068414dc0ecc1ada
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb 23 10:53:55 CET 2019
  * fold partialCommuteInverses into property commuteInverses

patch 17bac163e2dfccca41355f85870f0876b05c23db
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb 23 11:06:10 CET 2019
  * remove unused function namedEffect

patch 1ec49cd68573933323f79b9febd4148952a5eff2
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb 23 12:04:28 CET 2019
  * optimize ctxAdd* by using the better fold

patch 76f6c3e0a733811469d4ed362bf84b0b5d3ddad2
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 24 09:08:14 CET 2019
  * declare instances of IdEq2 for Named, NamedPrim, and PatchInfoAnd

patch 5cedd4caaf09fd5bc04c612780ffdb547f4863d2
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb 23 14:00:00 CET 2019
  * clean up the foldXX mess in D.P.W.Ordered
  
  We now export only the natural folds i.e. the versions that allow lazy
  consumption of the result i.e. the one where the list constructor is
  replaced with the argument function.

patch 7f00dd7af4caa3ef34dac5435cd403a5a8ac5601
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Feb 25 11:15:44 CET 2019
  * harness: remove qc_V2P1 and qc_V3P1
  
  The properties listed therein do not in any way depend on the prim patch
  being V1. So I generalized the signatures and moved the tests to qc_V2 and
  qc_V3, respectively.

patch 2b6d20c8ce467b70be0f195908f68a7701738485
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Feb 25 15:29:21 CET 2019
  * simplify type signatures in D.T.P.Properties.Generic

patch 6a5ff3ce98c15a9ba01a0cfdb104faba3da0aa01
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Feb 26 10:13:01 CET 2019
  * harness: minor code cleanups

patch 9df0906bf4e70d6a540b7097812c2ff3cb228195
Author: Ben Franksen <ben.franksen@online.de>
Date:   Thu Feb 28 00:01:37 CET 2019
  * remove the obsolete PatchInspect superclass of Conflict

patch 7017bd5b1f438bce6b195db9edc171f8d783e59a
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Mar  1 19:58:25 CET 2019
  * remove unused method isConflicted from class Conflict
  
  Besides, we already have it as (isNothing . toPrim).

patch 64477d2f4409fa2d7d1df2fea796b63ceeaf18f6
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Mar  2 23:34:14 CET 2019
  * new (better?) implementation  of patchSet2FL

patch 7ab9d4c2d08f03bc735ecd706fb923a04081cd03
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Mar  2 23:34:55 CET 2019
  * fix error message in function transferProblem

patch 09b0e70b01a5da9362b4c5714d87a93b7697be30
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Feb 25 10:15:04 CET 2019
  * move v3 repo properties to harness
  
  This is so we can use Darcs.Test.Util.TestResult and give better output when
  testing the property fails.

patch 778f90783c8a7ad396efc6a8c3fdd9fd3cbc40c7
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Feb 26 10:34:18 CET 2019
  * harness: more detailed fail output for some properties
Attachments
msg20752 (view) Author: bfrk Date: 2019-06-12.12:12:54
Sorry, accidentally sent one patch too many, this is the same as the
previous bundle but without that particular patch.

53 patches for repository /home/ben/src/darcs/sent:

patch 201588ce705f87b17bcb800c113b91d75d3a450e
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 16:50:41 CET 2019
  * add some functions we need for V3 to Darcs.Patch.Ident

patch 2ab2d6ea7d3b4299dee37bc81e36fa35bc9c035d
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:45:13 CET 2019
  * add RepoPatchV3 aka camp conflictors

patch 41d9f81cb0bb0c89d3589440cd2959d0b5df7361
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:45:38 CET 2019
  * add V3 stuff to the test suite (quickcheck tests only)

patch 39e45329fa32f4a682ba1e557ee756a7a1d74327
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * renamed fromPrim to fromAnonymousPrim

patch 9e6f89e0479a740cf4b7ff28150f5f9d284cb400
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * add prim patch identifier when constructing Named patches
  
  This re-adds method fromPrim to class FromPrim, this time with additional
  parameters to construct the identifier. This is then used in function
  infopatch instead of fromAnonymousPrim.

patch d0bbd4aa6e41c41459f09e64239d74f2e64d5850
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * move Darcs.Patch.V3.Prim to Darcs.Patch.Prim.Named
  
  This is actually a fully generic wrapper for any PrimPatch type and
  technically not tied to V3.

patch 3a797b9fc225df6dbb031b29307f4e30c891fa6c
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * add new Darcs3 format option

patch f6b41d01a4487e2d5004f5175113d9dfd90ecc98
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * trivial refactor in D.R.Create

patch 0107cb750c63795b3cd1fb17f94478102ab7dc5d
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * allow runnign the test scripts with darcs-3 format

patch 47609c8e55be5be81dfed655514762c51140f343
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * adapt test skip based on repo format
  
  Now that we have three formats, we can no longer assume that skip-formats
  darcs-1 implies test is run only for darcs-2.

patch f7fc2f06d8e41aeeafb76ddf2457fbca1b3c04e2
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * restore alphabetical order of exposed-modules in darcs.cabal

patch 4e79a8698e04ff031c1f3697114777357ce26ac8
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb  9 14:43:32 CET 2019
  * fix in the QC generator for prim patch IDs

patch 2c68e35e4a324ece160ff5e50bdfdaa21c3491ec
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb  9 14:51:59 CET 2019
  * fix instance MightBeEmptyHunk for NamedPrim
  
  Property effectPreserving fails for Prim.V1 empty hunks, and so it does for
  its NamedPrim wrapper.

patch 1b723556f68d6ea9fcc71b9348c74a2c2163a4d5
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb  9 13:27:16 CET 2019
  * separate class Summary out from class Conflict
  
  This prepares a change in the type and meaning of resolveConflicts but makes
  sense independently. The method conflictedEffect is used only to generate a
  summary for potentially conflicted patches and thus has been moved to the
  new class Summary. The class Conflict gets a new method isConflicted which
  just returns whether a patch is conflicted or not.
  Incidentally this gets rid of a number of unneeded instances for Conflict
  with nonsense/dummy implementations for resolveConflicts (such as for Named,
  PatchInfoAnd, RebaseChange, and RebaseSelect).

patch 160164bb4f50312093ab83c721488caea21ffe8e
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb  9 17:10:00 CET 2019
  * add Darcs.Util.Graph
  
  This contains an efficient algorithm to determine maximal independent sets
  of an undirected graph.

patch d61e91e261ee659ff98225948038258dc7df0a34
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 10 13:43:32 CET 2019
  * fix a typo in a comment

patch fffd7cd29873f3c9f5529c79bb859ac86e51887a
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 10 19:28:06 CET 2019
  * fix cloning of darcs-3 format repos

patch 7cd237bf9a779540fe19c332e759e359a1b4cb0d
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 10 21:48:03 CET 2019
  * bugfix in instance ShowContextPatch for NamedPrim

patch dc879f6671f4dbff633ebeeb635a83e8d05337ac
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 10 23:09:51 CET 2019
  * hack: disable showContextSeries for darcs-3 format
  
  The code (in Darcs.Patch.Viewing) that implements showContextSeries messily
  re-implements showing for FLs of primitive patches (hunks in particular),
  circumventing the ShowPatchBasic instance. This means that it cannot take
  prim patch IDs into account since these are added to prim patches as a
  wrapper. This would not be a big problem for display but it is one when we
  use showContextPatch to create a patch bundle because it means that hunks
  are stored without the prim patch ID and thus cannot be read.
  
  The temporary "fix" here is to disable showContextSeries by adding a new
  ListFormatV3, until the context showing code is cleaned up to pass the
  correct prim show function down into showContextSeries.

patch dcceaa03b5ae8ce0c7670e056a1f6ef9eec8aa16
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Feb 12 18:17:39 CET 2019
  * show the PrimPatchId only ForStorage, not ForDisplay
  
  The PrimPatchId is not useful to the user and clutters up the output when
  --verbose is in effect. It also allows more test scripts to pass without
  having to adapt them.

patch f6fa434b182eb283aec29cc5ea8a077cb2c70923
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Feb 12 18:21:32 CET 2019
  * fix expected output in look_for_moves test for darcs-3
  
  The place where we have to adapt the test is when we test teh output of
  'darcs log --machine-readable' which uses the ForStorage format option, so
  we have to expect the hash line before the content.

patch 1850f72913a5057fb12bbfeeff5b5e93ce278c37
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Feb 12 18:36:09 CET 2019
  * tests/pull.sh: expect the correct behavior for darcs-3, too

patch d22ee446187b4954744092a410530b23d2866aad
Author: Ben Franksen <ben.franksen@online.de>
Date:   Wed Feb 13 09:23:01 CET 2019
  * disable repair tests when format is darcs-3
  
  Repairing currently means that we add or drop prims from a sequence, and we
  cannot lift that to NamedPrims. Doing this right requires considerable
  refactors to the Repair interface(s), so this is postponed for now.

patch e46cc62d1d40c0f98d33b7d850efcc172d3b6be6
Author: Ben Franksen <ben.franksen@online.de>
Date:   Wed Feb 13 18:20:58 CET 2019
  * fix rebase unsuspend for v3 with a dirty hack
  
  See comment in the code for the why and how.

patch dcb2738aa6f37a04a803b5b92e7c000f22ecd32e
Author: Ben Franksen <ben.franksen@online.de>
Date:   Wed Feb 13 18:24:09 CET 2019
  * change the type of resolveConflicts
  
  It now gets two RLs of patches as input and produces a simple (not nested)
  list of resolutions. The change in the input type(s) has been done because
  otherwise a RepoPatchV3 cannot correctly implement resolveConflicts, which
  requires that we know the transitive set of conflicting patches for each
  conflict. But a V3 conflictor contains only the patches that directly
  conflict. The separation into two input RLs is so that we can still resolve
  only the conflicts inside a (trailing) segment of all patches in a repo,
  which is how we call it when merging patches.
  
  There are no longer instances of class Conflict for RLs and FLs. Instead, we
  offer the stand-alone function combineConflicts and use that in the
  implementation of resolveConflicts for RepoPatchV1/2.
  
  The change in the result type is just a cleanup: instead of adding the
  mangled resolutions as a first element and then taking the head (in
  standardResolution) we now replace the inner list with the mangled version.
  
  Passing the full context to resolveConflicts requires a number changes
  downstream. This is not strictly needed for V1/V2 which ignore the context,
  so we could pass undefined, but we need to make this change for V3 anyway.
  Instead of adding yet another parameter to all functions involved, we now
  pass a (Fork common us them) which cleans up type signatures (and
  incidentally some of the code, too).

patch 1a5c552ad9c8192fc3254f3e3dfcdd7c1ee525dd
Author: Ben Franksen <ben.franksen@online.de>
Date:   Wed Feb 13 20:14:19 CET 2019
  * implement resolveConflicts for RepoPatchV3

patch cb7f2f109d05d80e662b019e9fb581cbea757e78
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb 15 12:12:30 CET 2019
  * add a number of INLINE or INLINABLE pragmas

patch d06188e92994e0f9d27b6c4c0164c781ecdc099f
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb 15 16:58:17 CET 2019
  * fix prop_conflictsCommutePastConflictor
  
  The property was almost correct but not quite. Indeed, patches we conflict
  with may not individually commute past the conflictor because of
  dependencies between these patches. However we can always commute them to a
  contiguous segment right before the conflictor, and then commute them past
  the conflictor as a whole.

patch 3a78254c82d906c54ca487b5b383293804e67255
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb 15 17:12:23 CET 2019
  * add more detailed comments for some cases of findConflicts

patch e11285095b9b167b32e4ae1a160d41a69d378dcb
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb 16 12:37:44 CET 2019
  * optimize parsing of PrimPatchId
  
  Profiling showed that a lot of time was spent inside b16Dec when reading v3
  patches. We now read the SHA1 directly off the ByteString which is much
  faster than going via b16Dec and binary decoding. Also fail properly in the
  parse monad if the hash is malformed rather than calling error.

patch 0cae5acc67078b6cc2b6b0cbe5137a19522ec553
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 17 12:12:56 CET 2019
  * replace our own patch parser with attoparsec
  
  We already depend on attoparsec for convert import and its functionality and
  implementation is quite similar to our self-written parser monad. I have
  checked that this does not impact performance negatively.

patch 27448d5c3ee98412c4331329bbcf874c8e87812f
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 17 12:22:58 CET 2019
  * take advantage of attoparsec error message for patches and inventories
  
  This changes the return type of readPatch and parseInventory from Maybe to
  Either String. Attoparsec's error messages are weak but that's still better
  than none at all.

patch bbe57ddc7d2380c0d2b2f568f32b1e1c7ab6d659
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 17 17:20:19 CET 2019
  * replace parseStrictly with parse everywhere
  
  This is not a simple rename but changes the output type from Maybe to Either
  String throughout.

patch 2ef519691d75adbcef8638f7164f9184fb2911a8
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 17 17:27:57 CET 2019
  * clean up import and export lists in Darcs.Patch.Read

patch 3dc3501824692790cf4bcfa487416c76b77073c8
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 17 21:32:00 CET 2019
  * restore alphabetical order of modules in darcs.cabal

patch 540e1ba36f410a94eed62b2a6e4b8cd6273d117d
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 17 21:50:01 CET 2019
  * do white space en/decoding directly on the ByteStrings

patch f0c8eecb250f549298d5bcb541c46f1f0d18d6e6
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb 22 15:00:25 CET 2019
  * optimize ctxNoConflicts

patch 6251fd817e81f40523eae8d0556a8d657d736593
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb 22 15:01:40 CET 2019
  * break overlong lines in Darcs.Patch.Ident

patch b8386798be44a17c5e33cfaa130da7f94fc60941
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb 22 15:02:39 CET 2019
  * add a comment to commutePast

patch 964b37023032a7405527cbf429de569db669a192
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb 23 10:46:47 CET 2019
  * fold partialPermutivity into permutivity property

patch 0c5d7571d3f67fb78c470b6c068414dc0ecc1ada
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb 23 10:53:55 CET 2019
  * fold partialCommuteInverses into property commuteInverses

patch 17bac163e2dfccca41355f85870f0876b05c23db
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb 23 11:06:10 CET 2019
  * remove unused function namedEffect

patch 1ec49cd68573933323f79b9febd4148952a5eff2
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb 23 12:04:28 CET 2019
  * optimize ctxAdd* by using the better fold

patch 76f6c3e0a733811469d4ed362bf84b0b5d3ddad2
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 24 09:08:14 CET 2019
  * declare instances of IdEq2 for Named, NamedPrim, and PatchInfoAnd

patch 5cedd4caaf09fd5bc04c612780ffdb547f4863d2
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb 23 14:00:00 CET 2019
  * clean up the foldXX mess in D.P.W.Ordered
  
  We now export only the natural folds i.e. the versions that allow lazy
  consumption of the result i.e. the one where the list constructor is
  replaced with the argument function.

patch 7f00dd7af4caa3ef34dac5435cd403a5a8ac5601
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Feb 25 11:15:44 CET 2019
  * harness: remove qc_V2P1 and qc_V3P1
  
  The properties listed therein do not in any way depend on the prim patch
  being V1. So I generalized the signatures and moved the tests to qc_V2 and
  qc_V3, respectively.

patch 2b6d20c8ce467b70be0f195908f68a7701738485
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Feb 25 15:29:21 CET 2019
  * simplify type signatures in D.T.P.Properties.Generic

patch 6a5ff3ce98c15a9ba01a0cfdb104faba3da0aa01
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Feb 26 10:13:01 CET 2019
  * harness: minor code cleanups

patch 9df0906bf4e70d6a540b7097812c2ff3cb228195
Author: Ben Franksen <ben.franksen@online.de>
Date:   Thu Feb 28 00:01:37 CET 2019
  * remove the obsolete PatchInspect superclass of Conflict

patch 7017bd5b1f438bce6b195db9edc171f8d783e59a
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Mar  1 19:58:25 CET 2019
  * remove unused method isConflicted from class Conflict
  
  Besides, we already have it as (isNothing . toPrim).

patch 7ab9d4c2d08f03bc735ecd706fb923a04081cd03
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Mar  2 23:34:55 CET 2019
  * fix error message in function transferProblem

patch 09b0e70b01a5da9362b4c5714d87a93b7697be30
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Feb 25 10:15:04 CET 2019
  * move v3 repo properties to harness
  
  This is so we can use Darcs.Test.Util.TestResult and give better output when
  testing the property fails.

patch 778f90783c8a7ad396efc6a8c3fdd9fd3cbc40c7
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Feb 26 10:34:18 CET 2019
  * harness: more detailed fail output for some properties
Attachments
msg20753 (view) Author: bfrk Date: 2019-06-12.12:31:52
I would like to screen this bundle in the course of the next few 
weeks in order to avoid conflicts with other WIP. I realize that 
this is probably too much code to properly review but that can 
hardly be avoided. So I'd say take a look at the patch descriptions 
and perhaps take a peek here or there and see if you spot anything 
that seems amiss or confusing. I will of course answer any questions 
that you may have.
msg20761 (view) Author: bfrk Date: 2019-06-12.17:46:09
Same as previous bundle but with one patch amended:

patch d04e12c10444dea24960406be14129da05c73e22
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 17 21:50:01 CET 2019
  * do white space en/decoding directly on the ByteStrings

It no longer compiled after I threw out the isSpace from
Darcs.Util.ByteString and also included an unintended behavior change: the
whitespace encoding for filenames has always used the isSpace from Data.Char
and this should not be changed.

53 patches for repository /home/ben/src/darcs/sent:

patch 201588ce705f87b17bcb800c113b91d75d3a450e
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 16:50:41 CET 2019
  * add some functions we need for V3 to Darcs.Patch.Ident

patch 2ab2d6ea7d3b4299dee37bc81e36fa35bc9c035d
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:45:13 CET 2019
  * add RepoPatchV3 aka camp conflictors

patch 41d9f81cb0bb0c89d3589440cd2959d0b5df7361
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:45:38 CET 2019
  * add V3 stuff to the test suite (quickcheck tests only)

patch 39e45329fa32f4a682ba1e557ee756a7a1d74327
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * renamed fromPrim to fromAnonymousPrim

patch 9e6f89e0479a740cf4b7ff28150f5f9d284cb400
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * add prim patch identifier when constructing Named patches
  
  This re-adds method fromPrim to class FromPrim, this time with additional
  parameters to construct the identifier. This is then used in function
  infopatch instead of fromAnonymousPrim.

patch d0bbd4aa6e41c41459f09e64239d74f2e64d5850
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * move Darcs.Patch.V3.Prim to Darcs.Patch.Prim.Named
  
  This is actually a fully generic wrapper for any PrimPatch type and
  technically not tied to V3.

patch 3a797b9fc225df6dbb031b29307f4e30c891fa6c
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * add new Darcs3 format option

patch f6b41d01a4487e2d5004f5175113d9dfd90ecc98
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * trivial refactor in D.R.Create

patch 0107cb750c63795b3cd1fb17f94478102ab7dc5d
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * allow runnign the test scripts with darcs-3 format

patch 47609c8e55be5be81dfed655514762c51140f343
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * adapt test skip based on repo format
  
  Now that we have three formats, we can no longer assume that skip-formats
  darcs-1 implies test is run only for darcs-2.

patch f7fc2f06d8e41aeeafb76ddf2457fbca1b3c04e2
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb  8 17:46:49 CET 2019
  * restore alphabetical order of exposed-modules in darcs.cabal

patch 4e79a8698e04ff031c1f3697114777357ce26ac8
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb  9 14:43:32 CET 2019
  * fix in the QC generator for prim patch IDs

patch 2c68e35e4a324ece160ff5e50bdfdaa21c3491ec
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb  9 14:51:59 CET 2019
  * fix instance MightBeEmptyHunk for NamedPrim
  
  Property effectPreserving fails for Prim.V1 empty hunks, and so it does for
  its NamedPrim wrapper.

patch 1b723556f68d6ea9fcc71b9348c74a2c2163a4d5
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb  9 13:27:16 CET 2019
  * separate class Summary out from class Conflict
  
  This prepares a change in the type and meaning of resolveConflicts but makes
  sense independently. The method conflictedEffect is used only to generate a
  summary for potentially conflicted patches and thus has been moved to the
  new class Summary. The class Conflict gets a new method isConflicted which
  just returns whether a patch is conflicted or not.
  Incidentally this gets rid of a number of unneeded instances for Conflict
  with nonsense/dummy implementations for resolveConflicts (such as for Named,
  PatchInfoAnd, RebaseChange, and RebaseSelect).

patch 160164bb4f50312093ab83c721488caea21ffe8e
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb  9 17:10:00 CET 2019
  * add Darcs.Util.Graph
  
  This contains an efficient algorithm to determine maximal independent sets
  of an undirected graph.

patch d61e91e261ee659ff98225948038258dc7df0a34
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 10 13:43:32 CET 2019
  * fix a typo in a comment

patch fffd7cd29873f3c9f5529c79bb859ac86e51887a
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 10 19:28:06 CET 2019
  * fix cloning of darcs-3 format repos

patch 7cd237bf9a779540fe19c332e759e359a1b4cb0d
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 10 21:48:03 CET 2019
  * bugfix in instance ShowContextPatch for NamedPrim

patch dc879f6671f4dbff633ebeeb635a83e8d05337ac
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 10 23:09:51 CET 2019
  * hack: disable showContextSeries for darcs-3 format
  
  The code (in Darcs.Patch.Viewing) that implements showContextSeries messily
  re-implements showing for FLs of primitive patches (hunks in particular),
  circumventing the ShowPatchBasic instance. This means that it cannot take
  prim patch IDs into account since these are added to prim patches as a
  wrapper. This would not be a big problem for display but it is one when we
  use showContextPatch to create a patch bundle because it means that hunks
  are stored without the prim patch ID and thus cannot be read.
  
  The temporary "fix" here is to disable showContextSeries by adding a new
  ListFormatV3, until the context showing code is cleaned up to pass the
  correct prim show function down into showContextSeries.

patch dcceaa03b5ae8ce0c7670e056a1f6ef9eec8aa16
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Feb 12 18:17:39 CET 2019
  * show the PrimPatchId only ForStorage, not ForDisplay
  
  The PrimPatchId is not useful to the user and clutters up the output when
  --verbose is in effect. It also allows more test scripts to pass without
  having to adapt them.

patch f6fa434b182eb283aec29cc5ea8a077cb2c70923
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Feb 12 18:21:32 CET 2019
  * fix expected output in look_for_moves test for darcs-3
  
  The place where we have to adapt the test is when we test teh output of
  'darcs log --machine-readable' which uses the ForStorage format option, so
  we have to expect the hash line before the content.

patch 1850f72913a5057fb12bbfeeff5b5e93ce278c37
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Feb 12 18:36:09 CET 2019
  * tests/pull.sh: expect the correct behavior for darcs-3, too

patch d22ee446187b4954744092a410530b23d2866aad
Author: Ben Franksen <ben.franksen@online.de>
Date:   Wed Feb 13 09:23:01 CET 2019
  * disable repair tests when format is darcs-3
  
  Repairing currently means that we add or drop prims from a sequence, and we
  cannot lift that to NamedPrims. Doing this right requires considerable
  refactors to the Repair interface(s), so this is postponed for now.

patch e46cc62d1d40c0f98d33b7d850efcc172d3b6be6
Author: Ben Franksen <ben.franksen@online.de>
Date:   Wed Feb 13 18:20:58 CET 2019
  * fix rebase unsuspend for v3 with a dirty hack
  
  See comment in the code for the why and how.

patch dcb2738aa6f37a04a803b5b92e7c000f22ecd32e
Author: Ben Franksen <ben.franksen@online.de>
Date:   Wed Feb 13 18:24:09 CET 2019
  * change the type of resolveConflicts
  
  It now gets two RLs of patches as input and produces a simple (not nested)
  list of resolutions. The change in the input type(s) has been done because
  otherwise a RepoPatchV3 cannot correctly implement resolveConflicts, which
  requires that we know the transitive set of conflicting patches for each
  conflict. But a V3 conflictor contains only the patches that directly
  conflict. The separation into two input RLs is so that we can still resolve
  only the conflicts inside a (trailing) segment of all patches in a repo,
  which is how we call it when merging patches.
  
  There are no longer instances of class Conflict for RLs and FLs. Instead, we
  offer the stand-alone function combineConflicts and use that in the
  implementation of resolveConflicts for RepoPatchV1/2.
  
  The change in the result type is just a cleanup: instead of adding the
  mangled resolutions as a first element and then taking the head (in
  standardResolution) we now replace the inner list with the mangled version.
  
  Passing the full context to resolveConflicts requires a number changes
  downstream. This is not strictly needed for V1/V2 which ignore the context,
  so we could pass undefined, but we need to make this change for V3 anyway.
  Instead of adding yet another parameter to all functions involved, we now
  pass a (Fork common us them) which cleans up type signatures (and
  incidentally some of the code, too).

patch 1a5c552ad9c8192fc3254f3e3dfcdd7c1ee525dd
Author: Ben Franksen <ben.franksen@online.de>
Date:   Wed Feb 13 20:14:19 CET 2019
  * implement resolveConflicts for RepoPatchV3

patch cb7f2f109d05d80e662b019e9fb581cbea757e78
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb 15 12:12:30 CET 2019
  * add a number of INLINE or INLINABLE pragmas

patch d06188e92994e0f9d27b6c4c0164c781ecdc099f
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb 15 16:58:17 CET 2019
  * fix prop_conflictsCommutePastConflictor
  
  The property was almost correct but not quite. Indeed, patches we conflict
  with may not individually commute past the conflictor because of
  dependencies between these patches. However we can always commute them to a
  contiguous segment right before the conflictor, and then commute them past
  the conflictor as a whole.

patch 3a78254c82d906c54ca487b5b383293804e67255
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb 15 17:12:23 CET 2019
  * add more detailed comments for some cases of findConflicts

patch e11285095b9b167b32e4ae1a160d41a69d378dcb
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb 16 12:37:44 CET 2019
  * optimize parsing of PrimPatchId
  
  Profiling showed that a lot of time was spent inside b16Dec when reading v3
  patches. We now read the SHA1 directly off the ByteString which is much
  faster than going via b16Dec and binary decoding. Also fail properly in the
  parse monad if the hash is malformed rather than calling error.

patch 0cae5acc67078b6cc2b6b0cbe5137a19522ec553
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 17 12:12:56 CET 2019
  * replace our own patch parser with attoparsec
  
  We already depend on attoparsec for convert import and its functionality and
  implementation is quite similar to our self-written parser monad. I have
  checked that this does not impact performance negatively.

patch 27448d5c3ee98412c4331329bbcf874c8e87812f
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 17 12:22:58 CET 2019
  * take advantage of attoparsec error message for patches and inventories
  
  This changes the return type of readPatch and parseInventory from Maybe to
  Either String. Attoparsec's error messages are weak but that's still better
  than none at all.

patch bbe57ddc7d2380c0d2b2f568f32b1e1c7ab6d659
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 17 17:20:19 CET 2019
  * replace parseStrictly with parse everywhere
  
  This is not a simple rename but changes the output type from Maybe to Either
  String throughout.

patch 2ef519691d75adbcef8638f7164f9184fb2911a8
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 17 17:27:57 CET 2019
  * clean up import and export lists in Darcs.Patch.Read

patch 3dc3501824692790cf4bcfa487416c76b77073c8
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 17 21:32:00 CET 2019
  * restore alphabetical order of modules in darcs.cabal

patch f0c8eecb250f549298d5bcb541c46f1f0d18d6e6
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb 22 15:00:25 CET 2019
  * optimize ctxNoConflicts

patch 6251fd817e81f40523eae8d0556a8d657d736593
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb 22 15:01:40 CET 2019
  * break overlong lines in Darcs.Patch.Ident

patch b8386798be44a17c5e33cfaa130da7f94fc60941
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Feb 22 15:02:39 CET 2019
  * add a comment to commutePast

patch 964b37023032a7405527cbf429de569db669a192
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb 23 10:46:47 CET 2019
  * fold partialPermutivity into permutivity property

patch 0c5d7571d3f67fb78c470b6c068414dc0ecc1ada
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb 23 10:53:55 CET 2019
  * fold partialCommuteInverses into property commuteInverses

patch 17bac163e2dfccca41355f85870f0876b05c23db
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb 23 11:06:10 CET 2019
  * remove unused function namedEffect

patch 1ec49cd68573933323f79b9febd4148952a5eff2
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb 23 12:04:28 CET 2019
  * optimize ctxAdd* by using the better fold

patch 76f6c3e0a733811469d4ed362bf84b0b5d3ddad2
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 24 09:08:14 CET 2019
  * declare instances of IdEq2 for Named, NamedPrim, and PatchInfoAnd

patch 5cedd4caaf09fd5bc04c612780ffdb547f4863d2
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Feb 23 14:00:00 CET 2019
  * clean up the foldXX mess in D.P.W.Ordered
  
  We now export only the natural folds i.e. the versions that allow lazy
  consumption of the result i.e. the one where the list constructor is
  replaced with the argument function.

patch 7f00dd7af4caa3ef34dac5435cd403a5a8ac5601
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Feb 25 11:15:44 CET 2019
  * harness: remove qc_V2P1 and qc_V3P1
  
  The properties listed therein do not in any way depend on the prim patch
  being V1. So I generalized the signatures and moved the tests to qc_V2 and
  qc_V3, respectively.

patch 2b6d20c8ce467b70be0f195908f68a7701738485
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Feb 25 15:29:21 CET 2019
  * simplify type signatures in D.T.P.Properties.Generic

patch 6a5ff3ce98c15a9ba01a0cfdb104faba3da0aa01
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Feb 26 10:13:01 CET 2019
  * harness: minor code cleanups

patch 9df0906bf4e70d6a540b7097812c2ff3cb228195
Author: Ben Franksen <ben.franksen@online.de>
Date:   Thu Feb 28 00:01:37 CET 2019
  * remove the obsolete PatchInspect superclass of Conflict

patch 7017bd5b1f438bce6b195db9edc171f8d783e59a
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Mar  1 19:58:25 CET 2019
  * remove unused method isConflicted from class Conflict
  
  Besides, we already have it as (isNothing . toPrim).

patch 7ab9d4c2d08f03bc735ecd706fb923a04081cd03
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Mar  2 23:34:55 CET 2019
  * fix error message in function transferProblem

patch 09b0e70b01a5da9362b4c5714d87a93b7697be30
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Feb 25 10:15:04 CET 2019
  * move v3 repo properties to harness
  
  This is so we can use Darcs.Test.Util.TestResult and give better output when
  testing the property fails.

patch 778f90783c8a7ad396efc6a8c3fdd9fd3cbc40c7
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Feb 26 10:34:18 CET 2019
  * harness: more detailed fail output for some properties

patch d04e12c10444dea24960406be14129da05c73e22
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Feb 17 21:50:01 CET 2019
  * do white space en/decoding directly on the ByteStrings
Attachments
msg20766 (view) Author: ganesh Date: 2019-06-12.21:17:49
I also think we should aim to get this into screened as quickly as
possible.

I've had a quick re-read of the high-level description of what
you are doing (from January) and I'm happy with the general 
principle. Though with the perhaps significant caveat that I am
not yet absolutely convinced we should go ahead and make this be
our official v3 representation. But I am fairly convinced, and if
in the end we find some reason not to do that then we can rename 
everything, just as we did with what is now called FileUUID
some time back.

So I think the main remaining thing is that I should skim through
the changes to try to see if there is anything I would really want
to be amended rather than just fixed up later. I'll aim to do that
asap (hopefully at the latest on Friday when I'm at Zurihac) and
then I would suggest this goes into screened for full review.
msg20767 (view) Author: ganesh Date: 2019-06-13.05:30:55
I've had an initial look through. My only comment about screening 
now  is that it seems a bit of a shame to have to move properties 
out into the test harness to make use of things like TestResult, and
I wonder if it wouldn't be better to judiciously move some types the
other way.

The reason I bring it up now is that moving properties implies a
reasonable amount of churn we might want to avoid by rebasing.
But it's not a big deal, so please go ahead and screen now unless
you do want to do that.
msg20768 (view) Author: bfrk Date: 2019-06-13.09:34:41
> I've had a quick re-read of the high-level description of what
> you are doing (from January) and I'm happy with the general 
> principle. Though with the perhaps significant caveat that I am
> not yet absolutely convinced we should go ahead and make this be
> our official v3 representation. But I am fairly convinced, and if
> in the end we find some reason not to do that then we can rename 
> everything, just as we did with what is now called FileUUID
> some time back.

Note that I am not yet ready to claim V3 can replace V2 as the default
patch theory. My reservations stem from the fact that there is a serious
hole in our QC test generators that causes them to never create certain
scenarios that do appear in practice. The generators create a branching
tree of patches, simulating multiple branches of a repo forking off each
other, and then do arbitrary merges of these branches. However, they do
/not/ generate new patches on top of such merges (and merge again and so
on). This means that, for instance, we never systematically test the
situation of a patch being recorded in such a way that it /depends/ on a
conflictor. Until we plug that hole in the generators I do not fully
trust that V3 really fixes all the bugs in the V1 and V2 theories.

Now, assuming we get this fixed and tests don't reveal any serious flaw
in the RepoPatchV3 theory, there still remains the question of what to
do with the underlying Prim patches. For now I am using the only thing
we have that is working (well almost, there is the issue of empty hunks
breaking some patch laws) i.e. Prim.V1. I think that for the moment this
is fine: we need to focus on one problem at the time else nothing will
be accomplished. Besides, repo conversion is a lot easier if you can
rely on the underlying Prim patches being equivalent. In the long run,
however, we should strive for a new Prim theory based on the idea of
FileUUID, perhaps with even more interesting new features built into it,
such as UUIDs for chunks of content or even nested repositories (similar
to git submodules). Again, I guess switching to a new Prim theory
(including repo conversion) will be easier once we have a rock solid
implementation of Conflictors on top of it, so we can concentrate on one
problem at a time.
msg20769 (view) Author: bfrk Date: 2019-06-13.10:17:29
> I've had an initial look through. My only comment about screening 
> now  is that it seems a bit of a shame to have to move properties 
> out into the test harness to make use of things like TestResult, and
> I wonder if it wouldn't be better to judiciously move some types the
> other way.

This is a difficult problem. One the one hand we want properties to
serve as documentation which means it should be close to the definition,
on the other hand adding all the code that display what exactly went
wrong when a property fails tends to work against that, obscuring what
(for documentary purposes) should be a straight forward logical formula.

I think we cannot solve this tension without some sort of compiler
plugin that allows us to automatically print the values of (local)
variables in scope on failure.

> The reason I bring it up now is that moving properties implies a
> reasonable amount of churn we might want to avoid by rebasing.

Note that this was only about one special property of RepoPatchV3, a
condensed, fixed, and simplified version of Definition 11.6 from Ian's
paper ("repo-properties"). Moving it to the harness only brings it up to
par with almost all of the properties we test, which are defined
somewhere under Darcs.Test.Patch.Properties.

> But it's not a big deal, so please go ahead and screen now unless
> you do want to do that.

In a perfect world we would not screen this bundle until we have fixed
the test generators. However, this will require some deep refactorings
in the harness and these changes will surely conflict with the additions
to the test suite that are contained in the bundle. I guess that means
we must hope that the V3 implementation will stand up to a more complete
set of test cases. An indication that it will do so is that I did a lot
of experimentation with the existing conflict-fight test scripts (to
make sure they scale more reasonably with V3 than they do with V1 and
V2; which they do, in fact; and also to do a number of optimizations
based on profiling). These tests /do/ record patches after, and
depending on, conflictors (so they resolve that conflict). I never
oberved anything strange happening when running these tests, so there is
some reason to hope there aren't any fundamental flaws in the V3 theory.
msg20771 (view) Author: bfrk Date: 2019-06-13.11:37:23
Okay, I am going to screen it now. Note that the default format for 
new repos is still darcs-2, you'll have to pass --darcs-3 explicitly 
to get the new patch format. Similar with the test harness, you'll 
have to pass it -3 to run the scripts with darcs-3 as the default 
format.
msg20774 (view) Author: ganesh Date: 2019-06-13.12:17:51
> Note that I am not yet ready to claim V3 can replace V2 as the
> default patch theory.

OK. IMO we shouldn't release darcs with something labelled as V3
that isn't actually our official new patch format. So before that
point we should either decide we want it to be, or rename this.
msg20775 (view) Author: bfrk Date: 2019-06-13.17:40:11
Fine with me. Given that we can decide to postpone version 3.0 of 
darcs as long as we like I hope we can manage without the renaming...
msg20796 (view) Author: ganesh Date: 2019-06-14.13:22:26
>  * add some functions we need for V3 to Darcs.Patch.Ident

> +-- | Try to commute patches matching any of the 'PatchId's in the set to the head.
> +-- It is not required that all the 'PatchId's are found in the sequence.
> +commuteToPostfix :: (Commute p, Ident p)
> +                 => S.Set (PatchId p) -> RL p wX wY -> Maybe ((FL p :> RL p) wX wY)

Should this comment read 'to the tail'? I get a bit confused about how to talk
about ordering when RLs are involved.

findCommonFL is quite similar to findCommonAndUncommon apart from working with Ident
rather than Eq2, right? The proliferation of similar functions makes me nervous about
complexity. But probably something for a future cleanup.
msg20797 (view) Author: ganesh Date: 2019-06-14.13:31:50
I think it's going to be very hard for me to keep track of the 
review if all the patches stay in one bundle.

Now that this is in screened and so won't be amended further, Would 
it be reasonable to break it up into multiple bundles for the
issue tracker?
msg20798 (view) Author: ganesh Date: 2019-06-14.13:56:50
>  * add RepoPatchV3 aka camp conflictors
> -- | Signed patch identity.
> -- The 'SHA1' hash of the non-inverted meta data ('PatchInfo') 
plus
> -- an 'Int' for the sequence number within the named patch.
> -- The 'Int' gets inverted together with the patch.
> data PrimPatchId = PrimPatchId !Int !SHA1
>   deriving (Eq, Ord, Show)
> instance SignedId PrimPatchId where
>   positiveId (PrimPatchId i _) = i > 0
>   invertId (PrimPatchId i h) = PrimPatchId (- i) h

Is it illegal for the Int to be 0? If so this should be documented
and ideally tested. (I haven't read a lot of the rest of the 
relevant code yet, so this might already be tested.)
msg20801 (view) Author: bfrk Date: 2019-06-14.16:09:28
>> +-- | Try to commute patches matching any of the 'PatchId's in the set to the head.
>> +-- It is not required that all the 'PatchId's are found in the sequence.
> Should this comment read 'to the tail'? I get a bit confused about how to talk
> about ordering when RLs are involved.

Same here. At one point I decided to regard the "easily accessable" end
of the sequence as the "head" and be done with it. Otherwise I use words
like "left" or "right", or "earlier" and "later". I think this is a
useful convention.

> findCommonFL is quite similar to findCommonAndUncommon apart from working with Ident
> rather than Eq2, right? 

Correct. Though one works on PatchSets, the other on FLs. It would be
nice to be able to abstract the algorithm into a single function (or
two) but I couldn't see how to do that.

BTW, I believe findCommonAndUncommon is actually only used for named
patches, so the type could be strengthened to require Ident. But I did
not because that would mean lots of changes in type signatures downstream.

> The proliferation of similar functions makes me nervous about
> complexity. But probably something for a future cleanup.

Because of the different argument types this is not as easy as it may
appear.
msg20802 (view) Author: bfrk Date: 2019-06-14.16:15:34
> I think it's going to be very hard for me to keep track of the 
> review if all the patches stay in one bundle.
> Now that this is in screened and so won't be amended further, Would 
> it be reasonable to break it up into multiple bundles for the
> issue tracker?

I was going to ask you if I should do that before screening (but then
didn't). But of course doing it afterwards is possible as well. Give me
a bit of time, I'll see what I can do.
msg20803 (view) Author: bfrk Date: 2019-06-14.16:21:18
Am 14.06.19 um 15:56 schrieb Ganesh Sittampalam:
> 
> Ganesh Sittampalam <ganesh@earth.li> added the comment:
> 
>>  * add RepoPatchV3 aka camp conflictors
>> -- | Signed patch identity.
>> -- The 'SHA1' hash of the non-inverted meta data ('PatchInfo') 
> plus
>> -- an 'Int' for the sequence number within the named patch.
>> -- The 'Int' gets inverted together with the patch.
>> data PrimPatchId = PrimPatchId !Int !SHA1
>>   deriving (Eq, Ord, Show)
>> instance SignedId PrimPatchId where
>>   positiveId (PrimPatchId i _) = i > 0
>>   invertId (PrimPatchId i h) = PrimPatchId (- i) h
> 
> Is it illegal for the Int to be 0?

Yes.

> If so this should be documented
> and ideally tested. (I haven't read a lot of the rest of the 
> relevant code yet, so this might already be tested.)

Good point. No, i don't think this is tested nor documented. Will do.
msg20814 (view) Author: ganesh Date: 2019-06-15.07:47:56
> Same here. At one point I decided to regard the "easily
> accessable" end of the sequence as the "head" and be done
> with it. Otherwise I use words like "left" or "right", or 
> "earlier" and "later". I think this is a useful convention.

OK.

>> The proliferation of similar functions makes me nervous about
>> complexity. But probably something for a future cleanup.
> 
> Because of the different argument types this is not as easy
> as it may appear.

If I thought it was easy I'd have suggested it now :-)
msg20863 (view) Author: bfrk Date: 2019-06-20.16:40:33
I have split this bundle into smaller ones titled 'v3: ...' so in
principle this one could be obsoleted. Not doing it though, until the
others have been reviewed as it may be useful to refer here for my
high-level descriptions of the changes and for some initial review comments.
msg21007 (view) Author: bfrk Date: 2019-07-29.16:43:56
I guess this bundle should no longer be shown as review-in-progress.
msg21018 (view) Author: ganesh Date: 2019-07-29.20:52:15
I think it still contains this one patch that didn't make it to any
of the other bundles:

> patch 76f6c3e0a733811469d4ed362bf84b0b5d3ddad2
> Author: Ben Franksen <ben.franksen@online.de>
> Date:   Sun Feb 24 08:08:14 GMT Standard Time 2019
>  * declare instances of IdEq2 for Named, NamedPrim, and 
>    PatchInfoAnd

Anyway, that looks ok.
History
Date User Action Args
2018-09-15 10:35:55bfrkcreate
2018-11-12 21:00:22bfrksetmessages: + msg20456
2018-11-26 22:42:51ganeshsetstatus: needs-screening -> followup-in-progress
2019-01-23 21:38:53bfrksetmessages: + msg20627
2019-02-14 08:24:56bfrksetfiles: + patch-preview.txt, add-some-functions-we-need-for-v3-to-darcs_patch_ident.dpatch, unnamed
messages: + msg20654
2019-02-14 08:27:00bfrksetfiles: - add-class-ideq2-to-darcs_patch_ident.dpatch
2019-02-14 08:27:14bfrksetfiles: - patch-preview.txt
2019-02-14 08:27:19bfrksetfiles: - unnamed
2019-06-12 12:10:50bfrksetfiles: + patch-preview.txt, add-some-functions-we-need-for-v3-to-darcs_patch_ident.dpatch, unnamed
messages: + msg20751
2019-06-12 12:12:55bfrksetfiles: + patch-preview.txt, add-some-functions-we-need-for-v3-to-darcs_patch_ident.dpatch, unnamed
messages: + msg20752
2019-06-12 12:14:36bfrksettitle: add RepoPatchV3 aka camp conflictors (and 3 more) -> add RepoPatchV3 aka camp conflictors, now with almost complete integration
2019-06-12 12:15:15bfrksetfiles: - add-some-functions-we-need-for-v3-to-darcs_patch_ident.dpatch
2019-06-12 12:15:22bfrksetfiles: - add-some-functions-we-need-for-v3-to-darcs_patch_ident.dpatch
2019-06-12 12:15:29bfrksetfiles: - patch-preview.txt
2019-06-12 12:15:34bfrksetfiles: - patch-preview.txt
2019-06-12 12:15:39bfrksetfiles: - unnamed
2019-06-12 12:15:42bfrksetfiles: - unnamed
2019-06-12 12:31:52bfrksetmessages: + msg20753
2019-06-12 17:46:09bfrksetfiles: + patch-preview.txt, add-some-functions-we-need-for-v3-to-darcs_patch_ident.dpatch, unnamed
messages: + msg20761
2019-06-12 21:17:49ganeshsetmessages: + msg20766
2019-06-12 21:17:58ganeshsetstatus: followup-in-progress -> review-in-progress
2019-06-13 05:30:56ganeshsetassignedto: ganesh
messages: + msg20767
nosy: + ganesh
2019-06-13 09:34:42bfrksetmessages: + msg20768
2019-06-13 10:17:29bfrksetmessages: + msg20769
2019-06-13 11:37:23bfrksetmessages: + msg20771
2019-06-13 12:17:51ganeshsetmessages: + msg20774
2019-06-13 17:40:11bfrksetmessages: + msg20775
2019-06-14 13:22:26ganeshsetmessages: + msg20796
2019-06-14 13:31:50ganeshsetmessages: + msg20797
2019-06-14 13:56:50ganeshsetmessages: + msg20798
2019-06-14 16:09:28bfrksetmessages: + msg20801
2019-06-14 16:15:34bfrksetmessages: + msg20802
2019-06-14 16:21:18bfrksetmessages: + msg20803
2019-06-15 07:47:56ganeshsetmessages: + msg20814
2019-06-20 16:40:33bfrksetmessages: + msg20863
2019-07-29 16:43:56bfrksetstatus: review-in-progress -> obsoleted
messages: + msg21007
2019-07-29 20:52:16ganeshsetstatus: obsoleted -> accepted-pending-tests
messages: + msg21018
2019-08-06 09:45:19ganeshsetstatus: accepted-pending-tests -> accepted