You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ne...@apache.org on 2011/09/08 04:52:26 UTC
svn commit: r1166505 - in /subversion/branches/1.7.x-issue4k: ./
subversion/libsvn_wc/copy.c subversion/libsvn_wc/wc-queries.sql
subversion/tests/cmdline/externals_tests.py
Author: neels
Date: Thu Sep 8 02:52:25 2011
New Revision: 1166505
URL: http://svn.apache.org/viewvc?rev=1166505&view=rev
Log:
1.7.x backport fix for issue #4000. Depends on r1164027!
Merge ^/subversion/trunk -c1164760 -c1166500 -c1164765
and add a missing line in externals_tests.py. Combined log:
Follow-up to r1135743: Omit file externals from WC->WC copy.
(Only recursion is affected. File externals passed as explicit copy sources
still result in first-class file nodes, copied from the external's URL.)
* subversion/libsvn_wc/copy.c
(copy_versioned_dir):
Use the correct path, CHILD_SRC_ABSPATH, to query externalness. Comment.
Avoids first-class file nodes in copy.
* subversion/libsvn_wc/wc-queries.sql
(STMT_SELECT_OP_DEPTH_CHILDREN):
Don't select file externals. Avoids incomplete nodes in copy.
* subversion/tests/cmdline/externals_tests.py
(commit_file_external):
New test. NOTE: this test depends on r1164027!
Modified:
subversion/branches/1.7.x-issue4k/ (props changed)
subversion/branches/1.7.x-issue4k/subversion/libsvn_wc/copy.c
subversion/branches/1.7.x-issue4k/subversion/libsvn_wc/wc-queries.sql
subversion/branches/1.7.x-issue4k/subversion/tests/cmdline/externals_tests.py
Propchange: subversion/branches/1.7.x-issue4k/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Sep 8 02:52:25 2011
@@ -62,4 +62,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,1147309,1147882,1148071,1148083,1148094,1148131,1148374,1148424,1148566,1148588,1148853,1148877,1148882,1148936,1149105,1149141,1149160,1149228,1149240,1149343,1149371-1149372,1149377,1149398,1149401,1149539,1149572,1149627,1149675,1149701,1149713,1150242,1150254,1150260-1150261,1150266,1150302,1150327,1150368,1150372,1150441,1150506,1150812,1150853,1151036,1151177,1151610,1151906,1151911,1152129,1152140,1152189-1152190,1152267,1152282,1152286,1152726,1152809,1153138,1153141,1153416,1153799,1153807,1153968,1154009,1154023,1154115,1154119,1154121,1154144,1154155,1154159,1154165,1154215,1154225,1154273,1154461,1154717-1154718,1154733,1154908,1154982,1155015,1155044,1155124,1155131,1155160,1155313,1155334,1155391,1155404,1156085,1156098,1156216,1156218,1156312,1156527,1156717,1156721,1156750,1156827,1156838,1157416,1158187,115
8193-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,1158924,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,1163792,1163953,1164517,1164535,1164554,1164580,1164645
+/subversion/trunk:1146013,1146121,1146219,1146222,1146274,1146492,1146555,1146606,1146620,1146684,1146781,1146832,1146834,1146870,1146899,1146904,1147293,1147309,1147882,1148071,1148083,1148094,1148131,1148374,1148424,1148566,1148588,1148853,1148877,1148882,1148936,1149105,1149141,1149160,1149228,1149240,1149343,1149371-1149372,1149377,1149398,1149401,1149539,1149572,1149627,1149675,1149701,1149713,1150242,1150254,1150260-1150261,1150266,1150302,1150327,1150368,1150372,1150441,1150506,1150812,1150853,1151036,1151177,1151610,1151906,1151911,1152129,1152140,1152189-1152190,1152267,1152282,1152286,1152726,1152809,1153138,1153141,1153416,1153799,1153807,1153968,1154009,1154023,1154115,1154119,1154121,1154144,1154155,1154159,1154165,1154215,1154225,1154273,1154461,1154717-1154718,1154733,1154908,1154982,1155015,1155044,1155124,1155131,1155160,1155313,1155334,1155391,1155404,1156085,1156098,1156216,1156218,1156312,1156527,1156717,1156721,1156750,1156827,1156838,1157416,1158187,115
8193-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,1158924,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,1163792,1163953,1164517,1164535,1164554,1164580,1164645,1164760,1164765,1166500
Modified: subversion/branches/1.7.x-issue4k/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-issue4k/subversion/libsvn_wc/copy.c?rev=1166505&r1=1166504&r2=1166505&view=diff
==============================================================================
--- subversion/branches/1.7.x-issue4k/subversion/libsvn_wc/copy.c (original)
+++ subversion/branches/1.7.x-issue4k/subversion/libsvn_wc/copy.c Thu Sep 8 02:52:25 2011
@@ -437,14 +437,14 @@ copy_versioned_dir(svn_wc__db_t *db,
svn_boolean_t skip = FALSE;
/* We should skip this node if this child is a file external
- (issue #3589) */
+ (issues #3589, #4000) */
if (child_status == svn_wc__db_status_normal)
{
SVN_ERR(svn_wc__db_base_get_info(NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, &skip,
- db, src_abspath,
+ db, child_src_abspath,
scratch_pool,
scratch_pool));
}
Modified: subversion/branches/1.7.x-issue4k/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-issue4k/subversion/libsvn_wc/wc-queries.sql?rev=1166505&r1=1166504&r2=1166505&view=diff
==============================================================================
--- subversion/branches/1.7.x-issue4k/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/1.7.x-issue4k/subversion/libsvn_wc/wc-queries.sql Thu Sep 8 02:52:25 2011
@@ -165,6 +165,7 @@ VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8,
-- STMT_SELECT_OP_DEPTH_CHILDREN
SELECT local_relpath FROM nodes
WHERE wc_id = ?1 AND parent_relpath = ?2 AND op_depth = ?3
+ AND (?3 != 0 OR file_external is NULL)
-- STMT_SELECT_GE_OP_DEPTH_CHILDREN
SELECT 1 FROM nodes
Modified: subversion/branches/1.7.x-issue4k/subversion/tests/cmdline/externals_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-issue4k/subversion/tests/cmdline/externals_tests.py?rev=1166505&r1=1166504&r2=1166505&view=diff
==============================================================================
--- subversion/branches/1.7.x-issue4k/subversion/tests/cmdline/externals_tests.py (original)
+++ subversion/branches/1.7.x-issue4k/subversion/tests/cmdline/externals_tests.py Thu Sep 8 02:52:25 2011
@@ -1884,6 +1884,166 @@ def exclude_externals(sbox):
None, None, None, None, False,
'--set-depth', 'infinity', wc_dir)
+from svntest import verify, actions, main
+
+@Issue(3589, 4000)
+def copy_file_externals(sbox):
+ "a WC->WC copy should exclude file externals"
+
+ # svntest.factory.make(sbox,"""
+ # svn mkdir X
+ # svn ps svn:externals "^/iota xiota" X
+ # """)
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ X = os.path.join(wc_dir, 'X')
+
+ # svn mkdir X
+ expected_stdout = ['A ' + X + '\n']
+
+ actions.run_and_verify_svn2('OUTPUT', expected_stdout, [], 0, 'mkdir', X)
+
+ # svn ps svn:externals "^/iota xiota" X
+ expected_stdout = ["property 'svn:externals' set on '" + X + "'\n"]
+
+ actions.run_and_verify_svn2('OUTPUT', expected_stdout, [], 0, 'ps',
+ 'svn:externals', '''
+ ^/iota xiota
+ ^/A/mu xmu
+ ''', X)
+
+ # svntest.factory.make(sbox, '''
+ # svn ci
+ # svn up
+ # # have a commit on one of the files
+ # echo mod >> X/xmu
+ # svn ci X/xmu
+ # svn up
+ # # now perform the WC->WC copy
+ # svn cp X X_copy
+ # ### manual edit: add a verify_disk(check_props=True) here
+ # svn ci
+ # ### manual edit: add check_props=True to below update
+ # svn up
+ # ''')
+
+ X = os.path.join(wc_dir, 'X')
+ X_copy = os.path.join(wc_dir, 'X_copy')
+ X_xmu = os.path.join(wc_dir, 'X', 'xmu')
+
+ # svn ci
+ expected_output = svntest.wc.State(wc_dir, {
+ 'X' : Item(verb='Adding'),
+ })
+
+ expected_status = actions.get_virginal_state(wc_dir, 1)
+ expected_status.add({
+ 'X' : Item(status=' ', wc_rev='2'),
+ })
+
+ actions.run_and_verify_commit(wc_dir, expected_output, expected_status,
+ None, wc_dir)
+
+ # svn up
+ expected_output = svntest.wc.State(wc_dir, {
+ 'X/xmu' : Item(status='A '),
+ 'X/xiota' : Item(status='A '),
+ })
+
+ expected_disk = svntest.main.greek_state.copy()
+ expected_disk.add({
+ 'X' : Item(),
+ 'X/xiota' : Item(contents="This is the file 'iota'.\n"),
+ 'X/xmu' : Item(contents="This is the file 'mu'.\n"),
+ })
+
+ expected_status.add({
+ 'X/xiota' : Item(status=' ', wc_rev='2', switched='X'),
+ 'X/xmu' : Item(status=' ', wc_rev='2', switched='X'),
+ })
+ expected_status.tweak(wc_rev='2')
+
+ actions.run_and_verify_update(wc_dir, expected_output, expected_disk,
+ expected_status, None, None, None, None, None, False, wc_dir)
+
+ # have a commit on one of the files
+ # echo mod >> X/xmu
+ main.file_append(X_xmu, 'mod\n')
+
+ # svn ci X/xmu
+ expected_output = svntest.wc.State(wc_dir, {
+ 'X/xmu' : Item(verb='Sending'),
+ })
+
+ expected_status.tweak('X/xmu', wc_rev='3')
+
+ actions.run_and_verify_commit(wc_dir, expected_output, expected_status,
+ None, X_xmu)
+
+ # svn up
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A/mu' : Item(status='U '),
+ })
+
+ expected_disk.tweak('A/mu', 'X/xmu',
+ contents="This is the file 'mu'.\nmod\n")
+
+ expected_status.tweak(wc_rev='3')
+
+ actions.run_and_verify_update(wc_dir, expected_output, expected_disk,
+ expected_status, None, None, None, None, None, False, wc_dir)
+
+ # now perform the WC->WC copy
+ # svn cp X X_copy
+ expected_stdout = ['A ' + X_copy + '\n']
+
+ actions.run_and_verify_svn2('OUTPUT', expected_stdout, [], 0, 'cp', X,
+ X_copy)
+
+ # svn ci
+ expected_output = svntest.wc.State(wc_dir, {
+ 'X_copy' : Item(verb='Adding'),
+ })
+
+ expected_status.add({
+ 'X_copy' : Item(status=' ', wc_rev='4'),
+ })
+
+ actions.run_and_verify_commit(wc_dir, expected_output, expected_status,
+ None, wc_dir)
+
+ # verify disk state, also verifying props
+ expected_disk.add({
+ 'X_copy' : Item(),
+ })
+ expected_disk.tweak('X', 'X_copy',
+ props={'svn:externals' : '\n ^/iota xiota\n ^/A/mu xmu\n \n'})
+
+ actions.verify_disk(wc_dir, expected_disk, True)
+
+ # svn up
+ expected_output = svntest.wc.State(wc_dir, {
+ 'X_copy/xmu' : Item(status='A '),
+ 'X_copy/xiota' : Item(status='A '),
+ })
+
+ expected_disk.add({
+ 'X_copy/xmu' : Item(contents="This is the file 'mu'.\nmod\n"),
+ 'X_copy/xiota' : Item(contents="This is the file 'iota'.\n"),
+ })
+
+ expected_status.add({
+ 'X_copy/xmu' : Item(status=' ', wc_rev='4', switched='X'),
+ 'X_copy/xiota' : Item(status=' ', wc_rev='4', switched='X'),
+ })
+ expected_status.tweak(wc_rev='4')
+
+ actions.run_and_verify_update(wc_dir, expected_output, expected_disk,
+ expected_status, None, None, None, None, None, True, wc_dir)
+
+
########################################################################
# Run the tests
@@ -1922,6 +2082,7 @@ test_list = [ None,
incoming_file_on_file_external,
incoming_file_external_on_file,
exclude_externals,
+ copy_file_externals,
]
if __name__ == '__main__':