On Tue, Jun 13, 2017 at 3:47 PM, Andrey <andry_at_inbox.ru> wrote:
> Here is the batch script for the windows:
>
> ```
> @echo off
>
> set REPODIR=test_repo
> set "REPOROOT=%~dp0%REPODIR%"
> set "REPOURL=file:///%REPOROOT:\=/%"
> set WCROOT=%REPODIR%_root
>
> if exist "%REPOROOT%\" rmdir /S /Q "%REPOROOT%"
> if exist "%WCROOT%\" rmdir /S /Q "%WCROOT%"
>
> mkdir "%REPOROOT%"
> svnadmin create "%REPOROOT%"
> mkdir "%WCROOT%"
>
> svn co "%REPOURL%" "%WCROOT%"
>
> rem creating tree w/o externals
> mkdir "%WCROOT%/dir1/dir1_subdir1" || goto :EOF
> mkdir "%WCROOT%/dir1/dir1_subdir2" || goto :EOF
> mkdir "%WCROOT%/dir2/dir2_subdir1" || goto :EOF
> mkdir "%WCROOT%/dir2/dir2_subdir2" || goto :EOF
>
> svn add "%WCROOT%/*.*" || goto :EOF
>
> svn ci "%WCROOT%" -m "rev1" || goto :EOF
>
> rem update to the head
> svn up "%WCROOT%" || goto :EOF
>
> rem creating externals
> type nul > "$externals.txt"
>
> (
> echo.^^/dir1/dir1_subdir1 ext/dir1_subdir1
> echo.^^/dir1/dir1_subdir2 ext/dir1_subdir2
> echo.^^/dir2/dir2_subdir1 dir2_subdir1
> echo.^^/dir2/dir2_subdir2 dir2_subdir2
> ) >> "$externals.txt"
>
> svn pset svn:externals -F "$externals.txt" "%WCROOT%" || goto :EOF
>
> svn ci "%WCROOT%" -m "rev2" || goto :EOF
>
> rem update to the head
> svn up "%WCROOT%" || goto :EOF
>
> rem show status
> svn status "%WCROOT%"
> ```
>
> The output:
>
> ```
> Checked out revision 0.
> svn: Skipping argument: E200025: 'test_repo_root/.svn' ends in a reserved
> name
> A test_repo_root\dir1
> A test_repo_root\dir1\dir1_subdir1
> A test_repo_root\dir1\dir1_subdir2
> A test_repo_root\dir2
> A test_repo_root\dir2\dir2_subdir1
> A test_repo_root\dir2\dir2_subdir2
> Adding test_repo_root\dir1
> Adding test_repo_root\dir1\dir1_subdir1
> Adding test_repo_root\dir1\dir1_subdir2
> Adding test_repo_root\dir2
> Adding test_repo_root\dir2\dir2_subdir1
> Adding test_repo_root\dir2\dir2_subdir2
> Committing transaction...
> Committed revision 1.
> Updating 'test_repo_root':
> At revision 1.
> property 'svn:externals' set on 'test_repo_root'
> Sending test_repo_root
> Committing transaction...
> Committed revision 2.
> Updating 'test_repo_root':
>
> Fetching external item into 'test_repo_root\ext\dir1_subdir1':
> External at revision 2.
>
>
> Fetching external item into 'test_repo_root\ext\dir1_subdir2':
> External at revision 2.
>
>
> Fetching external item into 'test_repo_root\dir2_subdir1':
> External at revision 2.
>
>
> Fetching external item into 'test_repo_root\dir2_subdir2':
> External at revision 2.
>
> At revision 2.
> X test_repo_root\dir2_subdir1
> X test_repo_root\dir2_subdir2
> X test_repo_root\ext
>
> Performing status on external item at 'test_repo_root\dir2_subdir1':
>
> Performing status on external item at 'test_repo_root\dir2_subdir2':
>
> Performing status on external item at 'test_repo_root\ext\dir1_subdir1':
>
> Performing status on external item at 'test_repo_root\ext\dir1_subdir2':
> ```
>
> The externals list is:
>
> ```
> X test_repo_root\dir2_subdir1
> X test_repo_root\dir2_subdir2
> X test_repo_root\ext
> ```
>
> instead of:
>
> ```
> X test_repo_root\dir2_subdir1
> X test_repo_root\dir2_subdir2
> X test_repo_root\ext\dir1_subdir1
> X test_repo_root\ext\dir1_subdir2
> ```
>
> This forces to use `svn pget svn:externals` + `a parser` instead of `svn
> status` + `a filter` in scripting to extract the records set.
Hi Andrey,
I tried your repro script and I'm seeing the same. However, I'm not
sure whether this is a bug or not ... The 'ext' directory in your
example is an unversioned "intermediate" directory. It's supported,
but it's quite special (I've never used externals like that).
So what you're seeing is that 'svn status' only reports one single X
line for the entire "unversioned intermediate directory", even if
there are multiple externals below it.
Summarized, you're saying that with this svn:externals definition:
^/dir1/dir1_subdir1 ext/dir1_subdir1
^/dir1/dir1_subdir2 ext/dir1_subdir2
(with ext being an unversioned intermediate directory)
running 'svn status' only reports one X line (for 'ext') instead of a
line for each external definition (like it does with other externals):
X test_repo_root\ext
Strangely, if you define externals into a *versioned* subdir, it's
reported with two lines, as you expect:
(continuing from the result of your script)
[[[
svn mkdir ext2
svn ci -mm
svn up
# edit svn:externals property and add two more lines like the
ext-ones, with ext2.
svn ci -mm
svn up
svn st
]]]
Output of 'svn st':
X dir2_subdir1
X dir2_subdir2
X ext
X ext2\dir1_subdir1
X ext2\dir1_subdir2
--
Johan
Received on 2017-06-30 00:07:15 CEST