[darcs-users] "replace" patch type (was: bug or inconsistency in darcs replace)

Marnix Klooster mklooster at baan.nl
Sat Mar 27 20:01:51 UTC 2004


Kevin Smith wrote on the dangers of the "replace" patch type:

> But probably my biggest concern is that the change extends unbounded 
> through time and space. A "replace" that does exactly what I want in my 
> repo today might do something unexpected and unwanted in a different 
> repo, or at some point in the future.
> 
> You consider that a "feature", because it will automatically "fix" uses 
> of the old name in other code. I consider it a problem, because it is 
> too unpredictable and may break code in strange ways.
> 
> It is a powerful tool, but a dangerous one. I am concerned about handing 
> this loaded gun to everyone without proper warnings, training, and 
> safety mechanisms. RCS systems should (IMHO) do whatever they can to 
> keep your code safe and avoid surprising you.

While experimenting with 'modular patch types' (see my recent e-mail) I
realized that there are actually two different kinds of 'replace':
 - replace now: replace every current occurrence of X that are visible
                in the current context (i.e., the current set of
                patches in my repository).
 - replace always: replace every occurrence of X in any patch that will
                   ever be in the context of this patch.
(Invent better names please.)

What darcs now has is the 'replace always' version, which is both useful
and dangerous.  What Kevin wants is just a 'replace now' patch.  Which
is actually not really different from a hunk patch, so I don't think it
would really add something.  Or would it?

Groetjes,
 <><
Marnix
-- 
Marnix Klooster 
mklooster at baan.nl




More information about the darcs-users mailing list