I have a script that copies some files into a project. Such a project is usually a Subversion working copy, but not always. If it is a working copy, I want to add the files to Subversion automatically. But how do I know that the directory is part of a Subversion working copy? So far I checked for a .svn sub-folder, but that doesn't work with Subversion 1.7. I just need to know if svn add files...
will work, no other data needs to be extracted.
Just run svn status
. You'll get a message like the following if the it's not a working copy:
svn: warning: '.' is not a working copy
Edit: If you are concerned about the recursive nature of svn status
you can limit the depth by (depending on the version of the client) either
svn status --depth=empty
or
svn status --non-recusive
(The latter format is listed as obsolete in recent versions of the client).
You can use the svn info property and then pipe to just get the url as follows:
svn info -R | FIND "URL:" >urlText
then load this output into another variable and you could work with it like:
set /p urlRepo= <urlText
del urlText
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With