You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Purple Streak <mr...@googlemail.com> on 2009/07/16 10:47:15 UTC

[PATCH] Give svnmucc ability to handle multiline properties

Hi,
We use svnmucc to update externals properties as part of our build
process.  As it is svnmucc doesn't allow multi-line property values
when used with -X as each newline in the extra args file means a new
argument.  This is patch which we've been using to allow this.  If the
argument isn't used then the behaviour is unchanged.

[[[
Allow svnmucc to set multiline properties.  This is done by adding an optional
-c (--continuation-char) argument which takes a single character argument.
Any lines in the --extra-args file ending with that character will then not
terminate the current argument.

* tools/client-side/svnmucc/svnmucc.c
  (read_extra_args)  New external file argument parsing function
  (usage) Updated with new argument
  (main) Update to accept new argument and call read_extra_args
]]]

As an example we are using '-c @' on a file with:

svnmucc.exe -m "hello" -c @ -X multi-line.txt

Where multi-line.txt is

propset
svn:externals
-r52792 /svn/Repo/Pools/Shared/Stuff@
-r52792 /svn/Repo/Pools/Shared/MoreStuff
https://source01/svn/Sandbox/testA

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2371714

RE: [PATCH] Give svnmucc ability to handle multiline properties

Posted by Geoff Rowell <ge...@gmail.com>.
Purple Streak wrote:
> This was done very deliberately so as not to break any existing
> scripts.  The idea is that if this went in then when the next version
> was released everyone using svnmucc could just carry on as they were.
> The "-c" makes it an opt-in argument.
> 
...

> We're actually only using windows here :) This was actually the main
> reason for not using "\" to avoid confusion.  However with the "-c"
> argument to people can chose what they want.
>
I wouldn't suggest using a short option of "-c". It'll be confused with the
"change" identifier option.

-Geoff

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2376289

Re: [PATCH] Give svnmucc ability to handle multiline properties

Posted by Julian Foad <ju...@btopenworld.com>.
Is anybody else reading this? Please voice an opinion if you are.

On Fri, 2009-07-31 at 14:33 +0100, Purple Streak wrote:
> 2009/7/28 Purple Streak <mr...@googlemail.com>:
> > [forgot to include list]
> >
> > 2009/7/28 Julian Foad <ju...@btopenworld.com>:
> >> You misunderstand me. As you say, it is good to make the use of the
> >> escape mechanism optional, for that reason. I meant the choice of WHICH
> >> character to use seems unnecessary.
> >
> > Ok - sorry :)
> > Like I said we use windows so the usual '\' char might well be
> > confusing.  How about the character argument becomes optional and
> > defaults to '\' if not given?

I assume you are still thinking of your simple method where the
continuation character is only special when it occurs at the end of a
line, and there is no way to specify an argument that ends with that
character. That still sounds clumsy to me.

What most concerns me is that this is really solving just one symptom of
a wider problem: how to specify a general property value. This might
contain not only newlines but arbitrary binary data (e.g. a JPEG-encoded
thumbnail image). A different solution is needed for that.

One day, potentially, we can implement a new, general solution. But, in
the meantime, we can do your suggestion because it is at least an
improvement, solving the problem of specifying a propery value that
contains line breaks.

With that in mind I'm comfortable about you implementing your
suggestion.


> > 2009/7/28 Geoff Rowell <ge...@gmail.com>:
> >> I wouldn't suggest using a short option of "-c". It'll be confused with the
> >> "change" identifier option.
> >
> > Very happy to make this whatever you suggest :)  I just chose 'c' as
> > short for "continuation_char".  To be honest I wasnt't sure what to
> > use for either of them but they seemed the most logical.
> >
> > Maybe "-o" ?

Are people often going to be typing this command on the command line? If
so, a short option is valuable. If not, don't provide one.


> Hi - I'm keen to try and get this patch accepted so is what I
> suggested about making the character optional acceptable ok?

Yes.

- Julian

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2377440

Re: [PATCH] Give svnmucc ability to handle multiline properties

Posted by Purple Streak <mr...@googlemail.com>.
2009/7/28 Purple Streak <mr...@googlemail.com>:
> [forgot to include list]
>
> 2009/7/28 Julian Foad <ju...@btopenworld.com>:
>> You misunderstand me. As you say, it is good to make the use of the
>> escape mechanism optional, for that reason. I meant the choice of WHICH
>> character to use seems unnecessary.
>
>
> Ok - sorry :)
> Like I said we use windows so the usual '\' char might well be
> confusing.  How about the character argument becomes optional and
> defaults to '\' if not given?
>
>
> 2009/7/28 Geoff Rowell <ge...@gmail.com>:
>> I wouldn't suggest using a short option of "-c". It'll be confused with the
>> "change" identifier option.
>
> Very happy to make this whatever you suggest :)  I just chose 'c' as
> short for "continuation_char".  To be honest I wasnt't sure what to
> use for either of them but they seemed the most logical.
>
> Maybe "-o" ?


Hi - I'm keen to try and get this patch accepted so is what I
suggested about making the character optional acceptable ok?

Cheers,
Purple

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2377390


Re: [PATCH] Give svnmucc ability to handle multiline properties

Posted by Purple Streak <mr...@googlemail.com>.
[forgot to include list]

2009/7/28 Julian Foad <ju...@btopenworld.com>:
> Purple Streak wrote:
>> Thanks for the comments
>>
>>
>> 2009/7/27 Julian Foad <ju...@btopenworld.com>:
>> > Making the escape character configurable seems overly complex - not
>> > complexity of implementation, but the sort of complexity that means any
>> > time you store or automatically generate svnmucc commands you would then
>> > have to keep track also of which character was used, and ensure the same
>> > character is used when interpreting them.
>>
>> This was done very deliberately so as not to break any existing
>> scripts.  The idea is that if this went in then when the next version
>> was released everyone using svnmucc could just carry on as they were.
>> The "-c" makes it an opt-in argument.
>
> You misunderstand me. As you say, it is good to make the use of the
> escape mechanism optional, for that reason. I meant the choice of WHICH
> character to use seems unnecessary.


Ok - sorry :)
Like I said we use windows so the usual '\' char might well be
confusing.  How about the character argument becomes optional and
defaults to '\' if not given?


2009/7/28 Geoff Rowell <ge...@gmail.com>:
> I wouldn't suggest using a short option of "-c". It'll be confused with the
> "change" identifier option.

Very happy to make this whatever you suggest :)  I just chose 'c' as
short for "continuation_char".  To be honest I wasnt't sure what to
use for either of them but they seemed the most logical.

Maybe "-o" ?

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2376327

Re: [PATCH] Give svnmucc ability to handle multiline properties

Posted by Julian Foad <ju...@btopenworld.com>.
Purple Streak wrote:
> Thanks for the comments
> 
> 
> 2009/7/27 Julian Foad <ju...@btopenworld.com>:
> > Making the escape character configurable seems overly complex - not
> > complexity of implementation, but the sort of complexity that means any
> > time you store or automatically generate svnmucc commands you would then
> > have to keep track also of which character was used, and ensure the same
> > character is used when interpreting them.
> 
> This was done very deliberately so as not to break any existing
> scripts.  The idea is that if this went in then when the next version
> was released everyone using svnmucc could just carry on as they were.
> The "-c" makes it an opt-in argument.

You misunderstand me. As you say, it is good to make the use of the
escape mechanism optional, for that reason. I meant the choice of WHICH
character to use seems unnecessary.

- Julian

> > In the proposed solution, is there any way to provide an argument that
> > ends with the escape character? In other words, if I choose '@' as the
> > escape character, how could I specify the filename 'tempfile.@@@' as an
> > argument? When I am a human user, I can probably choose an escape
> > character that isn't found at the end of any argument, but if I am a
> > script invoking svnmucc on arbitrary file names then I'd like a way to
> > pass them safely.
> 
> No there isn't - i wanted to avoid any extra complexity in parsing the
> lines. This way it's a simple test of the last character.  Again as it
> stands this is an opt-in function and so if you're writing a script
> then you would choose the character you want.  You can even just put a
> space character at the end of the line which lets the @ get through
> (and then the space gets's trimmed off - a bit esoteric though I
> realise).
> 
> 2009/7/27 Geoff Rowell <ge...@gmail.com>:
> > Julian Foad wrote:
> >> It's difficult to pick an escape character. I would tend to choose '\'
> >> because it is so commonly used for this purpose in Unix-like systems. It
> >> could be a bit awkward on Windows, but actually the "put" action is the
> >> only svnmucc action that takes a local file name, and you could assume
> >> that Windows users don't use svnmucc much anyway, so that could still be
> >> good. If you choose '@', as in your example, although it has meaning in
> >> the regular svn client I can't see it being used much in svnmucc input
> >> so that could also be good.
> >>
> > I disagree with Julian's assertion that Windows users don't use svnmucc.
> > Several people in my Windows-based office use it (and could use this
> > feature). However, I can't see a problem with backslash as a continuation
> > character. I'd prefer it over an "at" symbol.
> 
> We're actually only using windows here :) This was actually the main
> reason for not using "\" to avoid confusion.  However with the "-c"
> argument to people can chose what they want.
> 
> Cheers,
> Purple
> 
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2376228

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2376235

Re: [PATCH] Give svnmucc ability to handle multiline properties

Posted by Purple Streak <mr...@googlemail.com>.
Thanks for the comments


2009/7/27 Julian Foad <ju...@btopenworld.com>:
> Making the escape character configurable seems overly complex - not
> complexity of implementation, but the sort of complexity that means any
> time you store or automatically generate svnmucc commands you would then
> have to keep track also of which character was used, and ensure the same
> character is used when interpreting them.

This was done very deliberately so as not to break any existing
scripts.  The idea is that if this went in then when the next version
was released everyone using svnmucc could just carry on as they were.
The "-c" makes it an opt-in argument.

> In the proposed solution, is there any way to provide an argument that
> ends with the escape character? In other words, if I choose '@' as the
> escape character, how could I specify the filename 'tempfile.@@@' as an
> argument? When I am a human user, I can probably choose an escape
> character that isn't found at the end of any argument, but if I am a
> script invoking svnmucc on arbitrary file names then I'd like a way to
> pass them safely.

No there isn't - i wanted to avoid any extra complexity in parsing the
lines. This way it's a simple test of the last character.  Again as it
stands this is an opt-in function and so if you're writing a script
then you would choose the character you want.  You can even just put a
space character at the end of the line which lets the @ get through
(and then the space gets's trimmed off - a bit esoteric though I
realise).

2009/7/27 Geoff Rowell <ge...@gmail.com>:
> Julian Foad wrote:
>> It's difficult to pick an escape character. I would tend to choose '\'
>> because it is so commonly used for this purpose in Unix-like systems. It
>> could be a bit awkward on Windows, but actually the "put" action is the
>> only svnmucc action that takes a local file name, and you could assume
>> that Windows users don't use svnmucc much anyway, so that could still be
>> good. If you choose '@', as in your example, although it has meaning in
>> the regular svn client I can't see it being used much in svnmucc input
>> so that could also be good.
>>
> I disagree with Julian's assertion that Windows users don't use svnmucc.
> Several people in my Windows-based office use it (and could use this
> feature). However, I can't see a problem with backslash as a continuation
> character. I'd prefer it over an "at" symbol.

We're actually only using windows here :) This was actually the main
reason for not using "\" to avoid confusion.  However with the "-c"
argument to people can chose what they want.

Cheers,
Purple

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2376228

RE: [PATCH] Give svnmucc ability to handle multiline properties

Posted by Geoff Rowell <ge...@gmail.com>.
Julian Foad wrote:
> It's difficult to pick an escape character. I would tend to choose '\'
> because it is so commonly used for this purpose in Unix-like systems. It
> could be a bit awkward on Windows, but actually the "put" action is the
> only svnmucc action that takes a local file name, and you could assume
> that Windows users don't use svnmucc much anyway, so that could still be
> good. If you choose '@', as in your example, although it has meaning in
> the regular svn client I can't see it being used much in svnmucc input
> so that could also be good.
>
I disagree with Julian's assertion that Windows users don't use svnmucc.
Several people in my Windows-based office use it (and could use this
feature). However, I can't see a problem with backslash as a continuation
character. I'd prefer it over an "at" symbol.

-Geoff

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2376045

Re: [PATCH] Give svnmucc ability to handle multiline properties

Posted by Purple Streak <mr...@googlemail.com>.
2009/9/12 Gavin 'Beau' Baumanis <ga...@thespidernet.com>:
> Hi just thought I would follow this up.
>
> The reply from Julian seem to be last one in this thread.
> Do you plan to incorporate the suggested changes?
>
>
> Gavin.
>
>
>

Hi,
Sorry. Yes I do when we've released what I'm working on currently
(whcih should be soon). Had no time to work on it :(


> On 12/08/2009, at 09:59 , Julian Foad wrote:
>
>> On Mon, 2009-08-03 at 17:01 +0100, Purple Streak wrote:
>>>
>>> 2009/7/31 Geoff Rowell <ge...@gmail.com>:
>>>>
>>>> Philip Martin <ph...@codematters.co.uk> writes:
>>>>>
>>>>> When '\' escaping was added to svn:externals it changed how paths were
>>>>> interpreted by the command line client.  That provides some sort of
>>>>> precedent for simply changing the behaviour of svnmucc.  I'd prefer to
>>>>> see '\' as an escape character without any new command line option.
>>>>> I'd want enough escaping so that '\\' at the end of a line gave a
>>>>> literal '\'.
>>>>
>>>> I agree with Philip and Julian. As long as an escape is supported, I
>>>> don't
>>>> see the need for another command line argument. I'd prefer to have
>>>> backslash
>>>> as the continuation character.
>>>
>>> Sorry - but this _will_ break existing scripts on windows so I'm
>>> really not happy having I happen just by default.   Also making
>>> windows users have to adjust there .bat files to double up \
>>> characters in paths is also not making it easy.  On Unix this is the
>>> normal escape - but windows users don't have perl/python by default
>>> and a lot just use .bat files which don't have much processing power.
>>
>> Yes.
>>
>>> So I think we have to have the -c option both to enable the behaviour
>>> and to optionally specifiy a different character (I don't think this
>>> adds any complexity to usage - it's quite simple to follow and makes
>>> it more flexible).
>>
>> I agree it would be quite simple to follow. The kind of "complexity" I
>> mentioned is the (small) amount of additional complexity a configurable
>> escape character would bring to the Subversion universe: for example,
>> you couldn't so easily share svnmucc script files with other people; and
>> a syntax-highlighting editor for svnmucc script files couldn't work
>> properly unless you also tell it what escape character you're using. But
>> I think that's OK if the configurability is important, and it seems to
>> be important. Or at least I agree it's useful to be able to use a
>> character other than backslash.
>>
>>>  The escaping for whatever character used would be
>>> nice I agree, but you'd only really want it at the end of the line
>>> which would be odd, so you'd have to have it all the way along which
>>> makes the code more complex than it needs to be imo.
>>
>> I agree with Philip that '\\' at the end of a line (assuming the escape
>> character is '\') should mean a literal '\' at the end of the line, and
>> no continuation. Further, '\\\' at the end of a line should mean '\' and
>> continuation, '\\\\' should mean '\\', '\\\\\' should mean '\\' and
>> continuation, etc.
>>
>> Without that ability to "escape the escape character", there would be no
>> way for a program to generate svnmucc scripts with arbitrary text in
>> property values and, while not the end of the world, that would be a
>> shame.
>>
>> I don't see much extra code complexity in making the escape character be
>> escapable wherever it appears (not just at the end of a line), and I
>> think that would be best.
>>
>> - Julian
>>
>> ------------------------------------------------------
>>
>> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2382738
>
>

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2398981

Re: [PATCH] Give svnmucc ability to handle multiline properties

Posted by Gavin Baumanis <ga...@thespidernet.com>.
Hi just thought I would follow this up.

The reply from Julian seem to be last one in this thread.
Do you plan to incorporate the suggested changes?


Gavin.



On 12/08/2009, at 09:59 , Julian Foad wrote:

> On Mon, 2009-08-03 at 17:01 +0100, Purple Streak wrote:
>> 2009/7/31 Geoff Rowell <ge...@gmail.com>:
>>> Philip Martin <ph...@codematters.co.uk> writes:
>>>> When '\' escaping was added to svn:externals it changed how paths  
>>>> were
>>>> interpreted by the command line client.  That provides some sort of
>>>> precedent for simply changing the behaviour of svnmucc.  I'd  
>>>> prefer to
>>>> see '\' as an escape character without any new command line option.
>>>> I'd want enough escaping so that '\\' at the end of a line gave a
>>>> literal '\'.
>>>
>>> I agree with Philip and Julian. As long as an escape is supported,  
>>> I don't
>>> see the need for another command line argument. I'd prefer to have  
>>> backslash
>>> as the continuation character.
>>
>> Sorry - but this _will_ break existing scripts on windows so I'm
>> really not happy having I happen just by default.   Also making
>> windows users have to adjust there .bat files to double up \
>> characters in paths is also not making it easy.  On Unix this is the
>> normal escape - but windows users don't have perl/python by default
>> and a lot just use .bat files which don't have much processing power.
>
> Yes.
>
>> So I think we have to have the -c option both to enable the behaviour
>> and to optionally specifiy a different character (I don't think this
>> adds any complexity to usage - it's quite simple to follow and makes
>> it more flexible).
>
> I agree it would be quite simple to follow. The kind of "complexity" I
> mentioned is the (small) amount of additional complexity a  
> configurable
> escape character would bring to the Subversion universe: for example,
> you couldn't so easily share svnmucc script files with other people;  
> and
> a syntax-highlighting editor for svnmucc script files couldn't work
> properly unless you also tell it what escape character you're using.  
> But
> I think that's OK if the configurability is important, and it seems to
> be important. Or at least I agree it's useful to be able to use a
> character other than backslash.
>
>>  The escaping for whatever character used would be
>> nice I agree, but you'd only really want it at the end of the line
>> which would be odd, so you'd have to have it all the way along which
>> makes the code more complex than it needs to be imo.
>
> I agree with Philip that '\\' at the end of a line (assuming the  
> escape
> character is '\') should mean a literal '\' at the end of the line,  
> and
> no continuation. Further, '\\\' at the end of a line should mean '\'  
> and
> continuation, '\\\\' should mean '\\', '\\\\\' should mean '\\' and
> continuation, etc.
>
> Without that ability to "escape the escape character", there would  
> be no
> way for a program to generate svnmucc scripts with arbitrary text in
> property values and, while not the end of the world, that would be a
> shame.
>
> I don't see much extra code complexity in making the escape  
> character be
> escapable wherever it appears (not just at the end of a line), and I
> think that would be best.
>
> - Julian
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2382738

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2393769

Re: [PATCH] Give svnmucc ability to handle multiline properties

Posted by Julian Foad <ju...@btopenworld.com>.
On Mon, 2009-08-03 at 17:01 +0100, Purple Streak wrote:
> 2009/7/31 Geoff Rowell <ge...@gmail.com>:
> > Philip Martin <ph...@codematters.co.uk> writes:
> >> When '\' escaping was added to svn:externals it changed how paths were
> >> interpreted by the command line client.  That provides some sort of
> >> precedent for simply changing the behaviour of svnmucc.  I'd prefer to
> >> see '\' as an escape character without any new command line option.
> >> I'd want enough escaping so that '\\' at the end of a line gave a
> >> literal '\'.
> >
> > I agree with Philip and Julian. As long as an escape is supported, I don't
> > see the need for another command line argument. I'd prefer to have backslash
> > as the continuation character.
> 
> Sorry - but this _will_ break existing scripts on windows so I'm
> really not happy having I happen just by default.   Also making
> windows users have to adjust there .bat files to double up \
> characters in paths is also not making it easy.  On Unix this is the
> normal escape - but windows users don't have perl/python by default
> and a lot just use .bat files which don't have much processing power.

Yes.

> So I think we have to have the -c option both to enable the behaviour
> and to optionally specifiy a different character (I don't think this
> adds any complexity to usage - it's quite simple to follow and makes
> it more flexible).

I agree it would be quite simple to follow. The kind of "complexity" I
mentioned is the (small) amount of additional complexity a configurable
escape character would bring to the Subversion universe: for example,
you couldn't so easily share svnmucc script files with other people; and
a syntax-highlighting editor for svnmucc script files couldn't work
properly unless you also tell it what escape character you're using. But
I think that's OK if the configurability is important, and it seems to
be important. Or at least I agree it's useful to be able to use a
character other than backslash.

>   The escaping for whatever character used would be
> nice I agree, but you'd only really want it at the end of the line
> which would be odd, so you'd have to have it all the way along which
> makes the code more complex than it needs to be imo.

I agree with Philip that '\\' at the end of a line (assuming the escape
character is '\') should mean a literal '\' at the end of the line, and
no continuation. Further, '\\\' at the end of a line should mean '\' and
continuation, '\\\\' should mean '\\', '\\\\\' should mean '\\' and
continuation, etc.

Without that ability to "escape the escape character", there would be no
way for a program to generate svnmucc scripts with arbitrary text in
property values and, while not the end of the world, that would be a
shame.

I don't see much extra code complexity in making the escape character be
escapable wherever it appears (not just at the end of a line), and I
think that would be best.

- Julian

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2382738

Re: [PATCH] Give svnmucc ability to handle multiline properties

Posted by Purple Streak <mr...@googlemail.com>.
2009/7/31 Geoff Rowell <ge...@gmail.com>:
> Philip Martin <ph...@codematters.co.uk> writes:
>> When '\' escaping was added to svn:externals it changed how paths were
>> interpreted by the command line client.  That provides some sort of
>> precedent for simply changing the behaviour of svnmucc.  I'd prefer to
>> see '\' as an escape character without any new command line option.
>> I'd want enough escaping so that '\\' at the end of a line gave a
>> literal '\'.
>
> I agree with Philip and Julian. As long as an escape is supported, I don't
> see the need for another command line argument. I'd prefer to have backslash
> as the continuation character.

Sorry - but this _will_ break existing scripts on windows so I'm
really not happy having I happen just by default.   Also making
windows users have to adjust there .bat files to double up \
characters in paths is also not making it easy.  On Unix this is the
normal escape - but windows users don't have perl/python by default
and a lot just use .bat files which don't have much processing power.

So I think we have to have the -c option both to enable the behaviour
and to optionally specifiy a different character (I don't think this
adds any complexity to usage - it's quite simple to follow and makes
it more flexible).  The escaping for whatever character used would be
nice I agree, but you'd only really want it at the end of the line
which would be odd, so you'd have to have it all the way along which
makes the code more complex than it needs to be imo.

Cheers,
Purple

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2379578


Re: [PATCH] Give svnmucc ability to handle multiline properties

Posted by Philip Martin <ph...@codematters.co.uk>.
"Geoff Rowell" <ge...@gmail.com> writes:

> Philip Martin <ph...@codematters.co.uk> writes:
>> 
>> When '\' escaping was added to svn:externals it changed how paths were
>> interpreted by the command line client.  That provides some sort of
>> precedent for simply changing the behaviour of svnmucc.  I'd prefer to
>> see '\' as an escape character without any new command line option.
>> I'd want enough escaping so that '\\' at the end of a line gave a
>> literal '\'.
>
> I agree with Philip and Julian. As long as an escape is supported, I don't
> see the need for another command line argument. I'd prefer to have backslash
> as the continuation character.

On reflection I think this file could be binary data, because property
values can be binary, so there will need to be a command line option.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2377486

RE: [PATCH] Give svnmucc ability to handle multiline properties

Posted by Geoff Rowell <ge...@gmail.com>.
Philip Martin <ph...@codematters.co.uk> writes:
> Julian Foad <ju...@btopenworld.com> writes:
> > Making the escape character configurable seems overly complex - not
> > complexity of implementation, but the sort of complexity that means any
> > time you store or automatically generate svnmucc commands you would then
> > have to keep track also of which character was used, and ensure the same
> > character is used when interpreting them.
> >
> > I would just pick one escape character and specify that at end of line
> > it means include the end-of-line character(s) and continue the argument
> > on the next line; if doubled, include just one copy of itself; otherwise
> > it's an error.
> >
> > It's difficult to pick an escape character. I would tend to choose '\'
> > because it is so commonly used for this purpose in Unix-like systems. It
> 
> When '\' escaping was added to svn:externals it changed how paths were
> interpreted by the command line client.  That provides some sort of
> precedent for simply changing the behaviour of svnmucc.  I'd prefer to
> see '\' as an escape character without any new command line option.
> I'd want enough escaping so that '\\' at the end of a line gave a
> literal '\'.

I agree with Philip and Julian. As long as an escape is supported, I don't
see the need for another command line argument. I'd prefer to have backslash
as the continuation character.

-Geoff

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2377483

Re: [PATCH] Give svnmucc ability to handle multiline properties

Posted by Philip Martin <ph...@codematters.co.uk>.
Julian Foad <ju...@btopenworld.com> writes:

> Making the escape character configurable seems overly complex - not
> complexity of implementation, but the sort of complexity that means any
> time you store or automatically generate svnmucc commands you would then
> have to keep track also of which character was used, and ensure the same
> character is used when interpreting them.
>
> I would just pick one escape character and specify that at end of line
> it means include the end-of-line character(s) and continue the argument
> on the next line; if doubled, include just one copy of itself; otherwise
> it's an error.
>
> It's difficult to pick an escape character. I would tend to choose '\'
> because it is so commonly used for this purpose in Unix-like systems. It

When '\' escaping was added to svn:externals it changed how paths were
interpreted by the command line client.  That provides some sort of
precedent for simply changing the behaviour of svnmucc.  I'd prefer to
see '\' as an escape character without any new command line option.
I'd want enough escaping so that '\\' at the end of a line gave a
literal '\'.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2377403

Re: [PATCH] Give svnmucc ability to handle multiline properties

Posted by Julian Foad <ju...@btopenworld.com>.
On Sun, 2009-07-26, Gavin Baumanis wrote:
> Ping.
> This submission has received no comments.

My comments are:

It seems a good idea to extend svnmucc's "-X" syntax in some way to
enable multi-line arguments.

In the proposed solution, is there any way to provide an argument that
ends with the escape character? In other words, if I choose '@' as the
escape character, how could I specify the filename 'tempfile.@@@' as an
argument? When I am a human user, I can probably choose an escape
character that isn't found at the end of any argument, but if I am a
script invoking svnmucc on arbitrary file names then I'd like a way to
pass them safely.

Making the escape character configurable seems overly complex - not
complexity of implementation, but the sort of complexity that means any
time you store or automatically generate svnmucc commands you would then
have to keep track also of which character was used, and ensure the same
character is used when interpreting them.

I would just pick one escape character and specify that at end of line
it means include the end-of-line character(s) and continue the argument
on the next line; if doubled, include just one copy of itself; otherwise
it's an error.

It's difficult to pick an escape character. I would tend to choose '\'
because it is so commonly used for this purpose in Unix-like systems. It
could be a bit awkward on Windows, but actually the "put" action is the
only svnmucc action that takes a local file name, and you could assume
that Windows users don't use svnmucc much anyway, so that could still be
good. If you choose '@', as in your example, although it has meaning in
the regular svn client I can't see it being used much in svnmucc input
so that could also be good.

- Julian


> On 16/07/2009, at 20:47 , Purple Streak wrote:
> 
> > Hi,
> > We use svnmucc to update externals properties as part of our build
> > process.  As it is svnmucc doesn't allow multi-line property values
> > when used with -X as each newline in the extra args file means a new
> > argument.  This is patch which we've been using to allow this.  If the
> > argument isn't used then the behaviour is unchanged.
> >
> > [[[
> > Allow svnmucc to set multiline properties.  This is done by adding  
> > an optional
> > -c (--continuation-char) argument which takes a single character  
> > argument.
> > Any lines in the --extra-args file ending with that character will  
> > then not
> > terminate the current argument.
> >
> > * tools/client-side/svnmucc/svnmucc.c
> >  (read_extra_args)  New external file argument parsing function
> >  (usage) Updated with new argument
> >  (main) Update to accept new argument and call read_extra_args
> > ]]]
> >
> > As an example we are using '-c @' on a file with:
> >
> > svnmucc.exe -m "hello" -c @ -X multi-line.txt
> >
> > Where multi-line.txt is
> >
> > propset
> > svn:externals
> > -r52792 /svn/Repo/Pools/Shared/Stuff@
> > -r52792 /svn/Repo/Pools/Shared/MoreStuff
> > https://source01/svn/Sandbox/testA

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2375974

Re: [PATCH] Give svnmucc ability to handle multiline properties

Posted by Gavin Baumanis <ga...@thespidernet.com>.
Ping.
This submission has received no comments.

Gavin.


On 16/07/2009, at 20:47 , Purple Streak wrote:

> Hi,
> We use svnmucc to update externals properties as part of our build
> process.  As it is svnmucc doesn't allow multi-line property values
> when used with -X as each newline in the extra args file means a new
> argument.  This is patch which we've been using to allow this.  If the
> argument isn't used then the behaviour is unchanged.
>
> [[[
> Allow svnmucc to set multiline properties.  This is done by adding  
> an optional
> -c (--continuation-char) argument which takes a single character  
> argument.
> Any lines in the --extra-args file ending with that character will  
> then not
> terminate the current argument.
>
> * tools/client-side/svnmucc/svnmucc.c
>  (read_extra_args)  New external file argument parsing function
>  (usage) Updated with new argument
>  (main) Update to accept new argument and call read_extra_args
> ]]]
>
> As an example we are using '-c @' on a file with:
>
> svnmucc.exe -m "hello" -c @ -X multi-line.txt
>
> Where multi-line.txt is
>
> propset
> svn:externals
> -r52792 /svn/Repo/Pools/Shared/Stuff@
> -r52792 /svn/Repo/Pools/Shared/MoreStuff
> https://source01/svn/Sandbox/testA
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2371714 
> <svnpatch.txt>

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2375649