Author: svn-role Date: Fri Feb 10 04:00:30 2012 New Revision: 1242662 URL: http://svn.apache.org/viewvc?rev=1242662&view=rev Log: Reintergrate the 1.7.x-issue4059 branch:
* r1146762, r1201419, r1227237, r1227250, r1227352, r1227372, r1227384, r1227385, r1239382, r1239631, r1239655, r1239749 Fix issue #4059, "can't commit when copy-op-root and copied-along grandchild are explicit targets". Justification: Some copies can't be committed. Users complained. Regression from 1.6. Branch: ^/subversion/branches/1.7.x-issue4059 Notes: r1146762 avoids a semantic conflict r1201419 adds a regression test r1227237 is a comment fix r1227250 is an indentation fix r1227352 is merged to avoid a conflict and improves an error message r1227372 is a follow-up test fix for previous r1227384 prepares the actual fix and needs --accept=mine-conflict r1227385 is the actual fix r1239382 fixes the problem for nested copies, too r1239631 and r1239655 are follow-up comment fixes r1239749 fixes a performance regression on the backport branch Votes: +1: stsp, rhuijben, philip Modified: subversion/branches/1.7.x/ (props changed) subversion/branches/1.7.x/STATUS subversion/branches/1.7.x/subversion/include/private/svn_wc_private.h subversion/branches/1.7.x/subversion/libsvn_client/commit_util.c subversion/branches/1.7.x/subversion/libsvn_client/copy.c subversion/branches/1.7.x/subversion/libsvn_client/export.c subversion/branches/1.7.x/subversion/libsvn_client/merge.c subversion/branches/1.7.x/subversion/libsvn_client/mergeinfo.c subversion/branches/1.7.x/subversion/libsvn_client/ra.c subversion/branches/1.7.x/subversion/libsvn_wc/info.c subversion/branches/1.7.x/subversion/libsvn_wc/node.c subversion/branches/1.7.x/subversion/libsvn_wc/wc.h subversion/branches/1.7.x/subversion/tests/cmdline/commit_tests.py subversion/branches/1.7.x/subversion/tests/cmdline/merge_tests.py subversion/branches/1.7.x/subversion/tests/cmdline/svntest/sandbox.py Propchange: subversion/branches/1.7.x/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Feb 10 04:00:30 2012 @@ -1,3 +1,4 @@ +/subversion/1.7.x-issue4059:1239661-1239744 /subversion/branches/1.5.x-r30215:870312 /subversion/branches/1.7.x-JavaHL-pools:1158684-1158722 /subversion/branches/1.7.x-issue3888:1148937-1149162 @@ -6,6 +7,7 @@ /subversion/branches/1.7.x-issue4032:1186668-1186784 /subversion/branches/1.7.x-issue4035:1186202-1186315 /subversion/branches/1.7.x-issue4035-r1185738:1186316-1186778 +/subversion/branches/1.7.x-issue4059:1239745-1242661 /subversion/branches/1.7.x-issue4093:1229839-1230236 /subversion/branches/1.7.x-issue4k:1166502-1167193 /subversion/branches/1.7.x-neon-default:1148803-1158680 @@ -74,4 +76,4 @@ /subversion/branches/tree-conflicts:868291-873154 /subversion/branches/tree-conflicts-notify:873926-874008 /subversion/branches/uris-as-urls:1060426-1064427 -/subversion/trunk:1146013,1146121,1146219,1146222,1146274,1146492,1146555,1146606,1146620,1146684,1146781,1146832,1146834,1146870,1146899,1146904,1147293,1147299,1147309,1147882,1148071,1148083,1148094,1148131,1148374,1148424,1148566,1148588,1148652,1148662,1148699,1148853,1148877,1148882,1148936,1149103,1149105,1149135,1149141,1149160,1149228,1149240,1149343,1149371-1149372,1149377,1149398,1149401,1149539,1149572,1149627,1149675,1149701,1149713,1150242,1150254,1150260-1150261,1150266,1150302,1150327,1150344,1150368,1150372,1150441,1150506,1150812,1150853,1151036,1151177,1151610,1151854,1151906,1151911,1152129,1152140,1152189-1152190,1152267,1152282,1152286,1152726,1152809,1153138,1153141,1153416,1153540,1153566,1153799,1153807,1153968,1154009,1154023,1154115,1154119,1154121,1154144,1154155,1154159,1154165,1154215,1154225,1154273,1154278,1154379,1154382,1154461,1154717-1154718,1154733,1154908,1154982,1155015,1155044,1155124,1155131,1155160,1155313,1155334,1155391,1155404,115 6085,1156098,1156216,1156218,1156312,1156527,1156717,1156721,1156750,1156827,1156838,1157416,1158187,1158193-1158194,1158196,1158201,1158207,1158209-1158210,1158217,1158285,1158288,1158303,1158309,1158407,1158419,1158421,1158436,1158455,1158616-1158617,1158634,1158854,1158875,1158886,1158893,1158896,1158919,1158923-1158924,1158929,1158963,1159093,1159098,1159101,1159132,1159136,1159148,1159230,1159275,1159400,1159686,1159760,1159772,1160605,1160671,1160682,1160704-1160705,1160756,1161063,1161080,1161185,1161210,1161683,1161721,1162024,1162033,1162201,1162516,1162880,1162974,1162995,1163243,1163372,1163383,1163557,1163792,1163953,1164027,1164386,1164426,1164517,1164535,1164554,1164580,1164614,1164645,1164760,1164765,1166267,1166500,1166555,1166678,1167062,1167173,1167209,1167269,1167503,1167659,1167681,1169524,1169531,1169650,1171708,1173111,1173425,1173639,1174051,1174060,1174652,1174761,1174797-1174798,1174806,1175888,1176915,1176949,1177001,1177492,1177732,1178280,1178282, 1178942,1179680,1179767,1179776,1180154,1181090,1181110,1181155,1181215,1181609,1181666,1182115,1182527,1182771,1182904,1182909,1183054,1183263,1183347,1185222,1185242,1185280,1185282,1185730,1185738,1185746,1185763,1185768,1185886,1185911,1185918,1186059,1186092,1186101,1186107,1186109,1186121,1186231,1186240,1186422,1186434,1186732,1186755,1186784,1186815,1186928,1186944,1186981,1186983,1187311,1187676,1187695,1188609,1188652,1188677,1188762,1188774,1189190,1189261,1189395,1189580,1189665,1195480,1197135,1197998,1199876,1199950,1200837,1201002,1201072,1201824,1202135,1202187,1202630,1202807,1203546,1203651,1203653,1204167,1204478,1204610,1204673,1205188,1205193,1205209,1205726,1205839,1205848,1206523,1206533,1206576,1206718-1206719,1206724,1206741,1206748,1207555,1207656,1207663,1207808,1207823,1207858,1207949,1208840,1209631,1209654,1210195,1211483,1211859,1211885,1212476,1212482,1212484,1213331,1213673,1213681,1213690,1213711,1213716,1214139,1215260,1215288,1215374-12153 75,1215379,1220742,1220750,1221178,1221303,1221767,1221780,1221793,1222521,1222628,1222644,1222693,1222699,1225491,1226597,1227146,1227900,1228340,1229252,1229303,1229677,1229833,1229980,1230212,1231029,1231944-1231945,1232202,1232207,1232221-1232222,1232413,1235264,1235296,1235302,1235736,1236163,1236173,1236283,1236343,1237720,1239596,1240314,1240485,1240752,1241530,1241553,1241713,1241726 +/subversion/trunk:1146013,1146121,1146219,1146222,1146274,1146492,1146555,1146606,1146620,1146684,1146762,1146781,1146832,1146834,1146870,1146899,1146904,1147293,1147299,1147309,1147882,1148071,1148083,1148094,1148131,1148374,1148424,1148566,1148588,1148652,1148662,1148699,1148853,1148877,1148882,1148936,1149103,1149105,1149135,1149141,1149160,1149228,1149240,1149343,1149371-1149372,1149377,1149398,1149401,1149539,1149572,1149627,1149675,1149701,1149713,1150242,1150254,1150260-1150261,1150266,1150302,1150327,1150344,1150368,1150372,1150441,1150506,1150812,1150853,1151036,1151177,1151610,1151854,1151906,1151911,1152129,1152140,1152189-1152190,1152267,1152282,1152286,1152726,1152809,1153138,1153141,1153416,1153540,1153566,1153799,1153807,1153968,1154009,1154023,1154115,1154119,1154121,1154144,1154155,1154159,1154165,1154215,1154225,1154273,1154278,1154379,1154382,1154461,1154717-1154718,1154733,1154908,1154982,1155015,1155044,1155124,1155131,1155160,1155313,1155334,1155391,115 5404,1156085,1156098,1156216,1156218,1156312,1156527,1156717,1156721,1156750,1156827,1156838,1157416,1158187,1158193-1158194,1158196,1158201,1158207,1158209-1158210,1158217,1158285,1158288,1158303,1158309,1158407,1158419,1158421,1158436,1158455,1158616-1158617,1158634,1158854,1158875,1158886,1158893,1158896,1158919,1158923-1158924,1158929,1158963,1159093,1159098,1159101,1159132,1159136,1159148,1159230,1159275,1159400,1159686,1159760,1159772,1160605,1160671,1160682,1160704-1160705,1160756,1161063,1161080,1161185,1161210,1161683,1161721,1162024,1162033,1162201,1162516,1162880,1162974,1162995,1163243,1163372,1163383,1163557,1163792,1163953,1164027,1164386,1164426,1164517,1164535,1164554,1164580,1164614,1164645,1164760,1164765,1166267,1166500,1166555,1166678,1167062,1167173,1167209,1167269,1167503,1167659,1167681,1169524,1169531,1169650,1171708,1173111,1173425,1173639,1174051,1174060,1174652,1174761,1174797-1174798,1174806,1175888,1176915,1176949,1177001,1177492,1177732,1178280, 1178282,1178942,1179680,1179767,1179776,1180154,1181090,1181110,1181155,1181215,1181609,1181666,1182115,1182527,1182771,1182904,1182909,1183054,1183263,1183347,1185222,1185242,1185280,1185282,1185730,1185738,1185746,1185763,1185768,1185886,1185911,1185918,1186059,1186092,1186101,1186107,1186109,1186121,1186231,1186240,1186422,1186434,1186732,1186755,1186784,1186815,1186928,1186944,1186981,1186983,1187311,1187676,1187695,1188609,1188652,1188677,1188762,1188774,1189190,1189261,1189395,1189580,1189665,1195480,1197135,1197998,1199876,1199950,1200837,1201002,1201072,1201419,1201824,1202135,1202187,1202630,1202807,1203546,1203651,1203653,1204167,1204478,1204610,1204673,1205188,1205193,1205209,1205726,1205839,1205848,1206523,1206533,1206576,1206718-1206719,1206724,1206741,1206748,1207555,1207656,1207663,1207808,1207823,1207858,1207949,1208840,1209631,1209654,1210195,1211483,1211859,1211885,1212476,1212482,1212484,1213331,1213673,1213681,1213690,1213711,1213716,1214139,1215260,12152 88,1215374-1215375,1215379,1220742,1220750,1221178,1221303,1221767,1221780,1221793,1222521,1222628,1222644,1222693,1222699,1225491,1226597,1227146,1227237,1227250,1227352,1227372,1227384-1227385,1227900,1228340,1229252,1229303,1229677,1229833,1229980,1230212,1231029,1231944-1231945,1232202,1232207,1232221-1232222,1232413,1235264,1235296,1235302,1235736,1236163,1236173,1236283,1236343,1237720,1239382,1239596,1239631,1239655,1239747,1240314,1240485,1240752,1241530,1241553,1241713,1241726 Modified: subversion/branches/1.7.x/STATUS URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/STATUS?rev=1242662&r1=1242661&r2=1242662&view=diff ============================================================================== --- subversion/branches/1.7.x/STATUS (original) +++ subversion/branches/1.7.x/STATUS Fri Feb 10 04:00:30 2012 @@ -135,26 +135,3 @@ Veto-blocked changes: Approved changes: ================= - - * r1146762, r1201419, r1227237, r1227250, r1227352, r1227372, r1227384, - r1227385, r1239382, r1239631, r1239655, r1239749 - Fix issue #4059, "can't commit when copy-op-root and copied-along - grandchild are explicit targets". - Justification: - Some copies can't be committed. Users complained. Regression from 1.6. - Branch: - ^/subversion/branches/1.7.x-issue4059 - Notes: - r1146762 avoids a semantic conflict - r1201419 adds a regression test - r1227237 is a comment fix - r1227250 is an indentation fix - r1227352 is merged to avoid a conflict and improves an error message - r1227372 is a follow-up test fix for previous - r1227384 prepares the actual fix and needs --accept=mine-conflict - r1227385 is the actual fix - r1239382 fixes the problem for nested copies, too - r1239631 and r1239655 are follow-up comment fixes - r1239749 fixes a performance regression on the backport branch - Votes: - +1: stsp, rhuijben, philip Modified: subversion/branches/1.7.x/subversion/include/private/svn_wc_private.h URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/include/private/svn_wc_private.h?rev=1242662&r1=1242661&r2=1242662&view=diff ============================================================================== --- subversion/branches/1.7.x/subversion/include/private/svn_wc_private.h (original) +++ subversion/branches/1.7.x/subversion/include/private/svn_wc_private.h Fri Feb 10 04:00:30 2012 @@ -419,6 +419,12 @@ svn_wc__node_get_url(const char **url, * If not NULL, sets @a revision, @a repos_relpath, @a repos_root_url and * @a repos_uuid to the original (if a copy) or their current values. * + * If @a copy_root_abspath is not NULL, and @a *is_copy indicates that the + * node was copied, set @a *copy_root_abspath to the local absolute path of + * the root of the copied subtree containing the node. If the copied node is + * a root by itself, @a *copy_root_abspath will match @a local_abspath (but + * won't necessarily point to the same string in memory). + * * If @a scan_deleted is TRUE, determine the origin of the deleted node. If * @a scan_deleted is FALSE, return NULL, SVN_INVALID_REVNUM or FALSE for * deleted nodes. @@ -431,6 +437,7 @@ svn_wc__node_get_origin(svn_boolean_t *i const char **repos_relpath, const char **repos_root_url, const char **repos_uuid, + const char **copy_root_abspath, svn_wc_context_t *wc_ctx, const char *local_abspath, svn_boolean_t scan_deleted, Modified: subversion/branches/1.7.x/subversion/libsvn_client/commit_util.c URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/libsvn_client/commit_util.c?rev=1242662&r1=1242661&r2=1242662&view=diff ============================================================================== --- subversion/branches/1.7.x/subversion/libsvn_client/commit_util.c (original) +++ subversion/branches/1.7.x/subversion/libsvn_client/commit_util.c Fri Feb 10 04:00:30 2012 @@ -410,6 +410,10 @@ bail_on_tree_conflicted_ancestor(svn_wc_ when harvesting committables; that is, don't add a path to COMMITTABLES unless it's a member of one of those changelists. + DANGLERS is a hash table mapping const char* absolute paths of a parent + to a const char * absolute path of a child. See the comment about + danglers at the top of svn_client__harvest_committables(). + If CANCEL_FUNC is non-null, call it with CANCEL_BATON to see if the user has cancelled the operation. @@ -428,6 +432,7 @@ harvest_committables(svn_wc_context_t *w apr_hash_t *changelists, svn_boolean_t skip_files, svn_boolean_t skip_dirs, + apr_hash_t *danglers, svn_client__check_url_kind_t check_url_func, void *check_url_baton, svn_cancel_func_t cancel_func, @@ -606,7 +611,7 @@ harvest_committables(svn_wc_context_t *w /* Determine from what parent we would be the deleted child */ SVN_ERR(svn_wc__node_get_origin(NULL, &revision, &repos_relpath, - NULL, NULL, wc_ctx, + NULL, NULL, NULL, wc_ctx, svn_dirent_dirname(local_abspath, scratch_pool), FALSE, scratch_pool, scratch_pool)); @@ -663,7 +668,7 @@ harvest_committables(svn_wc_context_t *w SVN_ERR(svn_wc__node_get_origin(NULL, &cf_rev, &cf_relpath, NULL, - NULL, + NULL, NULL, wc_ctx, local_abspath, FALSE, scratch_pool, scratch_pool)); @@ -793,6 +798,45 @@ harvest_committables(svn_wc_context_t *w } } + /* Make sure we check for dangling children on additions */ + if (state_flags && is_added && danglers) + { + /* If a node is added, it's parent must exist in the repository at the + time of committing */ + + svn_boolean_t parent_added; + const char *parent_abspath = svn_dirent_dirname(local_abspath, + scratch_pool); + + SVN_ERR(svn_wc__node_is_added(&parent_added, wc_ctx, parent_abspath, + scratch_pool)); + + if (parent_added) + { + const char *copy_root_abspath; + svn_boolean_t parent_is_copy; + + /* The parent is added, so either it is a copy, or a locally added + * directory. In either case, we require the op-root of the parent + * to be part of the commit. See issue #4059. */ + SVN_ERR(svn_wc__node_get_origin(&parent_is_copy, NULL, NULL, NULL, + NULL, ©_root_abspath, + wc_ctx, parent_abspath, + FALSE, scratch_pool, scratch_pool)); + + if (parent_is_copy) + parent_abspath = copy_root_abspath; + + if (!apr_hash_get(danglers, parent_abspath, APR_HASH_KEY_STRING)) + { + apr_hash_set(danglers, + apr_pstrdup(result_pool, parent_abspath), + APR_HASH_KEY_STRING, + apr_pstrdup(result_pool, local_abspath)); + } + } + } + if (db_kind != svn_node_dir || depth <= svn_depth_empty) return SVN_NO_ERROR; @@ -841,6 +885,7 @@ harvest_committables(svn_wc_context_t *w changelists, (depth < svn_depth_files), (depth < svn_depth_immediates), + NULL, /* danglers */ check_url_func, check_url_baton, cancel_func, cancel_baton, notify_func, notify_baton, @@ -1010,13 +1055,13 @@ svn_client__harvest_committables(svn_cli * Since we don't know what's included in the commit until we've * harvested all the targets, we can't reliably check this as we * go. So in `danglers', we record named targets whose parents - * are unversioned, then after harvesting the total commit group, we - * check to make sure those parents are included. + * do not yet exist in the repository. Then after harvesting the total + * commit group, we check to make sure those parents are included. * - * Each key of danglers is an unversioned parent. The (const char *) - * value is one of that parent's children which is named as part of - * the commit; the child is included only to make a better error - * message. + * Each key of danglers is a parent which does not exist in the + * repository. The (const char *) value is one of that parent's + * children which is named as part of the commit; the child is + * included only to make a better error message. * * (The reason we don't bother to check unnamed -- i.e, implicit -- * targets is that they can only join the commit if their parents @@ -1041,10 +1086,8 @@ svn_client__harvest_committables(svn_cli for (i = 0; i < targets->nelts; ++i) { const char *target_abspath; - svn_boolean_t is_added; svn_node_kind_t kind; const char *repos_root_url; - svn_error_t *err; svn_pool_clear(iterpool); @@ -1081,35 +1124,6 @@ svn_client__harvest_committables(svn_cli target_abspath, result_pool, iterpool)); - /* Handle an added/replaced node. */ - SVN_ERR(svn_wc__node_is_added(&is_added, ctx->wc_ctx, target_abspath, - iterpool)); - if (is_added) - { - /* This node is added. Is the parent also added? */ - const char *parent_abspath = svn_dirent_dirname(target_abspath, - iterpool); - err = svn_wc__node_is_added(&is_added, ctx->wc_ctx, parent_abspath, - iterpool); - if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND) - return svn_error_createf( - SVN_ERR_WC_CORRUPT, err, - _("'%s' is scheduled for addition within unversioned parent"), - svn_dirent_local_style(target_abspath, iterpool)); - SVN_ERR(err); - - if (is_added) - { - /* Copy the parent and target into pool; iterpool - lasts only for this loop iteration, and we check - danglers after the loop is over. */ - apr_hash_set(danglers, - apr_pstrdup(scratch_pool, parent_abspath), - APR_HASH_KEY_STRING, - apr_pstrdup(scratch_pool, target_abspath)); - } - } - /* Handle our TARGET. */ /* Make sure this isn't inside a working copy subtree that is * marked as tree-conflicted. */ @@ -1125,6 +1139,7 @@ svn_client__harvest_committables(svn_cli FALSE /* COPY_MODE_ROOT */, depth, just_locked, changelist_hash, FALSE, FALSE, + danglers, check_url_func, check_url_baton, ctx->cancel_func, ctx->cancel_baton, ctx->notify_func2, ctx->notify_baton2, @@ -1147,31 +1162,31 @@ svn_client__harvest_committables(svn_cli svn_pool_clear(iterpool); - if (! look_up_committable(*committables, dangling_parent, iterpool)) - { - const char *dangling_child = svn__apr_hash_index_val(hi); - - if (ctx->notify_func2 != NULL) - { - svn_wc_notify_t *notify; - - notify = svn_wc_create_notify(dangling_child, - svn_wc_notify_failed_no_parent, - scratch_pool); - - ctx->notify_func2(ctx->notify_baton2, notify, iterpool); - } - - return svn_error_createf( - SVN_ERR_ILLEGAL_TARGET, NULL, - _("'%s' is not under version control " - "and is not part of the commit, " - "yet its child '%s' is part of the commit"), - /* Probably one or both of these is an entry, but - safest to local_stylize just in case. */ - svn_dirent_local_style(dangling_parent, iterpool), - svn_dirent_local_style(dangling_child, iterpool)); - } + if (! look_up_committable(*committables, dangling_parent, iterpool)) + { + const char *dangling_child = svn__apr_hash_index_val(hi); + + if (ctx->notify_func2 != NULL) + { + svn_wc_notify_t *notify; + + notify = svn_wc_create_notify(dangling_child, + svn_wc_notify_failed_no_parent, + scratch_pool); + + ctx->notify_func2(ctx->notify_baton2, notify, iterpool); + } + + return svn_error_createf( + SVN_ERR_ILLEGAL_TARGET, NULL, + _("'%s' is not known to exist in the repository " + "and is not part of the commit, " + "yet its child '%s' is part of the commit"), + /* Probably one or both of these is an entry, but + safest to local_stylize just in case. */ + svn_dirent_local_style(dangling_parent, iterpool), + svn_dirent_local_style(dangling_child, iterpool)); + } } svn_pool_destroy(iterpool); @@ -1218,6 +1233,7 @@ harvest_copy_committables(void *baton, v FALSE, /* JUST_LOCKED */ NULL, FALSE, FALSE, /* skip files, dirs */ + NULL, btn->check_url_func, btn->check_url_baton, btn->ctx->cancel_func, Modified: subversion/branches/1.7.x/subversion/libsvn_client/copy.c URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/libsvn_client/copy.c?rev=1242662&r1=1242661&r2=1242662&view=diff ============================================================================== --- subversion/branches/1.7.x/subversion/libsvn_client/copy.c (original) +++ subversion/branches/1.7.x/subversion/libsvn_client/copy.c Fri Feb 10 04:00:30 2012 @@ -98,7 +98,7 @@ calculate_target_mergeinfo(svn_ra_sessio SVN_ERR(svn_wc__node_get_origin(NULL, &src_revnum, &repos_relpath, &repos_root_url, - NULL, + NULL, NULL, ctx->wc_ctx, local_abspath, FALSE, pool, pool)); @@ -2206,7 +2206,7 @@ try_copy(const apr_array_header_t *sourc SVN_ERR(svn_wc__node_get_origin(NULL, ©from_rev, ©from_repos_relpath, ©from_repos_root_url, - NULL, + NULL, NULL, ctx->wc_ctx, pair->src_abspath_or_url, TRUE, iterpool, iterpool)); Modified: subversion/branches/1.7.x/subversion/libsvn_client/export.c URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/libsvn_client/export.c?rev=1242662&r1=1242661&r2=1242662&view=diff ============================================================================== --- subversion/branches/1.7.x/subversion/libsvn_client/export.c (original) +++ subversion/branches/1.7.x/subversion/libsvn_client/export.c Fri Feb 10 04:00:30 2012 @@ -402,7 +402,7 @@ copy_versioned_files(const char *from_ab const char *repos_relpath; SVN_ERR(svn_wc__node_get_origin(&is_added, NULL, &repos_relpath, - NULL, NULL, + NULL, NULL, NULL, ctx->wc_ctx, from_abspath, FALSE, pool, pool)); Modified: subversion/branches/1.7.x/subversion/libsvn_client/merge.c URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/libsvn_client/merge.c?rev=1242662&r1=1242661&r2=1242662&view=diff ============================================================================== --- subversion/branches/1.7.x/subversion/libsvn_client/merge.c (original) +++ subversion/branches/1.7.x/subversion/libsvn_client/merge.c Fri Feb 10 04:00:30 2012 @@ -3264,7 +3264,7 @@ get_full_mergeinfo(svn_mergeinfo_t *reco /* Retrieve the origin (original_*) of the node, or just the url if the node was not copied. */ SVN_ERR(svn_wc__node_get_origin(FALSE, &target_rev, &repos_relpath, - &repos_root, NULL, + &repos_root, NULL, NULL, ctx->wc_ctx, target_abspath, FALSE, scratch_pool, scratch_pool)); Modified: subversion/branches/1.7.x/subversion/libsvn_client/mergeinfo.c URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/libsvn_client/mergeinfo.c?rev=1242662&r1=1242661&r2=1242662&view=diff ============================================================================== --- subversion/branches/1.7.x/subversion/libsvn_client/mergeinfo.c (original) +++ subversion/branches/1.7.x/subversion/libsvn_client/mergeinfo.c Fri Feb 10 04:00:30 2012 @@ -612,7 +612,7 @@ svn_client__get_wc_or_repos_mergeinfo_ca a URL and without that we cannot get accurate mergeinfo for TARGET_WCPATH. */ SVN_ERR(svn_wc__node_get_origin(NULL, &target_rev, &repos_relpath, - &repos_root, NULL, + &repos_root, NULL, NULL, ctx->wc_ctx, local_abspath, FALSE, scratch_pool, scratch_pool)); @@ -1124,7 +1124,7 @@ get_mergeinfo(svn_mergeinfo_catalog_t *m scratch_pool)); SVN_ERR(svn_wc__node_get_origin(NULL, &rev, &repos_relpath, - &repos_root_url, NULL, + &repos_root_url, NULL, NULL, ctx->wc_ctx, local_abspath, FALSE, scratch_pool, scratch_pool)); Modified: subversion/branches/1.7.x/subversion/libsvn_client/ra.c URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/libsvn_client/ra.c?rev=1242662&r1=1242661&r2=1242662&view=diff ============================================================================== --- subversion/branches/1.7.x/subversion/libsvn_client/ra.c (original) +++ subversion/branches/1.7.x/subversion/libsvn_client/ra.c Fri Feb 10 04:00:30 2012 @@ -633,7 +633,7 @@ svn_client__repos_locations(const char * svn_boolean_t is_copy; SVN_ERR(svn_wc__node_get_origin(&is_copy, &peg_revnum, &repos_relpath, - &repos_root_url, NULL, + &repos_root_url, NULL, NULL, ctx->wc_ctx, local_abspath_or_url, FALSE, subpool, subpool)); Modified: subversion/branches/1.7.x/subversion/libsvn_wc/info.c URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/libsvn_wc/info.c?rev=1242662&r1=1242661&r2=1242662&view=diff ============================================================================== --- subversion/branches/1.7.x/subversion/libsvn_wc/info.c (original) +++ subversion/branches/1.7.x/subversion/libsvn_wc/info.c Fri Feb 10 04:00:30 2012 @@ -171,7 +171,7 @@ build_info_for_node(svn_wc__info2_t **in SVN_ERR(svn_wc__internal_get_origin(NULL, &tmpinfo->rev, &repos_relpath, &tmpinfo->repos_root_URL, - &tmpinfo->repos_UUID, + &tmpinfo->repos_UUID, NULL, db, local_abspath, TRUE, result_pool, scratch_pool)); } Modified: subversion/branches/1.7.x/subversion/libsvn_wc/node.c URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/libsvn_wc/node.c?rev=1242662&r1=1242661&r2=1242662&view=diff ============================================================================== --- subversion/branches/1.7.x/subversion/libsvn_wc/node.c (original) +++ subversion/branches/1.7.x/subversion/libsvn_wc/node.c Fri Feb 10 04:00:30 2012 @@ -1320,6 +1320,7 @@ svn_wc__internal_get_origin(svn_boolean_ const char **repos_relpath, const char **repos_root_url, const char **repos_uuid, + const char **copy_root_abspath, svn_wc__db_t *db, const char *local_abspath, svn_boolean_t scan_deleted, @@ -1370,7 +1371,8 @@ svn_wc__internal_get_origin(svn_boolean_ if (repos_uuid) *repos_uuid = original_repos_uuid; - return SVN_NO_ERROR; + if (copy_root_abspath == NULL) + return SVN_NO_ERROR; } { @@ -1399,13 +1401,19 @@ svn_wc__internal_get_origin(svn_boolean_ result_pool, scratch_pool)); if (status == svn_wc__db_status_added) - return SVN_NO_ERROR; /* Local addition */ + { + if (is_copy) + *is_copy = FALSE; + return SVN_NO_ERROR; /* Local addition */ + } *repos_relpath = svn_relpath_join( original_repos_relpath, svn_dirent_skip_ancestor(op_root_abspath, local_abspath), result_pool); + if (copy_root_abspath) + *copy_root_abspath = op_root_abspath; } else /* Deleted, excluded, not-present, server-excluded, ... */ { @@ -1430,6 +1438,7 @@ svn_wc__node_get_origin(svn_boolean_t *i const char **repos_relpath, const char **repos_root_url, const char **repos_uuid, + const char **copy_root_abspath, svn_wc_context_t *wc_ctx, const char *local_abspath, svn_boolean_t scan_deleted, @@ -1438,6 +1447,7 @@ svn_wc__node_get_origin(svn_boolean_t *i { return svn_error_trace(svn_wc__internal_get_origin(is_copy, revision, repos_relpath, repos_root_url, repos_uuid, + copy_root_abspath, wc_ctx->db, local_abspath, scan_deleted, result_pool, scratch_pool)); } Modified: subversion/branches/1.7.x/subversion/libsvn_wc/wc.h URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/libsvn_wc/wc.h?rev=1242662&r1=1242661&r2=1242662&view=diff ============================================================================== --- subversion/branches/1.7.x/subversion/libsvn_wc/wc.h (original) +++ subversion/branches/1.7.x/subversion/libsvn_wc/wc.h Fri Feb 10 04:00:30 2012 @@ -622,6 +622,7 @@ svn_wc__internal_get_origin(svn_boolean_ const char **repos_relpath, const char **repos_root_url, const char **repos_uuid, + const char **copy_root_abspath, svn_wc__db_t *db, const char *local_abspath, svn_boolean_t scan_deleted, Modified: subversion/branches/1.7.x/subversion/tests/cmdline/commit_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/tests/cmdline/commit_tests.py?rev=1242662&r1=1242661&r2=1242662&view=diff ============================================================================== --- subversion/branches/1.7.x/subversion/tests/cmdline/commit_tests.py (original) +++ subversion/branches/1.7.x/subversion/tests/cmdline/commit_tests.py Fri Feb 10 04:00:30 2012 @@ -1136,19 +1136,26 @@ def commit_in_dir_scheduled_for_addition A_path = os.path.join(wc_dir, 'A') Z_path = os.path.join(wc_dir, 'Z') + Z_abspath = os.path.abspath(Z_path) mu_path = os.path.join(wc_dir, 'Z', 'mu') svntest.main.run_svn(None, 'move', A_path, Z_path) + + # Make sure mu is a committable + svntest.main.file_write(mu_path, "xxxx") # Commit a copied thing inside an added-with-history directory, # expecting a specific error to occur! svntest.actions.run_and_verify_commit(wc_dir, None, None, - "not under version control", + "svn: E200009: '" + + re.escape(Z_abspath) + + "' is not known to exist in the", mu_path) Q_path = os.path.join(wc_dir, 'Q') + Q_abspath = os.path.abspath(Q_path) bloo_path = os.path.join(Q_path, 'bloo') os.mkdir(Q_path) @@ -1160,9 +1167,24 @@ def commit_in_dir_scheduled_for_addition svntest.actions.run_and_verify_commit(wc_dir, None, None, - "not under version control", + "svn: E200009: '" + + re.escape(Q_abspath) + + "' is not known to exist in the", bloo_path) + R_path = sbox.ospath('Z/B/R') + sbox.simple_mkdir('Z/B/R') + + # Commit a d added thing inside an added directory, + # expecting a specific error to occur! + svntest.actions.run_and_verify_commit(wc_dir, + None, + None, + "svn: E200009: '" + + re.escape(Z_abspath) + + "' is not known to exist in the.*", + R_path) + #---------------------------------------------------------------------- # Does this make sense now that deleted files are always removed from the wc? @@ -2825,6 +2847,35 @@ def commit_incomplete(sbox): None, wc_dir) +#---------------------------------------------------------------------- +# Reported here: +# Message-ID: <4ebf0fc9....@gmail.com> +# Date: Sun, 13 Nov 2011 13:31:05 +1300 +# From: Fergus Slorach <sug...@gmail.com> +# Subject: svn commit --targets behaviour change in 1.7? +def commit_add_subadd(sbox): + "committing add with explicit subadd targets" + + sbox.build() + wc_dir = sbox.wc_dir + + targets_file = sbox.ospath('targets') # ### better tempdir? + targets_file = os.path.abspath(targets_file) + + # prepare targets file + targets = "A/D A/D/H A/D/H/chi A/D/H/omega A/D/H/psi".split() + open(targets_file, 'w').write("\n".join(targets)) + + # r2: rm A/D + sbox.simple_rm('A/D') + sbox.simple_commit(message='rm') + + # r3: revert r2, with specific invocation + os.chdir(wc_dir) + svntest.main.run_svn(None, 'up') + svntest.main.run_svn(None, 'merge', '-c', '-2', './') + svntest.main.run_svn(None, 'commit', '--targets', targets_file, '-mm') + ######################################################################## # Run the tests @@ -2894,6 +2945,7 @@ test_list = [ None, tree_conflicts_resolved, commit_multiple_nested_deletes, commit_incomplete, + commit_add_subadd, ] if __name__ == '__main__': Modified: subversion/branches/1.7.x/subversion/tests/cmdline/merge_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/tests/cmdline/merge_tests.py?rev=1242662&r1=1242661&r2=1242662&view=diff ============================================================================== --- subversion/branches/1.7.x/subversion/tests/cmdline/merge_tests.py (original) +++ subversion/branches/1.7.x/subversion/tests/cmdline/merge_tests.py Fri Feb 10 04:00:30 2012 @@ -12005,7 +12005,7 @@ def subtree_source_missing_in_requested_ sbox.build() wc_dir = sbox.wc_dir - # Make a branche to merge to. + # Make a branch to merge to. wc_disk, wc_status = set_up_branch(sbox, False, 1) # Some paths we'll care about. @@ -12015,16 +12015,14 @@ def subtree_source_missing_in_requested_ psi_COPY_path = os.path.join(wc_dir, "A_COPY", "D", "H", "psi") omega_COPY_path = os.path.join(wc_dir, "A_COPY", "D", "H", "omega") - # r7 Delete a A/D/H/psi. + # r7 Delete A/D/H/psi. svntest.actions.run_and_verify_svn(None, None, [], 'delete', psi_path) - svntest.actions.run_and_verify_svn(None, None, [], - 'ci', '-m', 'delete psi', wc_dir) + sbox.simple_commit(message='delete psi') # r8 - modify A/D/H/omega. svntest.main.file_write(os.path.join(omega_path), "Even newer content") - svntest.actions.run_and_verify_svn(None, None, [], - 'ci', '-m', 'modify omega', wc_dir) + sbox.simple_commit(message='modify omega') # r9 - Merge r3 to A_COPY/D/H/psi expected_output = expected_merge_output( @@ -12034,9 +12032,7 @@ def subtree_source_missing_in_requested_ 'merge', '-c', '3', sbox.repo_url + '/A/D/H/psi@3', psi_COPY_path) - svntest.actions.run_and_verify_svn(None, None, [], - 'ci', '-m', 'merge r3 to A_COPY/D/H/psi', - wc_dir) + sbox.simple_commit(message='merge r3 to A_COPY/D/H/psi') # r10 - Merge r6 to A_COPY/D/H/omega. expected_output = expected_merge_output( @@ -12046,9 +12042,7 @@ def subtree_source_missing_in_requested_ 'merge', '-c', '6', sbox.repo_url + '/A/D/H/omega', omega_COPY_path) - svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m', - 'merge r6 to A_COPY', - wc_dir) + sbox.simple_commit(message='merge r6 to A_COPY') svntest.actions.run_and_verify_svn(None, exp_noop_up_out(10), [], 'up', wc_dir) @@ -12075,17 +12069,14 @@ def subtree_source_missing_in_requested_ 'merge', '-c', '8', sbox.repo_url + '/A', A_COPY_path, '--record-only') - svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m', - 'merge r8 to A_COPY/D/H/omega', - wc_dir) + sbox.simple_commit(message='merge r8 to A_COPY/D/H/omega') svntest.actions.run_and_verify_svn(None, exp_noop_up_out(11), [], 'up', wc_dir) # r12 - modify A/D/H/omega yet again. svntest.main.file_write(os.path.join(omega_path), "Now with fabulous new content!") - svntest.actions.run_and_verify_svn(None, None, [], - 'ci', '-m', 'modify omega', wc_dir) + sbox.simple_commit(message='modify omega') # r13 - Merge all available revs to A_COPY/D/H/omega. expected_output = expected_merge_output( @@ -12095,9 +12086,7 @@ def subtree_source_missing_in_requested_ 'merge', sbox.repo_url + '/A/D/H/omega', omega_COPY_path) - svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m', - 'cherry harvest to A_COPY/D/H/omega', - wc_dir) + sbox.simple_commit(message='cherry harvest to A_COPY/D/H/omega') svntest.actions.run_and_verify_svn(None, exp_noop_up_out(13), [], 'up', wc_dir) @@ -12258,9 +12247,7 @@ def subtree_source_missing_in_requested_ 'merge', '-c', '12', sbox.repo_url + '/A', A_COPY_path, '--record-only') - svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m', - 'Merge r12 to A_COPY', - wc_dir) + sbox.simple_commit(message='Merge r12 to A_COPY') # Update A_COPY/D/H/rho back to r13 so it's mergeinfo doesn't include # r12. Then merge a range, -r6:12 which should delete a subtree @@ -13735,14 +13722,12 @@ def subtree_gets_changes_even_if_ultimat # r7: Make an additional text mod to A/D/H/psi. svntest.main.file_write(psi_path, "Even newer content") - svntest.actions.run_and_verify_svn(None, None, [], - 'ci', '-m', 'mod psi', wc_dir) + sbox.simple_commit(message='mod psi') # r8: Delete A/D/H/psi. svntest.actions.run_and_verify_svn(None, None, [], 'delete', psi_path) - svntest.actions.run_and_verify_svn(None, None, [], - 'ci', '-m', 'delete psi', wc_dir) + sbox.simple_commit(message='delete psi') # Update WC before merging so mergeinfo elision and inheritance # occur smoothly. @@ -13788,11 +13773,8 @@ def subtree_gets_changes_even_if_ultimat ['G ' + psi_COPY_path + '\n', ' G ' + psi_COPY_path + '\n',]), [], 'merge', '-c-7', sbox.repo_url + '/A/D/H/psi@7', psi_COPY_path) - svntest.actions.run_and_verify_svn(None, None, [], - 'ci', '-m', - 'merge -c3,7 from A/D/H,' \ - 'reverse merge -c-7 from A/D/H/psi', - wc_dir) + sbox.simple_commit(message='merge -c3,7 from A/D/H,' \ + 'reverse merge -c-7 from A/D/H/psi') # Merge all available revisions from A/D/H to A_COPY/D/H. This merge # ultimately tries to delete A_COPY/D/H/psi, but first it should merge Modified: subversion/branches/1.7.x/subversion/tests/cmdline/svntest/sandbox.py URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/tests/cmdline/svntest/sandbox.py?rev=1242662&r1=1242661&r2=1242662&view=diff ============================================================================== --- subversion/branches/1.7.x/subversion/tests/cmdline/svntest/sandbox.py (original) +++ subversion/branches/1.7.x/subversion/tests/cmdline/svntest/sandbox.py Fri Feb 10 04:00:30 2012 @@ -204,16 +204,18 @@ class Sandbox: target = self.ospath(target) svntest.main.run_svn(False, 'switch', url, target, '--ignore-ancestry') - def simple_commit(self, target=None): - """Commit the WC or TARGET with a default log message. + def simple_commit(self, target=None, message=None): + """Commit the WC or TARGET, with a default or supplied log message. + Raise if the exit code is non-zero or there is output on stderr. TARGET is a relpath relative to the WC.""" assert not self.read_only if target is None: target = self.wc_dir else: target = self.ospath(target) - svntest.main.run_svn(False, 'commit', - '-m', svntest.main.make_log_msg(), + if message is None: + message = svntest.main.make_log_msg() + svntest.main.run_svn(False, 'commit', '-m', message, target) def simple_rm(self, *targets):