Hi,

we just run in a serious bug 

A developer did run a "monotone update" and it looked like one file
was reverted.

I did examine the case and found that in a diff

monotone diff -r a51514cae30024abfe2718c1dadeeafc53a45203 -r 
4d822e5e16f66f054a1cc18b1168d2f2f7b086c1

the file had one entry with "add_file" and "delete_file" what maybe
was caused by multiple propagates on seperate branches. That is not so
much a problem but is wrong anyway (and one file should not have
drop/remove in a single diff).

What I could reproduce ist, that when a file is dropped and that is
updated on a different working copy the delete is applied no matter if
that file is locally changed.

Even worse, if one developer drops the file, commits and adds the old
file again the other developer experiences a revert on his update.

Attached is a self contained shell-script that reproduces (tested only
with bash) the error.

So our developers have to commit before make an update!

Leif
#!/bin/sh

set -e

rm -f test.db*

monotone db init --db=test.db

cat > test.rc <<EOF

function get_passphrase(keypair_id)
  return "secret"
end


-- can not merge headless
function merge2(left, right)
  return nil
end

-- can not merge headless
function merge3(ancestor, left, right)
  return nil
end


EOF

expect -c '
spawn monotone --db=test.db --rcfile=test.rc genkey testuser

expect "]: "
send "secret\r"

expect "]: "
send "secret\r"

expect eof

'

rm -rf source
mkdir source
echo some_release > source/version.txt
echo one > source/one
echo two > source/two
echo "Importing $release"
monotone --db=./test.db --rcfile=./test.rc setup -b local.testbranch source
cd source
find -type f '!' -path '*/MT/*' -print0 | xargs -0 monotone add
monotone --rcfile=../test.rc commit -m "initial checkin"
cd ..

for dev in developer1 developer2 ; do
  rm -rf $dev
  monotone --db=./test.db --rcfile=./test.rc co -b local.testbranch $dev
done

cd developer1
monotone drop version.txt
rm version.txt
monotone rename two three
mv two three
echo three >> three
monotone --rcfile=../test.rc commit -m 'work of developer1:rename two to three'
cd ..

cd developer2
echo 'should stay one' >> one
monotone update
cat one
cd ..

cd developer1
mv one one_
monotone drop one
monotone --rcfile=../test.rc commit -m 'work of developer1:drop one'
if true ; then # if you don't add the file again the update will drop local 
changes! what is a bug as well
  mv one_ one
  monotone add one
  monotone --rcfile=../test.rc commit -m 'work of developer1:add one again'
fi
cd ..

cd developer2
echo ">one before update<"
cat one
echo "--END--"
monotone update
echo ">one after update<"
cat one
echo "--END--"
cd ..
_______________________________________________
Monotone-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/monotone-devel

Reply via email to