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

Ashley Moran ashley.moran at patchspace.co.uk
Sun Mar 22 17:00:14 UTC 2009


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



-- 
http://www.patchspace.co.uk/
http://www.linkedin.com/in/ashleymoran
http://aviewfromafar.net/
http://twitter.com/ashleymoran








More information about the darcs-users mailing list