[darcs-users] bug or inconsistency in darcs replace

Tommy Pettersson ptp at lysator.liu.se
Sun Mar 28 12:37:47 UTC 2004


| [doc improvements in replace.
| David Roundy <droundy at abridgegame.org>**20040327121520] {
[snip]
| hunk ./Replace.lhs 131
| -                          putStr $ "Perhaps this file already contains '"
| -                                     ++new++"'?\n"
| +                          putStr $ "Perhaps the recorded version of this " ++

This should put the user on right track.       ^^^^^^^^^^^^^^^^^^^^^^^

| +                                   "file already contains '" ++new++"'?\n"
| }

I dare not say that the theory of (replace) patches is clear
to me, but after reading the documentation improvements it
is clear to me when replace can cause trouble.


David Roundy wrote:
> Having heard the limitations (at least with how I would actually implement
> it), do you still think a --force option would be nice? It wouldn't be very
> hard to implement... the main question is whether it would end up leading
> to confusion.

At present I can do:

  $ cat a
  foo
  bar
  $ darcs replace foo gaz a; cat a
  gaz
  bar
  $ [manually edit `bar' to `gaz']; cat a
  gaz
  gaz
  $darcs whatsnew
  {
  hunk ./a 2
  -bar
  +foo
  replace ./a [A-Za-z_0-9] foo gaz
  }
  $ [revert only the replace patch]; cat a
  foo
  foo

so this is already an "issue".  With enough understanding,
--force as you propose it would not be confusing, but the
best thing would of course be if replace was easy.

By the way, if I unrevert a reverted replace patch it turns
into ordinary hunks.  Is that a bug?


-- 
Tommy Pettersson <ptp at lysator.liu.se>




More information about the darcs-users mailing list