Author: rhuijben
Date: Tue Feb 24 15:25:58 2015
New Revision: 1661983
URL: http://svn.apache.org/r1661983
Log:
Create '1.9.x-crop-safety' branch based of the '1.9.x-update-tc-detection'
branch.
This branch makes 'svn --set-depth X' keep your local changes, if there
were any in X. Before this it would keep them if 'X' was modified, but
not if only a descendant was.
* subversion/libsvn_wc/crop.c (1491756,1661580,1661585,1661589,1661591,1661682)
(crop_children): Rename pool. Walk only BASE children. Only delete
if the only change in the tree is a delete. Otherwise recurse
on children with depth empty. Use svn_wc__db_base_remove() as
we don't want to touch WORKING.
(svn_wc_exclude): Check tree for changes before marking it excluded.
Crop children if not allowed. Use svn_wc__db_base_remove() as
we don't want to touch WORKING.
* subversion/libsvn_wc/externals.c
(svn_wc__external_remove): Update caller. (r1661580)
* subversion/libsvn_wc/update_editor.c
(delete_entry): Update caller *3. (r1661580)
(close_edit): Update caller. (r1661580)
* subversion/libsvn_wc/wc-queries.sql
(STMT_UPDATE_NODE_BASE_DEPTH): Verify presence. (r1661585)
* subversion/libsvn_wc/wc_db.c
(db_base_remove): Remove unneeded remove_locks. Allow adding excluded.
(r1661580,1661584,1661591)
(svn_wc__db_base_remove): Allow adding excluded. Update caller.(r1661580)
(bump_node_revision): Use the only bit of code needed from db_base_remove
directly. (r1661580,1661584)
(process_committed_leaf): Move a tiny bit of code from db_base_remove here
until it is completely removed by the 1.9.x-commit-fixes branch.
Update caller. (r1661580, and tweaks)
* subversion/libsvn_wc/wc_db.h
(svn_wc__db_base_remove): Update arguments. Update docs. (r1661580)
* subversion/libsvn_wc/workqueue.c
(run_base_remove): Update caller. (r1661580)
* subversion/tests/cmdline/depth_tests.py (r1661585)
(fold_tree_with_unversioned_modified_items): Update expected results.
* subversion/tests/libsvn_wc/op-depth-test.c
(base_dir_insert_remove): Update caller. (r1661580)
Added:
subversion/branches/1.9.x-crop-safety/ (props changed)
- copied from r1661977, subversion/branches/1.9.x-update-tc-detection/
Modified:
subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/crop.c
subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/externals.c
subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/update_editor.c
subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/wc-queries.sql
subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/wc_db.c
subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/wc_db.h
subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/workqueue.c
subversion/branches/1.9.x-crop-safety/subversion/tests/cmdline/depth_tests.py
subversion/branches/1.9.x-crop-safety/subversion/tests/libsvn_wc/op-depth-test.c
Propchange: subversion/branches/1.9.x-crop-safety/
------------------------------------------------------------------------------
--- bugtraq:logregex (added)
+++ bugtraq:logregex Tue Feb 24 15:25:58 2015
@@ -0,0 +1,2 @@
+[Ii]ssues?:?(\s*(,|and)?\s*#\d+)+
+(\d+)
Propchange: subversion/branches/1.9.x-crop-safety/
------------------------------------------------------------------------------
bugtraq:url = http://subversion.tigris.org/issues/show_bug.cgi?id=%BUGID%
Propchange: subversion/branches/1.9.x-crop-safety/
------------------------------------------------------------------------------
--- svn:auto-props (added)
+++ svn:auto-props Tue Feb 24 15:25:58 2015
@@ -0,0 +1,13 @@
+*.c = svn:eol-style=native
+*.cpp = svn:eol-style=native
+*.h = svn:eol-style=native
+*.hpp = svn:eol-style=native
+*.java = svn:eol-style=native
+*.py = svn:eol-style=native
+*.pl = svn:eol-style=native
+*.rb = svn:eol-style=native
+*.sql = svn:eol-style=native
+*.txt = svn:eol-style=native
+README = svn:eol-style=native
+BRANCH-README = svn:eol-style=native
+STATUS = svn:eol-style=native
Propchange: subversion/branches/1.9.x-crop-safety/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Feb 24 15:25:58 2015
@@ -0,0 +1,57 @@
+ChangeLog*
+Makefile
+config.cache
+config.log
+config.nice
+config.status
+configure
+libtool
+.gdb_history
+.swig_checked
+*.orig
+*.rej
+TAGS
+tags
+neon
+build-outputs.mk
+autogen-standalone.mk
+autom4te.cache
+gen-make.opts
+tests.log*
+fails.log*
+db4-win32
+db
+*.o
+*~
+.*~
+apr
+apr-util
+apr-iconv
+Release
+Debug
+ipch
+subversion_msvc.dsw
+subversion_msvc.ncb
+subversion_msvc.opt
+subversion_msvc.plg
+subversion_vcnet.sln
+subversion_vcnet.ncb
+subversion_vcnet.suo
+subversion_vcnet.v11.suo
+subversion_vcnet.sdf
+subversion_vcnet.opensdf
+mkmf.log
+.project
+.classpath
+.cdtproject
+.settings
+.cproject
+zlib
+sqlite-amalgamation
+serf
+gmock-fused
+.git
+.gitignore
+compile_commands.json
+.kdev4
+*.kdev4
Propchange: subversion/branches/1.9.x-crop-safety/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Feb 24 15:25:58 2015
@@ -0,0 +1,92 @@
+/subversion/branches/1.5.x-r30215:870312
+/subversion/branches/1.7.x-fs-verify:1146708,1161180
+/subversion/branches/10Gb:1388102,1388163-1388190,1388195,1388202,1388205,1388211,1388276,1388362,1388375,1388394,1388636,1388639-1388640,1388643-1388644,1388654,1388720,1388789,1388795,1388801,1388805,1388807,1388810,1388816,1389044,1389276,1389289,1389662,1389867,1390017,1390209,1390216,1390407,1390409,1390414,1390419,1390955
+/subversion/branches/atomic-revprop:965046-1000689
+/subversion/branches/authzperf:1615360
+/subversion/branches/auto-props-sdc:1384106-1401643
+/subversion/branches/bdb-reverse-deltas:872050-872529
+/subversion/branches/cache-server:1458643-1476567
+/subversion/branches/diff-callbacks3:870059-870761
+/subversion/branches/diff-optimizations:1031270-1037352
+/subversion/branches/diff-optimizations-bytes:1037353-1067789
+/subversion/branches/dont-save-plaintext-passwords-by-default:870728-871118
+/subversion/branches/double-delete:870511-872970
+/subversion/branches/dump-load-cross-check:1654853-1657295
+/subversion/branches/ev2-export:1325914,1332738,1413107
+/subversion/branches/explore-wc:875486,875493,875497,875507,875511,875514,875559,875580-875581,875584,875587,875611,875627,875647,875667-875668,875711-875712,875733-875734,875736,875744-875748,875751,875758,875782,875795-875796,875830,875836,875838,875842,875852,875855,875864,875870,875873,875880,875885-875888,875890,875897-875898,875905,875907-875909,875935,875943-875944,875946,875979,875982-875983,875985-875986,875990,875997
+/subversion/branches/file-externals:871779-873302
+/subversion/branches/fs-rep-sharing:869036-873803
+/subversion/branches/fsfs-format7:1426304,1430673,1433848,1438408,1438982,1441129,1442051,1442068,1442504,1442910,1443171,1443803,1444690,1444693,1444695,1445040,1445080,1446103,1451129,1453590,1454307,1460579,1461851,1461865,1462837,1462904,1463120,1467362,1467382,1469487,1471208,1477166,1478055,1481447,1489817,1489949,1490673-1490674,1491784,1493042,1498029,1498103,1498155,1500054,1507729-1507731,1507735-1507736
+/subversion/branches/fsfs-improvements:1499981-1547039
+/subversion/branches/fsfs-lock-many:1571740-1577217
+/subversion/branches/fsfs-pack:873717-874575
+/subversion/branches/fsx:1507845-1509914
+/subversion/branches/fsx-id:1645603-1649011
+/subversion/branches/gnome-keyring:870558-871410
+/subversion/branches/gpg-agent-password-store:1005036-1150766
+/subversion/branches/gtest_addition:1452117-1502138
+/subversion/branches/http-protocol-v2:874395-876041
+/subversion/branches/in-memory-cache:869829-871452
+/subversion/branches/in-repo-authz:1414342-1424779
+/subversion/branches/inheritable-props:1297080-1395089
+/subversion/branches/integrate-cache-item-serialization:1068724-1068739
+/subversion/branches/integrate-cache-membuffer:998649-998852
+/subversion/branches/integrate-compression-level:1068651-1072287
+/subversion/branches/integrate-io-improvements:1068684-1072297
+/subversion/branches/integrate-is-cachable:1072568-1074082
+/subversion/branches/integrate-partial-getter:1072558-1076552
+/subversion/branches/integrate-readline-speedup:1072553-1072555
+/subversion/branches/integrate-stream-api-extensions:1068695-1072516
+/subversion/branches/integrate-string-improvements:1068251-1190617
+/subversion/branches/integrate-txdelta-caching:1072541-1078213
+/subversion/branches/issue-2779-dev:965496-984198
+/subversion/branches/issue-2843-dev:871432-874179
+/subversion/branches/issue-3000:871713,871716-871719,871721-871726,871728,871734
+/subversion/branches/issue-3067-deleted-subtrees:873375-874084
+/subversion/branches/issue-3148-dev:875193-875204
+/subversion/branches/issue-3220-dev:872210-872226
+/subversion/branches/issue-3242-dev:879653-896436
+/subversion/branches/issue-3334-dirs:875156-875867
+/subversion/branches/issue-3975:1152931-1160746
+/subversion/branches/issue-4116-dev:1424719-1425040
+/subversion/branches/issue-4194-dev:1410507-1414880
+/subversion/branches/javahl-ra:991978-1494640
+/subversion/branches/kwallet:870785-871314
+/subversion/branches/log-addressing:1509279-1546844
+/subversion/branches/log-g-performance:870941-871032
+/subversion/branches/merge-skips-obstructions:874525-874615
+/subversion/branches/move-tracking-2:1607334
+/subversion/branches/multi-layer-moves:1239019-1300930
+/subversion/branches/nfc-nfd-aware-client:870276,870376
+/subversion/branches/node_pool:1304828-1305388
+/subversion/branches/performance:979193,980118,981087,981090,981189,981194,981287,981684,981827,982043,982355,983398,983406,983430,983474,983488,983490,983760,983764,983766,983770,984927,984973,984984,985014,985037,985046,985472,985477,985482,985487-985488,985493,985497,985500,985514,985601,985603,985606,985669,985673,985695,985697,986453,986465,986485,986491-986492,986517,986521,986605,986608,986817,986832,987865,987868-987869,987872,987886-987888,987893,988319,988898,990330,990533,990535-990537,990541,990568,990572,990574-990575,990600,990759,992899,992904,992911,993127,993141,994956,995478,995507,995603,998012,998858,999098,1001413,1001417,1004291,1022668,1022670,1022676,1022715,1022719,1025660,1025672,1027193,1027203,1027206,1027214,1027227,1028077,1028092,1028094,1028104,1028107,1028111,1028354,1029038,1029042-1029043,1029054-1029055,1029062-1029063,1029078,1029080,1029090,1029092-1029093,1029111,1029151,1029158,1029229-1029230,1029232,1029335-1029336,1029339-1029340,1029342,10
29344,1030763,1030827,1031203,1031235,1032285,1032333,1033040,1033057,1033294,1035869,1035882,1039511,1043705,1053735,1056015,1066452,1067683,1067697-1078365
+/subversion/branches/pin-externals:1643757-1659392
+/subversion/branches/py-tests-as-modules:956579-1033052
+/subversion/branches/ra_serf-digest-authn:875693-876404
+/subversion/branches/reintegrate-improvements:873853-874164
+/subversion/branches/remote-only-status:1581845-1586090
+/subversion/branches/revprop-cache:1298521-1326293
+/subversion/branches/revprop-caching-ng:1620597,1620599
+/subversion/branches/revprop-packing:1143907,1143971,1143997,1144017,1144499,1144568,1146145
+/subversion/branches/subtree-mergeinfo:876734-878766
+/subversion/branches/svn-auth-x509:1603509-1655900
+/subversion/branches/svn-info-detail:1660035-1660413
+/subversion/branches/svn-mergeinfo-enhancements:870119-870195,870197-870288
+/subversion/branches/svn-patch-improvements:918519-934609
+/subversion/branches/svn_mutex:1141683-1182099
+/subversion/branches/svnpatch-diff:865738-876477
+/subversion/branches/svnraisetc:874709-875149
+/subversion/branches/svnserve-logging:869828-870893
+/subversion/branches/tc-issue-3334:874697-874773
+/subversion/branches/tc-merge-notify:874017-874062
+/subversion/branches/tc-resolve:874191-874239
+/subversion/branches/tc_url_rev:874351-874483
+/subversion/branches/tree-conflicts:868291-873154
+/subversion/branches/tree-conflicts-notify:873926-874008
+/subversion/branches/tristate-chunked-request:1502394-1502681
+/subversion/branches/tweak-build-take-two:1424288-1425049,1425051-1425613
+/subversion/branches/uris-as-urls:1060426-1064427
+/subversion/branches/verify-at-commit:1462039-1462408
+/subversion/branches/verify-keep-going:1439280-1546110
+/subversion/branches/wc-collate-path:1402685-1480384
+/subversion/trunk:1660587,1660610,1660633,1660641,1660659,1660671,1660687,1660758,1660874,1660928,1660955,1660961,1661570,1661580,1661584-1661585,1661589,1661654,1661664,1661669,1661673,1661695,1661698,1661890
Propchange: subversion/branches/1.9.x-crop-safety/
------------------------------------------------------------------------------
tsvn:logwidthmarker = 78
Propchange: subversion/branches/1.9.x-crop-safety/
------------------------------------------------------------------------------
webviewer:revision = http://svn.apache.org/r%REVISION%
Modified: subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/crop.c
URL:
http://svn.apache.org/viewvc/subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/crop.c?rev=1661983&r1=1661977&r2=1661983&view=diff
==============================================================================
--- subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/crop.c (original)
+++ subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/crop.c Tue Feb
24 15:25:58 2015
@@ -53,7 +53,7 @@ crop_children(svn_wc__db_t *db,
void *notify_baton,
svn_cancel_func_t cancel_func,
void *cancel_baton,
- apr_pool_t *pool)
+ apr_pool_t *scratch_pool)
{
const apr_array_header_t *children;
apr_pool_t *iterpool;
@@ -65,7 +65,7 @@ crop_children(svn_wc__db_t *db,
if (cancel_func)
SVN_ERR(cancel_func(cancel_baton));
- iterpool = svn_pool_create(pool);
+ iterpool = svn_pool_create(scratch_pool);
if (dir_depth == svn_depth_unknown)
dir_depth = svn_depth_infinity;
@@ -76,8 +76,8 @@ crop_children(svn_wc__db_t *db,
iterpool));
/* Looping over current directory's SVN entries: */
- SVN_ERR(svn_wc__db_read_children(&children, db, local_abspath, pool,
- iterpool));
+ SVN_ERR(svn_wc__db_base_get_children(&children, db, local_abspath,
+ scratch_pool, iterpool));
for (i = 0; i < children->nelts; i++)
{
@@ -86,6 +86,8 @@ crop_children(svn_wc__db_t *db,
svn_wc__db_status_t child_status;
svn_node_kind_t kind;
svn_depth_t child_depth;
+ svn_boolean_t have_work;
+ svn_depth_t remove_below;
svn_pool_clear(iterpool);
@@ -96,86 +98,81 @@ crop_children(svn_wc__db_t *db,
NULL,NULL, NULL, NULL, &child_depth,
NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, &have_work,
db, child_abspath, iterpool, iterpool));
- if (child_status == svn_wc__db_status_server_excluded ||
- child_status == svn_wc__db_status_excluded ||
- child_status == svn_wc__db_status_not_present)
+ if (have_work)
+ {
+ svn_boolean_t modified, all_deletes;
+
+ if (child_status != svn_wc__db_status_deleted)
+ continue; /* Leave local additions alone */
+
+ SVN_ERR(svn_wc__node_has_local_mods(&modified, &all_deletes,
+ db, child_abspath,
+ cancel_func, cancel_baton,
+ iterpool));
+
+ if (modified && !all_deletes)
+ continue; /* Something interesting is still there */
+ }
+
+ remove_below = (kind == svn_node_dir)
+ ? svn_depth_immediates
+ : svn_depth_files;
+
+ if ((child_status == svn_wc__db_status_server_excluded ||
+ child_status == svn_wc__db_status_excluded ||
+ child_status == svn_wc__db_status_not_present))
{
- svn_depth_t remove_below = (kind == svn_node_dir)
- ? svn_depth_immediates
- : svn_depth_files;
if (new_depth < remove_below)
SVN_ERR(svn_wc__db_base_remove(db, child_abspath,
FALSE /* keep_as_working */,
FALSE /* queue_deletes */,
- FALSE /* remove_locks */,
+ FALSE, FALSE,
SVN_INVALID_REVNUM,
NULL, NULL, iterpool));
- continue;
+ continue; /* No recurse */
}
- else if (kind == svn_node_file)
+
+ if (new_depth < remove_below)
{
- if (new_depth == svn_depth_empty)
- SVN_ERR(svn_wc__db_op_remove_node(NULL,
+ svn_boolean_t modified, all_deletes;
+
+ SVN_ERR(svn_wc__node_has_local_mods(&modified, &all_deletes,
db, child_abspath,
- TRUE /* destroy */,
- FALSE /* destroy_changes */,
- SVN_INVALID_REVNUM,
- svn_wc__db_status_not_present,
- svn_node_none,
- NULL, NULL,
cancel_func, cancel_baton,
iterpool));
- else
- continue;
- }
- else if (kind == svn_node_dir)
- {
- if (new_depth < svn_depth_immediates)
- {
- SVN_ERR(svn_wc__db_op_remove_node(NULL,
- db, child_abspath,
- TRUE /* destroy */,
- FALSE /* destroy_changes */,
- SVN_INVALID_REVNUM,
- svn_wc__db_status_not_present,
- svn_node_none,
- NULL, NULL,
- cancel_func, cancel_baton,
- iterpool));
- }
- else
+ if (!modified || all_deletes)
{
- SVN_ERR(crop_children(db,
- child_abspath,
- child_depth,
- svn_depth_empty,
- notify_func,
- notify_baton,
- cancel_func,
- cancel_baton,
- iterpool));
- continue;
+ SVN_ERR(svn_wc__db_base_remove(db, child_abspath,
+ FALSE, TRUE, FALSE, FALSE,
+ SVN_INVALID_REVNUM,
+ NULL, NULL, iterpool));
+ if (notify_func)
+ {
+ svn_wc_notify_t *notify;
+ notify = svn_wc_create_notify(child_abspath,
+ svn_wc_notify_delete,
+ iterpool);
+ (*notify_func)(notify_baton, notify, iterpool);
+ }
+
+ continue; /* No recurse */
}
- }
- else
- {
- return svn_error_createf
- (SVN_ERR_NODE_UNKNOWN_KIND, NULL, _("Unknown node kind for '%s'"),
- svn_dirent_local_style(child_abspath, iterpool));
+
+ /* Fall through: recurse:*/
}
- if (notify_func)
+ if (kind == svn_node_dir)
{
- svn_wc_notify_t *notify;
- notify = svn_wc_create_notify(child_abspath,
- svn_wc_notify_delete,
- iterpool);
- (*notify_func)(notify_baton, notify, iterpool);
+ SVN_ERR(crop_children(db, child_abspath,
+ child_depth, svn_depth_empty,
+ notify_func, notify_baton,
+ cancel_func, cancel_baton,
+ iterpool));
}
}
@@ -197,6 +194,8 @@ svn_wc_exclude(svn_wc_context_t *wc_ctx,
svn_wc__db_status_t status;
svn_node_kind_t kind;
svn_revnum_t revision;
+ svn_depth_t depth;
+ svn_boolean_t modified, all_deletes;
const char *repos_relpath, *repos_root, *repos_uuid;
SVN_ERR(svn_wc__db_is_switched(&is_root, &is_switched, NULL,
@@ -221,7 +220,7 @@ svn_wc_exclude(svn_wc_context_t *wc_ctx,
SVN_ERR(svn_wc__db_read_info(&status, &kind, &revision, &repos_relpath,
&repos_root, &repos_uuid, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ &depth, NULL, NULL, NULL, NULL, NULL, NULL,
NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL,
wc_ctx->db, local_abspath,
@@ -258,29 +257,41 @@ svn_wc_exclude(svn_wc_context_t *wc_ctx,
break; /* Ok to exclude */
}
- /* Remove all working copy data below local_abspath */
- SVN_ERR(svn_wc__db_op_remove_node(NULL,
- wc_ctx->db, local_abspath,
- TRUE /* destroy */,
- FALSE /* destroy_changes */,
- revision,
- svn_wc__db_status_excluded,
- kind,
- NULL, NULL,
- cancel_func, cancel_baton,
- scratch_pool));
-
- SVN_ERR(svn_wc__wq_run(wc_ctx->db, local_abspath,
- cancel_func, cancel_baton,
- scratch_pool));
-
- if (notify_func)
- {
- svn_wc_notify_t *notify;
- notify = svn_wc_create_notify(local_abspath,
- svn_wc_notify_exclude,
- scratch_pool);
- notify_func(notify_baton, notify, scratch_pool);
+ SVN_ERR(svn_wc__node_has_local_mods(&modified, &all_deletes,
+ wc_ctx->db, local_abspath,
+ cancel_func, cancel_baton,
+ scratch_pool));
+
+ if (!modified || all_deletes)
+ {
+ /* Remove all working copy data below local_abspath */
+ SVN_ERR(svn_wc__db_base_remove(wc_ctx->db, local_abspath,
+ FALSE /* keep_working */,
+ TRUE, FALSE, TRUE,
+ revision,
+ NULL, NULL,
+ scratch_pool));
+
+ SVN_ERR(svn_wc__wq_run(wc_ctx->db, local_abspath,
+ cancel_func, cancel_baton,
+ scratch_pool));
+
+ if (notify_func)
+ {
+ svn_wc_notify_t *notify;
+ notify = svn_wc_create_notify(local_abspath,
+ svn_wc_notify_exclude,
+ scratch_pool);
+ notify_func(notify_baton, notify, scratch_pool);
+ }
+ }
+ else
+ {
+ /* Do the next best thing: retry below this path */
+ SVN_ERR(crop_children(wc_ctx->db, local_abspath, depth, svn_depth_empty,
+ notify_func, notify_baton,
+ cancel_func, cancel_baton,
+ scratch_pool));
}
return SVN_NO_ERROR;
Modified: subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/externals.c
URL:
http://svn.apache.org/viewvc/subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/externals.c?rev=1661983&r1=1661977&r2=1661983&view=diff
==============================================================================
--- subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/externals.c
(original)
+++ subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/externals.c Tue
Feb 24 15:25:58 2015
@@ -1498,7 +1498,7 @@ svn_wc__external_remove(svn_wc_context_t
SVN_ERR(svn_wc__db_base_remove(wc_ctx->db, local_abspath,
FALSE /* keep_as_working */,
TRUE /* queue_deletes */,
- FALSE /* remove_locks */,
+ FALSE, FALSE,
SVN_INVALID_REVNUM,
NULL, NULL, scratch_pool));
SVN_ERR(svn_wc__wq_run(wc_ctx->db, local_abspath,
Modified:
subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/update_editor.c
URL:
http://svn.apache.org/viewvc/subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/update_editor.c?rev=1661983&r1=1661977&r2=1661983&view=diff
==============================================================================
--- subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/update_editor.c
(original)
+++ subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/update_editor.c
Tue Feb 24 15:25:58 2015
@@ -1816,7 +1816,7 @@ delete_entry(const char *path,
SVN_ERR(svn_wc__db_base_remove(eb->db, local_abspath,
FALSE /* keep_as_working */,
FALSE /* queue_deletes */,
- FALSE /* remove_locks */,
+ FALSE, FALSE,
SVN_INVALID_REVNUM /* not_present_rev */,
NULL, NULL,
scratch_pool));
@@ -1916,7 +1916,8 @@ delete_entry(const char *path,
{
/* Delete, and do not leave a not-present node. */
SVN_ERR(svn_wc__db_base_remove(eb->db, local_abspath,
- keep_as_working, queue_deletes, FALSE,
+ keep_as_working, queue_deletes,
+ FALSE, FALSE,
SVN_INVALID_REVNUM /* not_present_rev */,
tree_conflict, NULL,
scratch_pool));
@@ -1925,7 +1926,8 @@ delete_entry(const char *path,
{
/* Delete, leaving a not-present node. */
SVN_ERR(svn_wc__db_base_remove(eb->db, local_abspath,
- keep_as_working, queue_deletes, FALSE,
+ keep_as_working, queue_deletes,
+ TRUE, FALSE,
*eb->target_revision,
tree_conflict, NULL,
scratch_pool));
@@ -4875,7 +4877,7 @@ close_edit(void *edit_baton,
SVN_ERR(svn_wc__db_base_remove(eb->db, eb->target_abspath,
FALSE /* keep_as_working */,
FALSE /* queue_deletes */,
- FALSE /* remove_locks */,
+ FALSE, FALSE,
SVN_INVALID_REVNUM,
NULL, NULL, scratch_pool));
}
Modified:
subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/wc-queries.sql
URL:
http://svn.apache.org/viewvc/subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/wc-queries.sql?rev=1661983&r1=1661977&r2=1661983&view=diff
==============================================================================
--- subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/wc-queries.sql
(original)
+++ subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/wc-queries.sql
Tue Feb 24 15:25:58 2015
@@ -838,6 +838,7 @@ WHERE wc_id = ?1
UPDATE nodes SET depth = ?3
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
AND kind=MAP_DIR
+ AND presence IN (MAP_NORMAL, MAP_INCOMPLETE)
-- STMT_UPDATE_NODE_BASE_PRESENCE
UPDATE nodes SET presence = ?3
Modified: subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/wc_db.c
URL:
http://svn.apache.org/viewvc/subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/wc_db.c?rev=1661983&r1=1661977&r2=1661983&view=diff
==============================================================================
--- subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/wc_db.c
(original)
+++ subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/wc_db.c Tue Feb
24 15:25:58 2015
@@ -2217,7 +2217,8 @@ db_base_remove(svn_wc__db_wcroot_t *wcro
svn_wc__db_t *db, /* For checking conflicts */
svn_boolean_t keep_as_working,
svn_boolean_t queue_deletes,
- svn_boolean_t remove_locks,
+ svn_boolean_t mark_not_present,
+ svn_boolean_t mark_excluded,
svn_revnum_t not_present_revision,
svn_skel_t *conflict,
svn_skel_t *work_items,
@@ -2228,26 +2229,17 @@ db_base_remove(svn_wc__db_wcroot_t *wcro
svn_wc__db_status_t status;
apr_int64_t repos_id;
const char *repos_relpath;
+ svn_revnum_t revision;
svn_node_kind_t kind;
svn_boolean_t keep_working;
- SVN_ERR(svn_wc__db_base_get_info_internal(&status, &kind, NULL,
+ SVN_ERR(svn_wc__db_base_get_info_internal(&status, &kind, &revision,
&repos_relpath, &repos_id,
NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL,
wcroot, local_relpath,
scratch_pool, scratch_pool));
- if (remove_locks)
- {
- svn_sqlite__stmt_t *lock_stmt;
-
- SVN_ERR(svn_sqlite__get_statement(&lock_stmt, wcroot->sdb,
- STMT_DELETE_LOCK_RECURSIVELY));
- SVN_ERR(svn_sqlite__bindf(lock_stmt, "is", repos_id, repos_relpath));
- SVN_ERR(svn_sqlite__step_done(lock_stmt));
- }
-
if (status == svn_wc__db_status_normal
&& keep_as_working)
{
@@ -2446,13 +2438,14 @@ db_base_remove(svn_wc__db_wcroot_t *wcro
SVN_ERR(svn_sqlite__step_done(stmt));
}
- if (SVN_IS_VALID_REVNUM(not_present_revision))
+ if (mark_not_present || mark_excluded)
{
struct insert_base_baton_t ibb;
blank_ibb(&ibb);
ibb.repos_id = repos_id;
- ibb.status = svn_wc__db_status_not_present;
+ ibb.status = mark_excluded ? svn_wc__db_status_excluded
+ : svn_wc__db_status_not_present;
ibb.kind = kind;
ibb.repos_relpath = repos_relpath;
ibb.revision = not_present_revision;
@@ -2480,7 +2473,8 @@ svn_wc__db_base_remove(svn_wc__db_t *db,
const char *local_abspath,
svn_boolean_t keep_as_working,
svn_boolean_t queue_deletes,
- svn_boolean_t remove_locks,
+ svn_boolean_t mark_not_present,
+ svn_boolean_t mark_excluded,
svn_revnum_t not_present_revision,
svn_skel_t *conflict,
svn_skel_t *work_items,
@@ -2497,7 +2491,8 @@ svn_wc__db_base_remove(svn_wc__db_t *db,
SVN_WC__DB_WITH_TXN(db_base_remove(wcroot, local_relpath,
db, keep_as_working, queue_deletes,
- remove_locks, not_present_revision,
+ mark_not_present, mark_excluded,
+ not_present_revision,
conflict, work_items, scratch_pool),
wcroot);
@@ -12059,11 +12054,12 @@ bump_node_revision(svn_wc__db_wcroot_t *
|| (child_info->status == svn_wc__db_status_server_excluded &&
child_info->revnum != new_rev))
{
- SVN_ERR(db_base_remove(wcroot,
- child_local_relpath,
- db, FALSE, FALSE, FALSE,
- SVN_INVALID_REVNUM,
- NULL, NULL, scratch_pool));
+ svn_sqlite__stmt_t *stmt;
+ SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+ STMT_DELETE_BASE_NODE));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id,
+ child_local_relpath));
+ SVN_ERR(svn_sqlite__step_done(stmt));
continue;
}
@@ -16188,13 +16184,30 @@ process_committed_leaf(svn_wc__db_t *db,
if (status == svn_wc__db_status_deleted)
{
+ if (remove_lock) /* From base_remove. Removed in 1.9.x-commit-fixes */
+ {
+ svn_sqlite__stmt_t *lock_stmt;
+ const char *repos_relpath;
+ apr_int64_t repos_id;
+
+ SVN_ERR(svn_wc__db_base_get_info_internal(NULL, NULL, NULL,
+ &repos_relpath, &repos_id,
+ NULL, NULL, NULL, NULL,
NULL,
+ NULL, NULL, NULL, NULL,
NULL,
+ wcroot, local_relpath,
+ scratch_pool,
scratch_pool));
+
+ SVN_ERR(svn_sqlite__get_statement(&lock_stmt, wcroot->sdb,
+ STMT_DELETE_LOCK_RECURSIVELY));
+ SVN_ERR(svn_sqlite__bindf(lock_stmt, "is", repos_id, repos_relpath));
+ SVN_ERR(svn_sqlite__step_done(lock_stmt));
+ }
return svn_error_trace(
db_base_remove(wcroot, local_relpath, db,
FALSE /* keep_as_working */,
FALSE /* queue_deletes */,
- TRUE /* remove_locks */,
- (! via_recurse)
- ? new_revnum : SVN_INVALID_REVNUM,
+ !via_recurse, FALSE,
+ new_revnum,
NULL, NULL,
scratch_pool));
}
Modified: subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/wc_db.h
URL:
http://svn.apache.org/viewvc/subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/wc_db.h?rev=1661983&r1=1661977&r2=1661983&view=diff
==============================================================================
--- subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/wc_db.h
(original)
+++ subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/wc_db.h Tue Feb
24 15:25:58 2015
@@ -702,12 +702,11 @@ svn_wc__db_base_add_not_present_node(svn
(With KEEP_AS_WORKING TRUE, this is a no-op, as everything is
automatically shadowed by the created copy)
- If REMOVE_LOCKS is TRUE, all locks of this node and any subnodes
- are also removed. This is to be done during commit of deleted nodes.
- If NOT_PRESENT_REVISION specifies a valid revision a not-present
- node is installed in BASE node with kind NOT_PRESENT_KIND after
- deleting.
+ If MARK_NOT_PRESENT or MARK_EXCLUDED is TRUE, install a marker
+ of the specified type at the root of the now removed tree, with
+ either the specified revision (or in case of SVN_INVALID_REVNUM)
+ the original revision.
If CONFLICT and/or WORK_ITEMS are passed they are installed as part
of the operation, after the work items inserted by the operation
@@ -718,7 +717,8 @@ svn_wc__db_base_remove(svn_wc__db_t *db,
const char *local_abspath,
svn_boolean_t keep_as_working,
svn_boolean_t queue_deletes,
- svn_boolean_t remove_locks,
+ svn_boolean_t mark_not_present,
+ svn_boolean_t mark_excluded,
svn_revnum_t not_present_revision,
svn_skel_t *conflict,
svn_skel_t *work_items,
Modified: subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/workqueue.c
URL:
http://svn.apache.org/viewvc/subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/workqueue.c?rev=1661983&r1=1661977&r2=1661983&view=diff
==============================================================================
--- subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/workqueue.c
(original)
+++ subversion/branches/1.9.x-crop-safety/subversion/libsvn_wc/workqueue.c Tue
Feb 24 15:25:58 2015
@@ -144,7 +144,7 @@ run_base_remove(work_item_baton_t *wqb,
SVN_ERR(svn_wc__db_base_remove(db, local_abspath,
FALSE /* keep_as_working */,
TRUE /* queue_deletes */,
- FALSE /* remove_locks */,
+ SVN_IS_VALID_REVNUM(not_present_rev), FALSE,
not_present_rev,
NULL, NULL, scratch_pool));
Modified:
subversion/branches/1.9.x-crop-safety/subversion/tests/cmdline/depth_tests.py
URL:
http://svn.apache.org/viewvc/subversion/branches/1.9.x-crop-safety/subversion/tests/cmdline/depth_tests.py?rev=1661983&r1=1661977&r2=1661983&view=diff
==============================================================================
---
subversion/branches/1.9.x-crop-safety/subversion/tests/cmdline/depth_tests.py
(original)
+++
subversion/branches/1.9.x-crop-safety/subversion/tests/cmdline/depth_tests.py
Tue Feb 24 15:25:58 2015
@@ -1955,22 +1955,29 @@ def fold_tree_with_unversioned_modified_
# Fold the A dir to empty, expect the modified & unversioned ones left
# unversioned rather than removed, along with paths to those items.
- # Even though the directory B and D is not deleted because of local
- # modificatoin or unversioned items, there will be only one notification at
- # B and D.
+ # Directories B and D won't be deleted, because that would remove their
+ # local modifications. Their unmodified descendants are deleted though.
expected_output = svntest.wc.State(wc_dir, {
- 'A/B' : Item(status='D '),
+ 'A/B/E' : Item(status='D '),
+ 'A/B/F' : Item(status='D '),
+ 'A/B/lambda' : Item(status='D '),
'A/C' : Item(status='D '),
- 'A/D' : Item(status='D '),
- 'A/mu' : Item(status='D '),
+ 'A/D/G/rho' : Item(status='D '),
+ 'A/D/G/tau' : Item(status='D '),
+ 'A/D/H' : Item(status='D '),
+ 'A/D/gamma' : Item(status='D '),
})
# unversioned items will be ignored in in the status tree, since the
# run_and_verify_update() function uses a quiet version of svn status
- # Dir A is still versioned, since the wc root is in depth-infinity
expected_status = svntest.wc.State(wc_dir, {
'' : Item(status=' ', wc_rev=1),
'iota' : Item(status=' ', wc_rev=1),
- 'A' : Item(status=' ', wc_rev=1)
+ 'A' : Item(status=' ', wc_rev=1),
+ 'A/D' : Item(status=' ', wc_rev='1'),
+ 'A/D/G' : Item(status=' ', wc_rev='1'),
+ 'A/D/G/pi' : Item(status='M ', wc_rev='1'),
+ 'A/B' : Item(status=' ', wc_rev='1'),
+ 'A/mu' : Item(status='M ', wc_rev='1'),
})
expected_disk = svntest.wc.State('', {
'iota' : Item(contents="This is the file 'iota'.\n"),
Modified:
subversion/branches/1.9.x-crop-safety/subversion/tests/libsvn_wc/op-depth-test.c
URL:
http://svn.apache.org/viewvc/subversion/branches/1.9.x-crop-safety/subversion/tests/libsvn_wc/op-depth-test.c?rev=1661983&r1=1661977&r2=1661983&view=diff
==============================================================================
---
subversion/branches/1.9.x-crop-safety/subversion/tests/libsvn_wc/op-depth-test.c
(original)
+++
subversion/branches/1.9.x-crop-safety/subversion/tests/libsvn_wc/op-depth-test.c
Tue Feb 24 15:25:58 2015
@@ -1319,7 +1319,7 @@ base_dir_insert_remove(svn_test__sandbox
SVN_ERR(svn_wc__db_base_remove(b->wc_ctx->db, dir_abspath,
FALSE /* keep_as_Working */,
FALSE /* queue_deletes */,
- FALSE /* remove_locks */,
+ FALSE, FALSE,
SVN_INVALID_REVNUM,
NULL, NULL, b->pool));
SVN_ERR(svn_wc__wq_run(b->wc_ctx->db, dir_abspath,