darcs

Issue 231 darcs replace with weird token-chars loses

Title darcs replace with weird token-chars loses
Priority bug Status resolved
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, kowey, ppessi, thorkilnaur, tommy
Assigned To
Topics

Created on 2006-08-05.17:23:51 by ppessi, last changed 2009-08-27.13:49:28 by admin.

Files
File name Uploaded Type Edit Remove
darcs-bug-replace ppessi, 2006-08-05.17:23:49 application/octet-stream
Messages
msg855 (view) Author: ppessi Date: 2006-08-05.17:23:49
It looks like there is some problems with darcs replace when
token-chars contains odd characters. darcs replace exits with 0 but
nothing is shown with whatis. The previous replace changes are lost,
too. The darcs versions tested are home-brewn darcs-1.0.7 and
statically linked 1.0.8 downloaded from the net.

A shell script demonstrating problem is attached.   Here is an example run:

$ ./darcs-bug-replace
+ darcs add foo.c foo.xml
+ darcs record --all -mAdded foo.c foo.xml
Recording changes in "foo.c" "foo.xml":

Finished recording patch 'Added'
+ darcs replace foo fuu foo.c
+ darcs w
{
replace ./foo.c [A-Za-z_0-9] foo fuu
}
+ darcs replace X XX foo.xml --token-chars '[a-zA-Z_0-9$]'
+ darcs w
{
replace ./foo.c [A-Za-z_0-9] foo fuu
replace ./foo.xml [a-zA-Z_0-9$] X XX
}
+ darcs replace ' X ' ' XX ' --token-chars '[ X]' foo.xml
+ darcs w
No changes!
Exit 1

The expected results would be that the third darcs either adds the
replace change or complains about weird token-chars then exits with
non-zero value. Previous replaces should not be lost.
Attachments
msg856 (view) Author: tommy Date: 2006-08-05.19:31:54
On Sat, Aug 05, 2006 at 05:23:52PM +0000, Pekka Pessi wrote:
> The expected results would be that the third darcs either adds the
> replace change or complains about weird token-chars then exits with
> non-zero value. Previous replaces should not be lost.

Replace does not work if one of the tokens contains a space. Hm,
I thought this bug was fixed long ago, but maybe it's not. Darcs
would create a wrongly formated patch in pending when tokens
contain spaces, but I think it only made the replace show up as
hunks instead. Well, I'm familiar with this piece of code and
can take a look at it tomorrow, unless anyone beats me to it.  :-)
msg1778 (view) Author: tommy Date: 2007-06-29.19:48:56
fixed in 1.0.9
History
Date User Action Args
2006-08-05 17:23:51ppessicreate
2006-08-05 19:31:59tommysetstatus: unread -> unknown
nosy: droundy, tommy, ppessi
messages: + msg856
2006-11-17 13:05:20tommysetstatus: unknown -> resolved-in-unstable
nosy: + kowey
2007-06-29 19:48:56tommysetstatus: resolved-in-unstable -> resolved
nosy: + beschmi
messages: + msg1778
2009-08-06 17:48:30adminsetnosy: + markstos, jast, Serware, dmitry.kurochkin, darcs-devel, zooko, dagit, mornfall, simon, thorkilnaur, - droundy, ppessi
2009-08-06 20:51:12adminsetnosy: - beschmi
2009-08-10 21:54:06adminsetnosy: + ppessi, - markstos, darcs-devel, zooko, jast, dagit, Serware, mornfall
2009-08-25 18:00:21adminsetnosy: + darcs-devel, - simon
2009-08-27 13:49:28adminsetnosy: tommy, kowey, darcs-devel, ppessi, thorkilnaur, dmitry.kurochkin