[darcs-devel] [issue440] mv => silently overwrites files in working directory

Eric Kow bugs at darcs.net
Wed Apr 18 12:47:56 PDT 2007


New submission from Eric Kow <eric.kow at gmail.com>:

Due to the behaviour of renameFile and renameDirectory, which silently
replace things that already exist.  We probably should *not* do this,
the basic principle being not to harm anything that doesn't belong to
us.

 mkdir x 
 cd x; darcs init
 touch a
 darcs add a 
 darcs record -am 'a'
 cd ..

 darcs get x x2
 cd x2
 echo 'hi' > b
 cd ..

 cd x
 darcs mv a b
 darcs record -am 'a -> b'
 cd ..

 cd x2
 darcs pull
 echo 'hi' > good-b
 diff good-b b
 cd ..

Note that not silently renaming the file/directory could also be bad
for darcs (because then maybe it can't apply future patches), but
better for darcs to give up than just overwrite the user's stuff.

Also, this might make more sense within the context of a repaired
issue434, don't want to give darcs any more excuses to just up and
die in the middle of a pull.

----------
messages: 1638
nosy: EricKow, beschmi, droundy, tommy
status: unread
title: mv => silently overwrites files in working directory

____________________________________
Darcs issue tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue440>
____________________________________


More information about the darcs-devel mailing list