Reputation: 159
I have a repository in svn which comprises .cpp
, .h
, .txt
and other files.
I want to export only the .h
files to specified local directory.
I'm getting an error with this code:
svn export --username %SVN_USER% --password %SVN_PASSWORD% --force --non-interactive "http://justatest.com/svn/repos/TrackingProjects/*.h" c:\exported_files
Is there a support a wildcard support for this? I have workaround for this but I just want know if this is possible in svn
command line.
Upvotes: 2
Views: 2094
Reputation: 16236
The export command does not accept wildcards. How about a workaround script? This gets a list of files from the repo directory, filters the desired ones, then exports them individually.
@echo off
set "DESTDIR=C:\exported_files"
set "REPODIR=http://justatest.com/svn/repos/TrackingProjects"
set "TEMPFILE=%TEMP%\exfiles.tmp"
svn ls "%REPODIR%" | findstr /R "\.h$" >"%TEMPFILE%"
for /f "delims=" %%f in ('type "%TEMPFILE%") do (
svn export "%REPODIR%/%%~f" "%DESTDIR%"
)
if exist "%TEMPFILE%" (del "%TEMPFILE%")
exit /B
Upvotes: 1