# # patch "ChangeLog" # from [4e43a540851275a1b461aa4a4433a5f916587028] # to [d77b03c7641d312e49688af12c546ea29822e760] # # patch "commands.cc" # from [68cea70c24f58eba1d32948ce1f48ef33c1d4ebe] # to [688c544d00c8a14a7ad7764d0905f85a2f0ddfac] # # patch "tests/t_update_with_pending_add.at" # from [ce5bc7da954e468ee7a419435a64329266d5f95f] # to [8394d96a687a14e6dcae400383d3bef0e76d1f78] # # patch "tests/t_update_with_pending_drop.at" # from [a13daf2fd6702fe09632ccda621bb3d0a999d1af] # to [d52d3736c75a01c308500e12237edaf37e8f345f] # # patch "tests/t_update_with_pending_rename.at" # from [2d30e1dfbac75a361b0380937077c31f3e98c7ff] # to [d6e60af87b017d9269e0c3c797c93d0a696648fc] # --- ChangeLog +++ ChangeLog @@ -1,5 +1,14 @@ 2005-06-04 Derek Scherger + * commands.cc (update): update MT/work based on the changes + between the chosen revision and the new merge revision + * tests/t_update_with_pending_drop.at: + * tests/t_update_with_pending_add.at: + * tests/t_update_with_pending_rename.at: un-XFAIL and clean up now + that things work + +2005-06-04 Derek Scherger + * app_state.cc (app_state): initialize diffs to false; it seemed to be defaulting to true for me --- commands.cc +++ commands.cc @@ -2849,7 +2849,7 @@ manifest_id m_ancestor_id, m_chosen_id; revision_set r_old, r_working, r_new; revision_id r_old_id, r_chosen_id; - change_set old_to_chosen, update; + change_set old_to_chosen, update, remaining; if (args.size() > 0) throw usage(name); @@ -2942,6 +2942,20 @@ L(F("merging working copy with chosen edge %s -> %s\n") % r_old_id % r_chosen_id); + // we have the following + // + // old --- working + // \ \ + // chosen --- merged + // + // - old is the revision specified in MT/revision + // - working is based on old and includes the working copy's changes + // - chosen is the revision we're updating to and will end up in MT/revision + // - merged is the merge of working and chosen + // + // we apply the working to merged changeset to the working copy + // and keep the rearrangement from chosen to merged changeset in MT/work + merge_change_sets(old_to_chosen, old_to_working, chosen_to_merged, @@ -2951,6 +2965,7 @@ // dump_change_set("working to merged", working_to_merged); update = working_to_merged; + remaining = chosen_to_merged; } local_path tmp_root((mkpath(book_keeping_dir) / mkpath("tmp")).string()); @@ -2970,6 +2985,7 @@ put_revision_id(r_chosen_id); P(F("updated to base revision %s\n") % r_chosen_id); + put_path_rearrangement(remaining.rearrangement); update_any_attrs(app); maybe_update_inodeprints(app); } --- tests/t_update_with_pending_add.at +++ tests/t_update_with_pending_add.at @@ -1,19 +1,9 @@ # -*- Autoconf -*- AT_SETUP([update with pending add]) MONOTONE_SETUP -# this test is a bug report. the problem seems to be that update with a pending -# add doesn't remove the pending add from MT/work if the file is also added -# in the selected revision. -# -# as a side note, for some reason cat revision doesn't seem to work with an -# abbreviated revision id. this seems like it might be a problem with autotest -# or something, or possibly even (gasp) pilot error! ;) - -AT_XFAIL_IF(true) - ADD_FILE(file, [file ]) @@ -33,26 +23,14 @@ AT_CHECK(cd codir && MONOTONE update, [], [ignore], [ignore]) # why doesn't an abbreviated revision id work + AT_CHECK(cd codir && MONOTONE cat revision b482, [1], [ignore], [ignore]) AT_CHECK(cd codir && MONOTONE cat revision b482c907f27f160f7ff9259d353d5d5399fb9fc4, [], [ignore], [ignore]) -AT_CHECK(cd codir && MONOTONE cat manifest 1ff6, [], [ignore], [ignore]) -AT_CHECK(cd codir && MONOTONE cat manifest 3eff, [], [ignore], [ignore]) +# make sure there are no changes in the working copy -AT_CHECK(cat codir/MT/work, [], [ignore], [ignore]) -AT_CHECK(cat codir/MT/revision, [], [ignore], [ignore]) +AT_CHECK(test ! -e codir/MT/work, [], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE diff, [], [stdout], [ignore]) +AT_CHECK(grep 'no changes' stdout, [], [ignore], [ignore]) -# the working copy is now in a somewhat bad state. the revision it is based on -# has file2 in the manifest, but MT/work still contains add_file -# "file2". pending rearrangements, need to be resolved by update - -AT_CHECK(cd codir && MONOTONE cat revision, [3], [ignore], [ignore]) -AT_CHECK(cd codir && MONOTONE cat manifest, [3], [ignore], [ignore]) -AT_CHECK(cd codir && MONOTONE status, [3], [ignore], [ignore]) -AT_CHECK(cd codir && MONOTONE ls unknown, [3], [ignore], [ignore]) -AT_CHECK(cd codir && MONOTONE ls ignored, [3], [ignore], [ignore]) -AT_CHECK(cd codir && MONOTONE ls missing, [3], [ignore], [ignore]) - -AT_CHECK(false) - AT_CLEANUP --- tests/t_update_with_pending_drop.at +++ tests/t_update_with_pending_drop.at @@ -1,19 +1,9 @@ # -*- Autoconf -*- AT_SETUP([update with pending drop]) MONOTONE_SETUP -# this test is a bug report. the problem seems to be that update with a pending -# drop doesn't remove the pending drop from MT/work if the file is also dropped -# in the selected revision. -# -# as a side note, for some reason cat revision doesn't seem to work with an -# abbreviated revision id. this seems like it might be a problem with autotest -# or something, or possibly even (gasp) pilot error! ;) - -AT_XFAIL_IF(true) - ADD_FILE(file, [test1 ]) @@ -33,25 +23,10 @@ AT_CHECK(cd codir && MONOTONE cat revision a12d, [1], [ignore], [ignore]) AT_CHECK(cd codir && MONOTONE cat revision a12d8ad50bf5861310c22979ef6c3a8b8a686522, [], [ignore], [ignore]) -AT_CHECK(cd codir && MONOTONE cat manifest 6905, [], [ignore], [ignore]) -AT_CHECK(cd codir && MONOTONE cat manifest da39, [], [ignore], [ignore]) +# make sure there are no changes in the working copy -# it appears that da39 (the empty manifest) gets stored in the database +AT_CHECK(test ! -e codir/MT/work, [], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE diff, [], [stdout], [ignore]) +AT_CHECK(grep 'no changes' stdout, [], [ignore], [ignore]) -AT_CHECK(cat codir/MT/work, [], [ignore], [ignore]) -AT_CHECK(cat codir/MT/revision, [], [ignore], [ignore]) - -# the working copy is now in a somewhat bad state. the revision it is based on -# has an empty manifest, but MT/work still contains drop_file "file". pending -# rearrangements, need to be resolved by update - -AT_CHECK(cd codir && MONOTONE cat revision, [3], [ignore], [ignore]) -AT_CHECK(cd codir && MONOTONE cat manifest, [3], [ignore], [ignore]) -AT_CHECK(cd codir && MONOTONE status, [3], [ignore], [ignore]) -AT_CHECK(cd codir && MONOTONE ls unknown, [3], [ignore], [ignore]) -AT_CHECK(cd codir && MONOTONE ls ignored, [3], [ignore], [ignore]) -AT_CHECK(cd codir && MONOTONE ls missing, [3], [ignore], [ignore]) - -AT_CHECK(false) - AT_CLEANUP --- tests/t_update_with_pending_rename.at +++ tests/t_update_with_pending_rename.at @@ -1,19 +1,9 @@ # -*- Autoconf -*- AT_SETUP([update with pending rename]) MONOTONE_SETUP -# this test is a bug report. the problem seems to be that update with a pending -# rename doesn't remove the pending rename from MT/work if the file is also renamed -# in the selected revision. -# -# as a side note, for some reason cat revision doesn't seem to work with an -# abbreviated revision id. this seems like it might be a problem with autotest -# or something, or possibly even (gasp) pilot error! ;) - -AT_XFAIL_IF(true) - ADD_FILE(file, [test1 ]) @@ -31,27 +21,13 @@ AT_CHECK(cd codir && MONOTONE update, [], [ignore], [ignore]) # why doesn't an abbreviated revision id work -#AT_CHECK(cd codir && MONOTONE cat revision a12d, [1], [ignore], [ignore]) -#AT_CHECK(cd codir && MONOTONE cat revision a12d8ad50bf5861310c22979ef6c3a8b8a686522, [], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE cat revision 0cb6, [1], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE cat revision 0cb6da39a252816db091c515efa830840e77c4eb, [], [ignore], [ignore]) -#AT_CHECK(cd codir && MONOTONE cat manifest 6905, [], [ignore], [ignore]) -#AT_CHECK(cd codir && MONOTONE cat manifest da39, [], [ignore], [ignore]) +# make sure there are no changes in the working copy +AT_CHECK(test ! -e codir/MT/work, [], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE diff, [], [stdout], [ignore]) +AT_CHECK(grep 'no changes' stdout, [], [ignore], [ignore]) -AT_CHECK(cat codir/MT/work, [], [ignore], [ignore]) -AT_CHECK(cat codir/MT/revision, [], [ignore], [ignore]) - -# the working copy is now in a somewhat bad state. the revision it is based on -# has renamed file to file2, but MT/work still contains rename_file "file" -# "file2". pending rearrangements need to be resolved by update - -AT_CHECK(cd codir && MONOTONE cat revision, [3], [ignore], [ignore]) -AT_CHECK(cd codir && MONOTONE cat manifest, [3], [ignore], [ignore]) -AT_CHECK(cd codir && MONOTONE status, [3], [ignore], [ignore]) -AT_CHECK(cd codir && MONOTONE ls unknown, [3], [ignore], [ignore]) -AT_CHECK(cd codir && MONOTONE ls ignored, [3], [ignore], [ignore]) -AT_CHECK(cd codir && MONOTONE ls missing, [3], [ignore], [ignore]) - -AT_CHECK(false) - AT_CLEANUP