Den ons 16 apr. 2025 kl 23:27 skrev Nathan Hartman <hartman.nat...@gmail.com
>:

> On Wed, Apr 16, 2025 at 9:38 AM Jan Kohlmeyer <jan.kohlme...@vario.ag>
> wrote:
> >
> > Hi, I think I found a Bug on SVN Cleanup:
> >
> >
> >
> > * What steps led to the issue:
> >
> >
> >
> > I have an Repository with externals.
> >
> > One external has a depth of three directorys:
> >
> > Path: Dir1/Dir2/Dir3
> >
> > Url: ^/../OtherDir
> >
> >
> >
> > Run cleanup with include-externals, e.g. with include-externals and
> remove-unversioned
> >
> > svn cleanup --include-externals
> >
> > svn cleanup --remove-unversioned --include-externals
> >
> >
> >
> > * The expected outcome:
> >
> >
> >
> > The external should be treated like any other external.
> >
> > It shoud be cleand up
> >
> >
> >
> > * The actual outcome:
> >
> >
> >
> > With svn cleanup --include-externals it will not be updated and with svn
> cleanup --remove-unversioned --include-externals it will be deleted.
>

What will be deleted?


> >
> >
> >
> > * Subversion client version:
> >
> >
> >
> > svn, version 1.14.5 (r1922182)
> >
> >    compiled Nov 30 2024, 08:20:48 on x86-microsoft-windows
> >
> >
> >
> > * Subversion server version:
> >
> > Subversion 1.14.5
> >
> >
> >
> > * If you built Subversion yourself, compiler and configuration options
> used:
> >
> > I Use TortoiseSVN with VisualSVN Server
> >
> >
> >
> > * Any customizations which could be relevant:
> >
> >
> >
> > No
> >
> >
> >
> > * Your operating system:
> >
> >
> >
> > Windows 11
> >
> >
> >
> > * Any similar bugs already in the issue tracker:
> >
> >
> >
> > I didn’t found it
> >
> >
> >
> >
> >
> >
> >
> > Regards, Jan
>
>
> Hi Jan,
>
> Thanks for the report.
>
> I tried to write a reproduction script based on your description.
>
> However, I am possibly misunderstanding your report because I am getting
> the results I expect.
>
> Currently I don't have a Windows system to test with, so this is a unix
> script... I hope you can look through it and let us know if there's a
> different directory layout that exposes the issue you're seeing:
>
> [[[
>
> #!/bin/sh
>
> REPO="$PWD/repo"
> URL="file://$REPO"
> WC="$PWD/wc"
>
> svnadmin create "$REPO"
> svn checkout "$URL" "$WC"
>
> cd "$WC" || exit
>
> # Create this directory structure:
> # (this is tree layout 1)
> # top
> # |-- a
> # |   `-- b
> # |       `-- c
> # `-- d
> #     `-- e
> #         `-- f
> echo "Creating directory structure..."
> svn mkdir --parents "top/a/b/c" "top/d/e/f"
> svn commit -m "Make initial directory structure"
> svn update "$WC"
>
> # Set svn:externals on top/a to pull top/d into top/a/b/c subdir:
> # (this is tree layout 2)
> # top
> # |-- a
> # |   `-- b
> # |       `-- c
> # |           `-- d
> # |               `-- e
> # |                   `-- f
> # `-- d
> #     `-- e
> #         `-- f
> echo "Setting svn:externals..."
> svn propset "svn:externals" "^/top/d b/c/d" "top/a"
> svn commit -m "Add external"
> svn update "$WC"
>
> # Put some junk files into top/a/b/c/d/e/f/:
> # (this is tree layout 3)
> # top
> # |-- a
> # |   `-- b
> # |       `-- c
> # |           `-- d
> # |               `-- e
> # |                   `-- f
> # |                       |-- junk1.txt
> # |                       |-- junk2.txt
> # |                       `-- junk3.txt
> # `-- d
> #     `-- e
> #         `-- f
> echo "Adding some junk files..."
> touch "$WC/top/a/b/c/d/e/f/junk1.txt"
> touch "$WC/top/a/b/c/d/e/f/junk2.txt"
> touch "$WC/top/a/b/c/d/e/f/junk3.txt"
> svn status "$WC"
>
> # Now for some tests...
>
> # Test 1
> # Expected outcome: No change to junk files, remain at tree layout 3
> svn cleanup "$WC"
>
> # Test 2
> # Expected outcome: No change to junk files, remain at tree layout 3
> svn cleanup --include-externals "$WC"
>
> # Test 3
> # Expected outcome: Removal of junk files, back to tree layout 2
> svn cleanup --include-externals --remove-unversioned
>
> ]]]
>
> Thanks,
> Nathan
>
>
A windows version of the above script should be something like:
[[[
@echo off

set REPO=%CD%\repo
set URL=file:///%REPO:\=/%
set WC=%CD%\wc

svnadmin create "%REPO%"
svnadmin create "%REPO%2"
svn checkout "%URL%" "%WC%"

cd "%WC%"

:: Create this directory structure:
:: (this is tree layout 1)
:: top
:: |-- a
:: |   `-- b
:: |       `-- c
:: `-- d
::     `-- e
::         `-- f
echo "Creating directory structure..."
svn mkdir --parents "top/a/b/c" "top/d/e/f"
svn commit -m "Make initial directory structure"
svn update "%WC%"

:: Set svn:externals on top/a to pull top/d into top/a/b/c subdir:
:: (this is tree layout 2)
:: top
:: |-- a
:: |   `-- b
:: |       `-- c
:: |           `-- d
:: |               `-- e
:: |                   `-- f
:: `-- d
::     `-- e
::         `-- f
echo "Setting svn:externals..."
svn propset "svn:externals" "^/top/d b/c/d" "top/a"
svn commit -m "Add external"
svn update "%WC%"

:: Put some junk files into top/a/b/c/d/e/f/:
:: (this is tree layout 3)
:: top
:: |-- a
:: |   `-- b
:: |       `-- c
:: |           `-- d
:: |               `-- e
:: |                   `-- f
:: |                       |-- junk1.txt
:: |                       |-- junk2.txt
:: |                       `-- junk3.txt
:: `-- d
::     `-- e
::         `-- f
echo "Adding some junk files..."
echo junk >"%WC%/top/a/b/c/d/e/f/junk1.txt"
echo junk >"%WC%/top/a/b/c/d/e/f/junk2.txt"
echo junk >"%WC%/top/a/b/c/d/e/f/junk3.txt"
svn status "%WC%"

:: Now for some tests...

echo Test 1
echo Expected outcome: No change to junk files, remain at tree layout 3
svn cleanup "%WC%"
echo Status:
svn st
pause

echo Test 2
echo Expected outcome: No change to junk files, remain at tree layout 3
svn cleanup --include-externals "%WC%"
echo Status:
svn st
pause

echo Test 3
echo Expected outcome: Removal of junk files, back to tree layout 2
svn cleanup --include-externals --remove-unversioned
echo Status:
svn st
pause

cd ..
]]]
(I've added som svn st and pauses between each test to allow inspecting the
working copy).

Relevant output:
[[[
Test 1
Expected outcome: No change to junk files, remain at tree layout 3
Status:
X       top\a\b\c\d

Performing status on external item at 'top\a\b\c\d':
?       top\a\b\c\d\e\f\junk1.txt
?       top\a\b\c\d\e\f\junk2.txt
?       top\a\b\c\d\e\f\junk3.txt
Press any key to continue . . .
Test 2
Expected outcome: No change to junk files, remain at tree layout 3
Performing cleanup on external item at 'top\a\b\c\d'.
Status:
X       top\a\b\c\d

Performing status on external item at 'top\a\b\c\d':
?       top\a\b\c\d\e\f\junk1.txt
?       top\a\b\c\d\e\f\junk2.txt
?       top\a\b\c\d\e\f\junk3.txt
Press any key to continue . . .
Test 3
Expected outcome: Removal of junk files, back to tree layout 2
Performing cleanup on external item at 'top\a\b\c\d'.
D         top\a\b\c\d\e\f\junk1.txt
D         top\a\b\c\d\e\f\junk2.txt
D         top\a\b\c\d\e\f\junk3.txt
Status:
X       top\a\b\c\d

Performing status on external item at 'top\a\b\c\d':
Press any key to continue . . .
]]]

I'd say it behaves as expected, but I fear we're missunderstanding what you
mean is deleted (and what the expected behaviour is).

Kind regards,
Daniel

Reply via email to