[darcs-users] darcs patch: resolve issue864: check non-force replace against pending (and 2 more)

Tommy Pettersson ptp at lysator.liu.se
Sun Oct 5 13:44:47 UTC 2008

Here is a fix for issue864 -- sort of.

Issue 864 requests that a behavior from 1.0.9 is restored in
2.1.0. I believe the behavior in 1.0.9 is wrong, and is a
regression from an earlier version of darcs.

The behavior has however not been restored in 2.1.0. Instead a
bug has been introduced that makes the decision logic for when
to require the --force flag flawed and unreliable, and the
Issue864 test exposes this bug by showing that the --force flag
is required when doing the replace on a moved file, but not when
the file is not moved.

The first patch fixes this bug, and probably restores everything
to as it was in 1.0.9.

The second patch fixes what I believe is the real regression,
but changes the way darcs has worked for a long time without
complaints from anyone. Indeed, the only complaint (as issue 864
shows) was that darcs did NOT behave in this way.

The third patch rewrites the issue864 test, as it starts to fail
again when the "fix" in patch two is applied.

I am still a proponent of patch two. It is consistent with the
documentation of Replace in the manual. The rewritten issue864
test is more or less a translation of the description in the
manual of how Replace behaves, or at least used to behave. The
--force flag has an -f shorthand so it's easy to type.

I think the problem is that users don't know about the --force
flag, and that the warning message is unhelpful. A better
thought out warning with a suggestion to use --force or -f might
learn darcs users to appreciate the warning, because it actually
means something, and darcs users should want to know when and
why they want to do a forced replace.

Sun Oct  5 01:57:19 CEST 2008  Tommy Pettersson <ptp at lysator.liu.se>
  * resolve issue864: check non-force replace against pending
  The replace was checked against pure pristine, so the answer to if it could
  be applied to pending without force was sometimes wrong.

Sun Oct  5 02:03:16 CEST 2008  Tommy Pettersson <ptp at lysator.liu.se>
  * make replace safe (again)
  If the new token exists in either pending or working, the force flag must
  be used, because otherwise some unrecorded changes may be destroyed when
  those tokens are modified to allow the replace.

Sun Oct  5 02:52:23 CEST 2008  Tommy Pettersson <ptp at lysator.liu.se>
  * rewrite issue864 test to check for the real cause of the bug

Tommy Pettersson <ptp at lysator.liu.se>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: resolve-issue864_-check-non_force-replace-against-pending.dpatch
Type: text/x-darcs-patch
Size: 5974 bytes
Desc: not available
Url : http://lists.osuosl.org/pipermail/darcs-users/attachments/20081005/87d584da/attachment-0001.bin 

More information about the darcs-users mailing list