且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

检查svn存储库url不存在

更新时间:2023-01-15 16:43:37

您只需使用

  svn ls https://developernetwork.repo.net/svn/Projects/Calculator/ 

它会告诉你存储库(目录)是否存在。



更新



可以使用许多文件的目录:

  svn ls http:// server / svn / foo --depth empty 


I am writing a script which will add a new project in the repository, based on the name supplied by the user. Part of this involves checking that an url with the same name does not already exist on the repository.

In the repository, all the projects of our team are stored in

https://developernetwork.repo.net/svn/Projects/

Let's say that the user wants to call the project "Calculator" and runs the script. In this case, we need to ensure that the following does not already exist in the repository

https://developernetwork.repo.net/svn/Projects/Calculator/

Is there an svn command which I can use to accomplish that? Unfortunately I cannot see an appropriate command I can use in the svn documentation (http://svnbook.red-bean.com/en/1.0/svn-book.html) at all.

You can just use

svn ls https://developernetwork.repo.net/svn/Projects/Calculator/

It will tell you if the repository(directory) exist or not.

Update

for directories with many files use:

svn ls http://server/svn/foo --depth empty