[darcs-devel] [issue2614] fromJust error when cloning an unclean tag

Ben Franksen bugs at darcs.net
Fri Jan 11 15:33:09 UTC 2019


Ben Franksen <ben.franksen at online.de> added the comment:

Yep, that worked (with Show2 and a few dummy instances). My results so far:

It looks as if the new partitionRL is not doing anything "wrong" here.
Rather, it does a few more commutations which in turn cause a second
(recursive) invocation to fail. This means permutivity is violated. The
bug appears only if duplicate patches are present, but it happens with
darcs-2 and darcs-1 format. This is not covered by our quickcheck tests
because for RepoPatchV2 we exclude Duplicate patches from the test and
for RepoPatchV1 we do not quickcheck test permutivity at all (because of
performance issues).

This is really depressing. It means that even with merge-by-value our
current patch theories are still inconsistent in the presence of
duplicate patches.

Here is my revised test script:

rm -rf R S T
darcs init R
cd R
echo R > R
darcs record -lam 'R1'
darcs tag R
cd ..

darcs init S
cd S
echo R > R
darcs record -lam 'R2'
darcs tag R
echo S > R
darcs record -lam 'S'
darcs tag S
cd ..

cd R
darcs pull ../S -a --allow-conflicts
cd ..

darcs clone R T --tag S

And here is what happens in the second call to partitionRL, called at
Darcs.Patch.Depends.splitOnTag, the line with

  partitionRL ((`notElem` (t : getdeps (hopefully hp))) . info) hps)

listing only the patch names:

  input:
    "R1"
    "TAG R"
    "S"
    "R2"
    "TAG R"
    "TAG S"
  output:
    "R1"
    "S"
    "R2"
    "TAG R"
    "TAG S"
    :>
    "TAG R"

whereas with the old version of partitionRL it is

  before:
    "R1"
    "TAG R"
    "R2"
    "TAG R"
    "S"
    "TAG S"
  after:
    "R2"
    "TAG R"
    "S"
    "TAG S"
    :>
    "R1"
    "TAG R"

Note the duplicate patches R1/R2. The problem is that patch S depends on
either R1 or R2 and if we first commute R2 and S, then we can no longer
commute R1 with S and thus cannot commute it past the "TAG S".

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue2614>
__________________________________


More information about the darcs-devel mailing list