[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: "svn propset svn:externals" syntax on Windows command line

From: Nick <nospam_at_codesniffer.com>
Date: Thu, 29 Nov 2012 22:29:01 -0500

On Thu, 2012-11-29 at 23:02 +0000, Simon Large wrote:
> On 29 November 2012 21:49, Ben Johnson <ben_at_indietorrent.org> wrote:
> > Hello,
> >
> > I've wasted far too much time attempting to discern the correct syntax
> > for setting svn:externals properties, *pinned with explicit revision
> > numbers*, via the Windows command line.
> >
> > While I realize that this question is not TSVN-specific, I am hoping the
> > TSVN developers can provide some insight, because clearly, this very
> > capability has been implemented in TSVN.
> >
> > I am trying to emulate TSVN's svn:externals property editor, which
> > yields the following property string:
> >
> > -r 661 ^/../framework/trunk/database database
> >
> > I am using the following command (all on one line):
> >
> > svn propset svn:externals "-r661 ^/../framework/trunk/database database" .
> >
> > This yields the following error message:
> >
> > svn: E205000: Syntax error in revision argument '661
> > ^/../framework/trunk/database database'
> >
> > I have also tried placing a space between "-r" and "661", even though
> > the output from "svn help propset" does not use a space in the example
> > (it uses "-r25"; see last line in below paragraph):
> >
> > svn:externals - A newline separated list of module specifiers,
> > each of which consists of a URL and a relative directory path,
> > similar to the syntax of the 'svn checkout' command:
> > http://example.com/repos/zig foo/bar
> > A revision to check out can optionally be specified to pin the
> > external to a known revision:
> > -r25 http://example.com/repos/zig foo/bar
> >
> > Adding the space yields the same error, but with a space before "661" in
> > the message:
> >
> > svn: E205000: Syntax error in revision argument ' 661
> > ^/../framework/trunk/database database'
> >
> > The problem seems to be related to how Windows handles the minus sign in
> > the "-r661" portion of the string. If I escape the minus sign with a
> > backslash, the command succeeds, but of course, the backslash appears,
> > literally, in the svn:externals property value.
> >
> > I've scoured the Web looking for examples of how this is done on the
> > Windows command line with SVN 1.7, and I can't find a single example.
> >
> > Any help is greatly appreciated!
>
> The answer is somewhat unexpected, at least to me:
>
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=463&dsMessageId=2733969
>
> The correct syntax it seems is:
>
> svn propset svn:externals -- "-r661 ^/../framework/trunk/database database" .
>
> And the reason seems to be this one:
> http://www.kernel.org/doc/man-pages/online/pages/man3/getopt.3.html
>
> The extra -- prevents the following arguments starting with - from
> being parsed as options.

Right, the "-r" is being picked up as if it was a parameter to "svn
propset" as opposed to an attribute of the external. Have you
considered specifying the revision via a peg revision instead? This
uses a slightly different syntax but will likely yield the same results
for you:

svn propset svn:externals "^/../framework/trunk/database_at_661 database" .

Best regards,
Nick

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3032178

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2012-11-30 04:29:09 CET

This is an archived mail posted to the TortoiseSVN Users mailing list.