@@ -276,14 +276,34 @@ def _create_svn_remote_repo(
276
276
init_cmd_args = []
277
277
278
278
remote_repo_path = remote_repos_path / remote_repo_name
279
- run (["svnadmin" , "create" , remote_repo_path , * init_cmd_args ])
279
+ run (["svnadmin" , "create" , str (remote_repo_path ), * init_cmd_args ])
280
+
281
+ assert remote_repo_path .exists ()
282
+ assert remote_repo_path .is_dir ()
280
283
281
284
if remote_repo_post_init is not None and callable (remote_repo_post_init ):
282
285
remote_repo_post_init (remote_repo_path = remote_repo_path )
283
286
284
287
return remote_repo_path
285
288
286
289
290
+ def svn_remote_repo_single_commit_post_init (remote_repo_path : pathlib .Path ) -> None :
291
+ assert remote_repo_path .exists ()
292
+ repo_dumpfile = pathlib .Path (__file__ ).parent / "data" / "repotest.dump"
293
+ run (
294
+ " " .join (
295
+ [
296
+ "svnadmin" ,
297
+ "load" ,
298
+ str (remote_repo_path ),
299
+ "<" ,
300
+ str (repo_dumpfile ),
301
+ ]
302
+ ),
303
+ shell = True ,
304
+ )
305
+
306
+
287
307
@pytest .fixture
288
308
@skip_if_svn_missing
289
309
def create_svn_remote_repo (
@@ -313,10 +333,9 @@ def fn(
313
333
@skip_if_svn_missing
314
334
def svn_remote_repo (remote_repos_path : pathlib .Path ) -> pathlib .Path :
315
335
"""Pre-made. Local file:// based SVN server."""
316
- svn_repo_name = "svn_server_dir"
317
336
remote_repo_path = _create_svn_remote_repo (
318
337
remote_repos_path = remote_repos_path ,
319
- remote_repo_name = svn_repo_name ,
338
+ remote_repo_name = "svn_server_dir" ,
320
339
remote_repo_post_init = None ,
321
340
)
322
341
@@ -456,7 +475,11 @@ def add_doctest_fixtures(
456
475
doctest_namespace ["create_git_remote_repo_bare" ] = create_git_remote_repo
457
476
doctest_namespace ["git_local_clone" ] = git_repo
458
477
if shutil .which ("svn" ):
459
- doctest_namespace ["create_svn_remote_repo" ] = create_svn_remote_repo
478
+ doctest_namespace ["create_svn_remote_repo_bare" ] = create_svn_remote_repo
479
+ doctest_namespace ["create_svn_remote_repo" ] = functools .partial (
480
+ create_svn_remote_repo ,
481
+ remote_repo_post_init = svn_remote_repo_single_commit_post_init ,
482
+ )
460
483
if shutil .which ("hg" ):
461
484
doctest_namespace ["create_hg_remote_repo_bare" ] = create_hg_remote_repo
462
485
doctest_namespace ["create_hg_remote_repo" ] = functools .partial (
0 commit comments