[darcs-devel] [patch1931] WIP: remove isInverted from PatchInfo

Ganesh Sittampalam bugs at darcs.net
Sun Sep 22 10:46:27 UTC 2019


Ganesh Sittampalam <ganesh at earth.li> added the comment:

>> Maybe we can continue to have the flag, perhaps renamed to
>> legacyInverted, so we can preserve hashes and any other global
>> invariants we need to, but not treat it as really inverting the
>> PatchInfo for internal purposes?
> 
> I don't think this would add much clarity. We would have to duplicate
> the flag in Darcs.Patch.Invertible. Better keep things as they are i.e.
> PatchInfo remains invertible, plus a few comments to warn people off
> trying to do something similar in the future.

I don't think this is just about code clarity, but also of semantics. At
the moment we see the isInverted flag as creating a relationship in
terms of things like SignedId.invertId. We don't use that anywhere for
PatchInfo but maybe we might in future. Also the error case in
Rebase.Name is wrong. So we either need to remove it or perhaps take the
pragmatic view that noone will ever actually suspend an old UNDO patch.
I think the original code I wrote (that did an inverse commute) was also
wrong.

Semantically, my feeling is that we should forget the relationship
between the UNDO patches that got written out and the original ones. I
don't think darcs would ever have done anything with that relationship
historically, and it would now be best to set that position in stone.
It's a different concept to the temporary inversion we do in memory now,
where we do want to preserve the relationship. So even though we would
indeed end up with a duplicated flag (and hence confusing possibilities
in memory like an InvertedId of an "inverted" PatchInfo), I think we
should accept that.

> I guess the point is moot now, but in general I would rather err on the
> side of compatibility here. If the XML output has any use at all then it
> is to be the one format that can be relied upon to remain stable.

I thought the main point was to save people having to parse our
human-readable output.

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


More information about the darcs-devel mailing list