简体   繁体   English

SVN:如何通过命令行在远程存储库上设置外部属性

[英]SVN: how to set external property on a remote repository through command line

I'm trying to create a batch that can automatize the set of an external property on a remote tag.我正在尝试创建一个可以自动化远程标记上的外部属性集的批处理。 This batch should run on windows.此批处理应在 Windows 上运行。

I usually accomplish this operation through Tortoise SVN Repo Browser as showed in the image below:我通常通过 Tortoise SVN Repo Browser 完成这个操作,如下图所示:

外部属性编辑 I've tryed to use this command line to do the same operation我试过用这个命令行做同样的操作

svn propset svn:externals 'LocalPath https://svnserver/svn/myproject/tags/1.00/DISTRIBUZIONE89' https://svnserver/svn/myproject/tags/Distribuzione

but it seems to not work on a remote repository.但它似乎不适用于远程存储库。

Is it possible run a command line, executable in a batch, that performs this operation?是否可以运行一个可以批量执行的命令行来执行此操作?

Many thanks...非常感谢...

svn propset does not operate with URLs, it require checked out working copy. svn propset 不使用 URL,它需要签出工作副本。 So script should look like(not checked):所以脚本应该看起来像(未选中):

svn co --depth empty https://svnserver/svn/myproject/tags/Distribuzione wc
svn propset svn:externals "LocalPath https://svnserver/svn/myproject/tags/1.00/DISTRIBUZIONE89" wc
svn ci -m "Set externals"

PS I guess TortoiseSVN use same trick with temp checkout, or use some Subversion API not exposed via command line. PS 我猜 TortoiseSVN 使用与临时结帐相同的技巧,或者使用一些未通过命令行公开的 Subversion API。

Use bat file windows :-使用 bat 文件窗口:-

svn checkout {tag url where property is to be set} {tempfoldername} --depth empty
echo {target value url for property} {foldername} > {tempfilename}
svn propset svn:externals tempfoldername -F tempfilename
svn commit -m "your commit message" tempfoldername
RD /S /Q tempfoldername
del /F /Q tempfilename

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM