Hi, attached is a patch that fixes a test for Git mirrors. The error results from the fact that Git does not track empty directories, which one test relies upon.
As we're already doing some path processing for the missing directories and as we're also creating directories in the other import tests, I think this is the most sensible place to fix the issue. For Subversion working copies it becomes a no-op anyway as the directories already exist. Regards Patrick [[[ tests: fix import tests for git mirrors Subversion's import tests test behavior when importing empty directories. These empty directories are checked in as part of our test data. This however breaks our import tests when using Subversion's Git mirror at git.apache.org, as Git is unable to version empty directories. As our tests rely on the fact that these directories are indeed empty it is not possible to work around the issue by creating a `.gitkeep` file inside these directories, as is commonly done with git. Instead, the issue is fixed inside the tests itself by creating the directories if they do not already exist. This is in fact a no-op for Subversion working copies and fixes tests for Git repositories. * subversion/tests/cmdline/import_tests.py: (import_inherited_ignores): Create empty directories if they do not exist yet. ]]] -- Patrick Steinhardt, Entwickler elego Software Solutions GmbH, http://www.elego.de Gebäude 12 (BIG), Gustav-Meyer-Allee 25, 13355 Berlin, Germany Sitz der Gesellschaft: Berlin, USt-IdNr.: DE 163214194 Handelsregister: Amtsgericht Charlottenburg HRB 77719 Geschäftsführer: Olaf Wagner
diff --git a/subversion/tests/cmdline/import_tests.py b/subversion/tests/cmdline/import_tests.py index 73a4036..395c283 100755 --- a/subversion/tests/cmdline/import_tests.py +++ b/subversion/tests/cmdline/import_tests.py @@ -466,6 +466,15 @@ def import_inherited_ignores(sbox): file7_path = os.path.join('DIR6', 'DIR7', 'file7.foo') dir8_path = os.path.join('DIR6', 'DIR7', 'DIR8.noo') + # Create empty directories DIR1.noo and DIR8.noo. While + # subversion tracks and checks out these directories, this aims + # to fix tests when checking out Subversion via the git mirror, + # as git does not track empty directories. + for d in [ dir1_path, dir8_path ]: + path = os.path.join(import_tree_dir, d) + if not os.path.exists(path): + os.mkdir(path, svntest.main.S_ALL_RX | stat.S_IWUSR) + # Import the tree to ^/A/B/E. # We should not see any *.noo paths because those are blocked at the # root of the repository by the svn:global-ignores property. Likewise
signature.asc
Description: PGP signature