[darcs-devel] [issue1400] Data loss bug when renaming and replacing a non standard token?

Ashley Moran bugs at darcs.net
Sun Mar 22 22:08:17 UTC 2009


New submission from Ashley Moran <ashley.moran at patchspace.co.uk>:

<Repeat of email to darcs-users>

Hi

One of my clients stumbled across a very specific set of operations  
that cause data loss.  Fortunately it was really minor (a few lines),  
but very suprising behaviour.  It happens when pulling a patch that  
renames a file AND replaces a token with the token chars '[%r/]'.   
Darcs says there is a conflict, but does not create a backup file with  
the existing data.

Is this is a bug, or are we abusing `darcs replace`?  (Or both?)

Replication steps below.

Thanks
Ashley

% mkdir repo1
% cd repo1
% darcs init

% cat >testfile <<END
Given %r/I have a file/ do
end
END
% darcs record -alm "Add testfile"

% cd ..
% darcs get repo1 repo2

% cat >>testfile <<END
Given %r/something else/ do
end
END

% cd ../repo1
% darcs mv testfile testdata
% darcs replace --force --token-chars '[%r/]' '%r/' '/' testdata
% darcs record -am "Rename testfile and replace a symbol"

% cd ../repo2

% cat testfile
Given %r/I have a file/ do
end
Given %r/something else/ do
end

% darcs pull -a
Pulling from "/Users/ashleymoran/Documents/Development/work/darcs/ 
repo1"...
We have conflicts in the following files:
./testdata
Finished pulling and applying.

% cat testdata
Given /I have a file/ do
end

% ls
_darcs		testdata

----------
messages: 7487
nosy: ashley.moran, darcs-users, dmitry.kurochkin, kowey, simon, thorkilnaur
status: unread
title: Data loss bug when renaming and replacing a non standard token?

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue1400>
__________________________________


More information about the darcs-devel mailing list