# # add_file "tests/t_add_vs_commit.at" # # patch "ChangeLog" # from [43321516bfd479343fd87452bc81e554314104bb] # to [be3a9dca5d3b53b571b3720483e8a8bab9a1c691] # # patch "tests/t_add_vs_commit.at" # from [] # to [7fd4b57e97609427e699e0cf3cca5c984ffd1330] # # patch "testsuite.at" # from [fb517e7363f5d1995cf3b8cfe0239c035d17ebfd] # to [de91ab8f49725d23766ca45e078e522f5ce6f3a4] # --- ChangeLog +++ ChangeLog @@ -1,3 +1,11 @@ +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 * AUTHORS: Add Emile Snyder . --- 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 @@ -555,3 +555,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)