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.
Received on 2017-06-13 15:48:36 CEST