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

RE: Re: svncopy.pl: option --file

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Fri, 26 Dec 2008 22:05:18 +0200 (Jerusalem Standard Time)

dario.borreguero_at_gmail.com wrote on Fri, 26 Dec 2008 at 10:46 -0800:
> Understand it!
>
> Then, I can say I found a bug.
>

Agreed.

> First, whenever you execute:
>
> "svncopy.pl -F comment.txt --pin-externals url/to/source
> url/to/destination"
>
> It raises the error:
>
> Subcommand 'checkout' doesn't accept '-F [--file] PAR' option.
>
> As I stated before. Because it is parsed (line 95) and included like
> any other svn option, the problem is that the first svn subcommand to
> execute is 'checkout' that it does not admit -F[--file] PAR option.
>

Off-topic, if I read the code correctly, the same problem you report
with -F will also happen with --force-log (and maybe with --quiet?).

> Secondly, as you told me, --file PAR option is internally used by 'svn
> propset'. But it does nothing to do with the -F[--file] PAR option
> that receives svncopy.pl script.
>
> Therefore, the code should be changed according to one of the
> following options:
>
> a) Just ignore this option (-F[--file] PAR). And thefore update the
> documentation indicating this. Because, at first sight and without
> changing anything, I understand that I can use -F[--file] PAR option
> as a comment like in any other svn subcommand that admits it. For
> example, creating a tag, this file could be the followed roadmap
> (that contains newlines) to get that version/tag.
>
> Following your instructions I understand that it shouldn't be used to
> add a comment. I should use -m MSG option instead.
>
> b) Just using it like -m MSG option (but not both at the same time,
> like you told me). And therefore, change the code as I described
> previously (line 95).
>

In other words, svncopy.pl will take both -F and -m, but will translate
them both internally to '$message'; which is already used properly, i.e.
is not passed to commands that don't expect a log message.

Yes, sounds like a good plan.

> I hope you understand my explanation.
>

Now I understand. Thanks for going through it again.

> Thanks for your feedback.
>
> DarĂ­o.
>

Thanks for the patch. I tried to test it, but it seems that I can't run
svncopy.pl at all here (the last error I got was '''Can't call method
"temp_dir" on an undefined value'''). Hopefully someone else will test
the patch and commit it.

Thanks,

Daniel

> > dario.borreguero_at_gmail.com wrote on Fri, 12 Dec 2008 at 03:47 -0800:
> > > Hi,
> > >
> > > I'm not sure if this should be a bug. I'll explain it below:
> > >
> > > I've started to use 'svncopy.pl' script and I found that if I try to
> > > add comments from a file, as I did with 'svn copy' subcommmand. It
> > > doesn't work.
> > >
> > > I returns the error message: Subcommand 'checkout' doesn't accept '-F
> > > [--file] PAR' option.
> > >
> >
> > Then don't pass -F to 'svn checkout'. (And "PAR" isn't part of our
> > output, where did it come from?)
> >
> > > I wonder why it tries to insert that file as an option for all the svn
> > > subcommand that are used within svncopy.pl script.
> > >
> > > I've looked into the code and I finally decided to change the line 95
> > > after checking that 'svn copy -m "Message" --file messages.txt'
> > > ignores the -m option and uses the file for comments.
> > >
> >
> > No. If you specify the log message using both -m and -F, you get
> > *undefined behaviour*. Don't do this.
> >
> > > Therefore,
> > >
> > > [95] "file|F=s" => sub { push(@svn_options, "--file", $_[1]) },
> > >
> > > to
> > >
> > > [95] "file|F=s" => sub { open FILE, $_[1]; my @content = <FILE>;
> > > $message = join("\n", @content); close FILE; },
> > >
> > > Before assuming that my change is correct or it shouldn't be done.
> > > I wonder if the option --file PAR is used with another intention than
> > > to use it as commit comment??
> > >
> >
> > Yes, by 'svn propset' at least.
> >
> > > I hope this helps,
> > >
> > > Dario.
> > >
> > > ------------------------------------------------------
> > > http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=983363
> > >
>

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=993186
Received on 2008-12-26 21:33:13 CET

This is an archived mail posted to the Subversion Dev mailing list.