You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2015/09/10 15:37:20 UTC
svn commit: r1702247 - in /subversion/trunk/subversion: libsvn_wc/wc_db.c
tests/cmdline/update_tests.py
Author: rhuijben
Date: Thu Sep 10 13:37:19 2015
New Revision: 1702247
URL: http://svn.apache.org/r1702247
Log:
Resolve a segfault on an incoming delete of an ancestor of a switched path
in a tree with other changes.
Found by: TortoiseSVN dump
ivan
(Reproduction recipe and patch by me)
* subversion/libsvn_wc/wc_db.c
(make_copy_txn): Properly detect a switched tree in all cases.
* subversion/tests/cmdline/update_tests.py
(update_delete_switched): New function.
(test_list): Add update_delete_switched.
Modified:
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/tests/cmdline/update_tests.py
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1702247&r1=1702246&r2=1702247&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Sep 10 13:37:19 2015
@@ -15137,7 +15137,7 @@ make_copy_txn(svn_wc__db_wcroot_t *wcroo
const char *name = svn_relpath_skip_ancestor(last_repos_relpath,
repos_relpath);
- if (strcmp(name, svn_relpath_basename(local_relpath, NULL)) == 0)
+ if (name && strcmp(name, svn_relpath_basename(local_relpath, NULL)) == 0)
op_depth = last_op_depth;
}
Modified: subversion/trunk/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/update_tests.py?rev=1702247&r1=1702246&r2=1702247&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/update_tests.py Thu Sep 10 13:37:19 2015
@@ -6774,6 +6774,47 @@ def missing_tmp_update(sbox):
svntest.actions.run_and_verify_update(wc_dir, None, None, None, [], False,
wc_dir, '--set-depth', 'infinity')
+def update_delete_switched(sbox):
+ "update delete switched"
+
+ sbox.build(read_only = True)
+ wc_dir = sbox.wc_dir
+
+ svntest.actions.run_and_verify_switch(wc_dir, sbox.ospath('A/B/E'),
+ sbox.repo_url + '/A/D/G',
+ None, None, None, [], False,
+ '--ignore-ancestry')
+
+ # Introduce some change somewhere...
+ sbox.simple_propset('A', 'A', 'A')
+
+ expected_status = svntest.wc.State(wc_dir, {
+ '' : Item(status=' ', wc_rev='1'),
+ 'A' : Item(status='A ', copied='+', treeconflict='C', wc_rev='-'),
+ 'A/B' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/B/E' : Item(status='A ', copied='+', wc_rev='-'),
+ 'A/B/E/rho' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/B/E/pi' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/B/E/tau' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/B/lambda' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/B/F' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/D' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/D/G' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/D/G/pi' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/D/G/tau' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/D/G/rho' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/D/gamma' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/D/H' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/D/H/omega' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/D/H/psi' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/D/H/chi' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/mu' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/C' : Item(status=' ', copied='+', wc_rev='-'),
+ 'iota' : Item(status=' ', wc_rev='1'),
+ })
+ svntest.actions.run_and_verify_update(wc_dir, None, None, expected_status,
+ [], False, sbox.ospath('A'), '-r', 0)
+
#######################################################################
# Run the tests
@@ -6863,6 +6904,7 @@ test_list = [ None,
update_keywords_on_shortcut,
update_add_conflicted_deep,
missing_tmp_update,
+ update_delete_switched,
]
if __name__ == '__main__':