221
222
# Subversion 1.8.0 crashes when updating a working copy through a symlink
222
223
svntest.actions.run_and_verify_update(wc_dir, expected_output,
223
224
expected_disk, expected_status,
224
None, None, None, None, None, 1,
228
def cleanup_unversioned_items(sbox):
229
"""cleanup --remove-unversioned / --remove-ignored"""
231
sbox.build(read_only = True)
234
# create some unversioned items
235
os.mkdir(sbox.ospath('dir1'))
236
os.mkdir(sbox.ospath('dir2'))
237
contents = "This is an unversioned file\n."
238
svntest.main.file_write(sbox.ospath('dir1/dir1_child1'), contents)
239
svntest.main.file_write(sbox.ospath('dir2/dir2_child1'), contents)
240
os.mkdir(sbox.ospath('dir2/foo_child2'))
241
svntest.main.file_write(sbox.ospath('file_foo'), contents),
242
os.mkdir(sbox.ospath('dir_foo'))
243
svntest.main.file_write(sbox.ospath('dir_foo/foo_child1'), contents)
244
os.mkdir(sbox.ospath('dir_foo/foo_child2'))
245
# a file that matches a default ignore pattern
246
svntest.main.file_write(sbox.ospath('foo.o'), contents)
248
# ignore some of the unversioned items
249
sbox.simple_propset('svn:ignore', '*_foo', '.')
258
svntest.actions.run_and_verify_svn(UnorderedOutput(expected_output),
265
svntest.actions.run_and_verify_svn(UnorderedOutput(expected_output),
266
[], 'status', '--no-ignore')
272
svntest.actions.run_and_verify_svn(UnorderedOutput(expected_output),
273
[], 'cleanup', '--remove-unversioned')
280
svntest.actions.run_and_verify_svn(UnorderedOutput(expected_output),
281
[], 'status', '--no-ignore')
283
# remove ignored items, with an empty global-ignores list
288
svntest.actions.run_and_verify_svn(UnorderedOutput(expected_output),
289
[], 'cleanup', '--remove-ignored',
291
'config:miscellany:global-ignores=')
293
# the file matching global-ignores should still be present
298
svntest.actions.run_and_verify_svn(UnorderedOutput(expected_output),
299
[], 'status', '--no-ignore')
301
# un-ignore the file matching global ignores, making it unversioned,
302
# and remove it with --remove-unversioned
306
svntest.actions.run_and_verify_svn(UnorderedOutput(expected_output),
307
[], 'cleanup', '--remove-unversioned',
309
'config:miscellany:global-ignores=')
313
svntest.actions.run_and_verify_svn(expected_output,
314
[], 'status', '--no-ignore')
316
def cleanup_unversioned_items_in_locked_wc(sbox):
317
"""cleanup unversioned items in locked WC should fail"""
319
sbox.build(read_only = True)
321
contents = "This is an unversioned file\n."
322
svntest.main.file_write(sbox.ospath('unversioned_file'), contents)
324
svntest.actions.lock_admin_dir(sbox.ospath(""), True)
325
for option in ['--remove-unversioned', '--remove-ignored']:
326
svntest.actions.run_and_verify_svn(None,
327
"svn: E155004: Working copy locked;.*",
331
def cleanup_dir_external(sbox):
332
"""cleanup --include-externals"""
334
sbox.build(read_only = True)
336
# configure a directory external
337
sbox.simple_propset("svn:externals", "^/A A_ext", ".")
340
svntest.actions.lock_admin_dir(sbox.ospath("A_ext"), True)
341
svntest.actions.run_and_verify_svn(["Performing cleanup on external " +
342
"item at '%s'.\n" % sbox.ospath("A_ext")],
343
[], "cleanup", '--include-externals',
347
def checkout_within_locked_wc(sbox):
348
"""checkout within a locked working copy"""
350
sbox.build(read_only = True)
352
# lock working copy and create outstanding work queue items
353
svntest.actions.lock_admin_dir(sbox.ospath(""), True, True)
355
"A %s\n" % sbox.ospath("nested-wc/alpha"),
356
"A %s\n" % sbox.ospath("nested-wc/beta"),
357
"Checked out revision 1.\n"
359
svntest.actions.run_and_verify_svn(UnorderedOutput(expected_output),
360
[], "checkout", sbox.repo_url + '/A/B/E',
361
sbox.ospath("nested-wc"))
227
364
########################################################################