[darcs-users] bug or inconsistency in darcs replace

Tommy Pettersson ptp at lysator.liu.se
Fri Mar 26 19:08:51 UTC 2004


It seems 'darcs replace' behaves strangely.  It can replace
unrecorded previous 'darcs replace':s, but not unrecorded
manual changes.

As I now gave it a thought I think I understand why.  So here
is how I first thought:

I wanted to rename a global variable and did

  darcs replace origin current foo.c

but was denied because a const string with help text
contained the word 'current'.  So I edited it to 'gazonk'
and tried again.  I was still denied and still for the same
reason -- foo.c already contained 'current', which I did not
think was true.  I then reverted and did

  darcs replace current gazonk foo.c
  darcs replace origin current foo.c

and this worked.  I experimented and found out that if I
recorded the first manual change, replace would also work.

To me this was inconsistent -- I did not have to record the
'replace gazonk'-patch, but I had to record the manual change.


But I now see that if a replace would apply to the working
copy, its effect would change as I continued to edit.
It could very well be invalidated if I typed the replace-to
token somewhere.

Ok, so maybe I'm slow in mind, or maybe the help text for
replace needs to hint the user a bit.

And in my case a 'darcs replace --force ...' would have
been useful.

Anyway, darcs is wonderful!!  It absolutely charms me!
(So, I wanted to say something nice too -- shoot me.)  :-)


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




More information about the darcs-users mailing list