简体   繁体   中英

Error while setting svn externals property

I have a problem setting (or changing) an svn:externals definition in my local svn working copy. 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 . 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

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...

Addendum: With 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.

You have to specify the PROPVAL in the form of TARGET-DIRECTORY EXTERNAL-PATH and set it on parent directory of 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 .

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

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.

SVN does not particularly shine when it comes to this task :/

I had same problem, but solution from @zb226 didn't work.

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). The problem was in missing space after " symbol (in this case missing space in front of "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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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