[darcs-devel] [darcs #384] `darcs replace` behaving strangely

Tommy Pettersson via RT bugs at darcs.net
Wed May 11 13:48:29 PDT 2005


Wed May 11 16:48:27 2005: New ticket: 384.
Transaction: Ticket created by tommy
       Queue: Darcs
     Subject: `darcs replace` behaving strangely
       Owner: Nobody
  Requestors: ptp at lysator.liu.se
      Status: new
 Ticket <URL: http://bugs.darcs.net/.//Ticket/Display.html?id=384 >

On Mon, May 09, 2005 at 03:45:10PM +0200, Albert Reiner wrote:
> Hi,
> 
> I just did the following with darcs 1.0.2:
> 
> - `darcs revert`, meaning there are no unrecorded changes after that.
> 
> - $ darcs replace --token='[^<>]' \
>     "enter equations for \uderaBax" \
>     "enter equations for \uderEaBax" ar-soft-scoza.nw
> 
> - $ darcs replace derivaBax derivEaBax ar-soft-scoza.nw
> 
> - $ darcs replace derivaBaxFun derivEaBaxFun ar-soft-scoza.nw
> 
> Now `darcs whatsnew` gives me the following:
> 
> ,----
> | {
> | hunk ./nw/ar-soft-scoza.nw 2468
> | -<<enter equations for \uderaBax>>=
> | +<<enter equations for \uderEaBax>>=
> | hunk ./nw/ar-soft-scoza.nw 2500
> | -<<enter equations for \uderaBax>>=
> | +<<enter equations for \uderEaBax>>=
> | hunk ./nw/ar-soft-scoza.nw 2609
> | -<<enter equations for \uderaBax>>=
> | +<<enter equations for \uderEaBax>>=
> | hunk ./nw/ar-soft-scoza.nw 2789
> | -<<enter equations for \uderaBax>>
> | +<<enter equations for \uderEaBax>>
> | replace ./nw/ar-soft-scoza.nw [A-Za-z_0-9] derivaBax derivEaBax
> | replace ./nw/ar-soft-scoza.nw [A-Za-z_0-9] derivaBaxFun derivEaBaxFun
> | }
> `----
> 
> Shouldn't this just show three replace hunks instead?

I think I have a clue to this one now, but I don't have time
to test it now.

The replace command is carried out correctly: the replace
is performed in working and a replace patch is created in
_darcs/patches/pending.

I think the bug is that darcs can't properly read back the
troublesome replace patch from pending, since darcs (this is
my guess) splits the tokens in the patch on spaces, and some
of the tokens contain spaces (unquoted).

This would explain why the the replaces in working are shown
(and get recorded) as hunks; darcs fails to add the correct
replaces to pending before it looks for changes.


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





More information about the darcs-devel mailing list