# # add_file "tests/t_add_vs_commit.at" # # patch "ChangeLog" # from [1bc1907d08f0bfde7e606a3dde46b40da24b0fb2] # to [de1eecdc63f7ec17f696e556669df261779da114] # # patch "tests/t_add_vs_commit.at" # from [] # to [7fd4b57e97609427e699e0cf3cca5c984ffd1330] # # patch "testsuite.at" # from [d2d93700980437bc4d42f041d1d088c06b4e5200] # to [450a36914862e3cdf4485494b25be20b5c6184f3] # --- ChangeLog +++ ChangeLog @@ -1,5 +1,14 @@ 2005-04-16 Nathaniel Smith +2005-04-16 Emile Snyder + * tests/t_add_vs_commit.at: New test for failing case. If you + add a file in you working dir, someone else adds the same file + and commits, then you do an update it messes up your working + directory. + * testsuite.at: Add it. + +2005-04-16 Nathaniel Smith + * commands.cc (checkout): Move check for existence of revision earlier. --- tests/t_add_vs_commit.at +++ tests/t_add_vs_commit.at @@ -0,0 +1,47 @@ +AT_SETUP([add working copy commit in another]) +MONOTONE_SETUP + +# This test is a bug report +AT_XFAIL_IF(true) + +# 1. Alice writes a file, does an add, *doesn't* do a commit, and sends patch +# 2. Bob applies (modified) patch to tree, does the add, then a commit. +# 3. Now Alice does an update (resolves the merge conflict, choosing Bob's changes). +# +# Alice's working dir now give I()'s when she tries to do stuff (diff, update, etc.). + +AT_DATA(initial, [some initial data +]) + +AT_DATA(foo.alice, [foo +change me +bar +]) + +AT_DATA(foo.bob, [foo +me change +bar +]) + +# Alice does her add +AT_CHECK(mkdir alicewd) +AT_CHECK(cp initial alicewd/initial) +AT_CHECK(MONOTONE --branch=testbranch setup alicewd, [], [ignore], [ignore]) +AT_CHECK( (cd alicewd; MONOTONE --root=. add initial), [], [ignore], [ignore]) +AT_CHECK( (cd alicewd; MONOTONE --root=. commit -m 'initial commit'), [], [ignore], [ignore]) +AT_CHECK(cp foo.alice alicewd/foo) +AT_CHECK( (cd alicewd; MONOTONE add --root=. foo), [], [ignore], [ignore]) +# Note, alice does not commit this add... + +# Bob does add of same file, with edits, and commits +AT_CHECK(MONOTONE --branch=testbranch checkout bobwd, [], [ignore], [ignore]) +AT_CHECK(cp foo.bob bobwd/foo) +AT_CHECK( (cd bobwd; MONOTONE --root=. add foo), [], [ignore], [ignore]) +AT_CHECK( (cd bobwd; MONOTONE --root=. commit -m 'bob commit'), [], [ignore], [ignore]) +REV=`BASE_REVISION` + +# Alice does her update, then attempts, eg., a diff +AT_CHECK( (cd alicewd; MONOTONE --root=. update $REV), [], [ignore], [ignore]) +AT_CHECK( (cd alicewd; MONOTONE --root=. diff), [], [ignore], [ignore]) + +AT_CLEANUP --- testsuite.at +++ testsuite.at @@ -559,3 +559,4 @@ m4_include(tests/t_rcs_import.at) m4_include(tests/t_cvsimport2.at) m4_include(tests/t_lf_crlf.at) +m4_include(tests/t_add_vs_commit.at)