# # add_file "tests/t_add_vs_commit.at" # # patch "ChangeLog" # from [cca8fa572e36410501c7b8be9e59811146b45165] # to [13540d1b349bcded256bce2952358c4cac0b9d86] # # patch "commands.cc" # from [958cd3bbc982aef81f63b90b24dcebaddf135166] # to [802ab5385a30de04950cf7dbf99f0b445a248a84] # # patch "tests/t_add_vs_commit.at" # from [] # to [7fd4b57e97609427e699e0cf3cca5c984ffd1330] # # patch "tests/t_netsync_defaults.at" # from [8f37b7de81c532b83851011586762f8c7fd91083] # to [09eba929e451e94f6075bd99fe75fc0469ba84e1] # # patch "tests/t_netsync_single.at" # from [1fa271a852629b392339705a3b6d5e143b7948c3] # to [faa5253849ae86d140b67fb93609d191456b0ec3] # # patch "testsuite.at" # from [d2d93700980437bc4d42f041d1d088c06b4e5200] # to [450a36914862e3cdf4485494b25be20b5c6184f3] # --- ChangeLog +++ ChangeLog @@ -1,5 +1,25 @@ 2005-04-16 Nathaniel Smith + * ChangeLog: Fixup after merge. + +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_netsync_defaults.at, tests/t_netsync_single.at: + Don't hard-code netsync port. + +2005-04-16 Nathaniel Smith + * testsuite.at: Use a random server port. * .mt-attrs, contrib/README: Update for Notify.pl -> --- commands.cc +++ commands.cc @@ -1793,6 +1793,9 @@ dir = idx(args, 1)(); complete(app, idx(args, 0)(), ident); + N(app.db.revision_exists(ident), + F("no revision %s found in database") % ident); + { cert_value b; guess_branch(ident, app, b); @@ -1824,9 +1827,6 @@ manifest_id mid; manifest_map m; - N(app.db.revision_exists(ident), - F("no revision %s found in database") % ident); - app.db.get_revision_manifest(ident, mid); put_revision_id(ident); --- 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 --- tests/t_netsync_defaults.at +++ tests/t_netsync_defaults.at @@ -35,7 +35,7 @@ AT_CHECK(test -f testdir2/testfile) # And finally, -AT_CHECK(MONOTONE2 set database default-server 127.0.0.1:5555, [], [ignore], [ignore]) +AT_CHECK(MONOTONE2 set database default-server 127.0.0.1:$_PORT, [], [ignore], [ignore]) AT_CHECK(MONOTONE2 set database default-collection thirdbranch, [], [ignore], [ignore]) AT_CHECK(MONOTONE2 sync, [], [ignore], [ignore]) AT_CHECK(MONOTONE2 checkout --branch=thirdbranch $THIRDBRANCH_R testdir3, [], [ignore], [ignore]) --- tests/t_netsync_single.at +++ tests/t_netsync_single.at @@ -24,9 +24,9 @@ VER0=`BASE_REVISION` NETSYNC_KILLHARD - MONOTONE --rcfile=netsync.lua serve 127.0.0.1:5555 testbranch & + MONOTONE --rcfile=netsync.lua serve 127.0.0.1:$_PORT testbranch & sleep 5 -AT_CHECK(MONOTONE --rcfile=netsync.lua --db=test2.db pull 127.0.0.1:5555 testbranch, [], [ignore], [ignore]) +AT_CHECK(MONOTONE --rcfile=netsync.lua --db=test2.db pull 127.0.0.1:$_PORT testbranch, [], [ignore], [ignore]) NETSYNC_KILLHARD AT_CHECK(MONOTONE --db=test2.db ls certs $VER0, [], [stdout]) --- 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)