简体   繁体   English

设置 svn externals 属性时出错

[英]Error while setting svn externals property

I have a problem setting (or changing) an svn:externals definition in my local svn working copy.我在本地svn工作副本中设置(或更改) svn:externals定义时遇到问题。 First第一的

svn propget svn:externals

lists the following:列出以下内容:

https://path/to/mytool/tags/1.0.8 mytool

I want to change this property so it points to a tag with revision number 1.0.9 .我想更改此属性,使其指向修订号为1.0.9的标记。 I tried the following:我尝试了以下方法:

svn propset svn:externals https://path/to/mytool/tags/1.0.9 mytool
svn: Error parsing svn:externals property on 'mytool': 'https://path/to/mytool/tags/1.0.9'

and

svn propset mytool svn:externals https://path/to/mytool/tags/1.0.9
svn: Setting property on non-local target 'https://path/to/mytool/tags/1.0.9' needs a base revision

and the same of the above with the URL and the target directory set in quotes (as found as answer to the same problem), which both yields an error和上面相同的 URL 和目标目录设置在引号中(作为对同一问题的答案),这两者都会产生错误

svn: Explicit target required ('https://path/to/mytool/tags/1.0.9 mytool' interpreted as prop value)

So what the heck am I doing wrong?那我到底做错了什么? How to change the property correctly.如何正确更改属性。 svn help does not really help here... svn help help 在这里并没有真正的帮助......

Addendum: With svn propedit svn:externals .附录:使用svn propedit svn:externals . it does seem to work.它似乎工作。 I am able to change this property, which I can commit now.我可以更改这个属性,我现在可以提交。 But propset does not seem to work.但是propset似乎不起作用。

You have to specify the PROPVAL in the form of TARGET-DIRECTORY EXTERNAL-PATH and set it on parent directory of TARGET-DIRECTORY .您必须以TARGET-DIRECTORY EXTERNAL-PATH的形式指定PROPVAL并将其设置在TARGET-DIRECTORY父目录上。 So in your example that would be...所以在你的例子中,那将是......

svn propset svn:externals "mytool https://path/to/mytool/tags/1.0.9" .

...to be executed in the directory parent to the directory called mytool . ...在名为mytool的目录的父目录中mytool

Update: To do this with multiple lines, the normal approach I use is to write the properties into a file, eg externals.txt , then set it up with更新:要使用多行执行此操作,我使用的正常方法是将属性写入文件,例如externals.txt ,然后使用

svn propset svn:externals -F externals.txt .

Under Linux you might also get away with this one-liner , but I'm not aware of a Win32 analogue for this.在 Linux 下,您也可以使用这个 one-liner ,但我不知道 Win32 类似物。

SVN does not particularly shine when it comes to this task :/ SVN 在执行此任务时并没有特别出色:/

I had same problem, but solution from @zb226 didn't work.我遇到了同样的问题,但来自 @zb226 的解决方案不起作用。

I was trying all kind of things and it was some sort of bug and maybe it has something to do from changing server from linux Centos to Windows(VisualSVN).我正在尝试各种各样的事情,这是某种错误,也许与将服务器从 linux Centos 更改为 Windows(VisualSVN)有关。 The problem was in missing space after " symbol (in this case missing space in front of "mytool"问题在于符号后缺少空格(在这种情况下,“mytool”前面缺少空格

Without extra space it just didn't work and parsing error occurs.如果没有额外的空间,它就无法工作,并且会发生解析错误。 In example I show how it worked for me.在示例中,我展示了它是如何为我工作的。 It is basically the same solution as @zb226 proposed but with one extra space.它与@zb226 提出的解决方案基本相同,但有一个额外的空间。

svn propset svn:externals " mytool https://path/to/mytool/tags/1.0.9" .

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

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