You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Варфоломеев Игорь <i3...@mail.ru> on 2013/07/09 04:32:42 UTC
svn move and sign in filepath
Hi all,
I think, I ran into a bug:
although svn book declares “add one more @-sign” principle
(http://svnbook.red-bean.com/en/1.7/svn.advanced.pegrevs.html ),
it looks like it’s working incorrectly in case of “svn move”.
%svn% move wc\@2.txt@ wc\A\@2.txt@
- this would result in “wc\A\@2.txt@” file, instead of “wc\A\@2.txt”.
It’s noteworthy, that “svn copy” works as it should.
Please, find the full reproduction script here: https://skydrive.live.com/redir?resid=8FD4EC3161ABA67A!939 .
tested on svn, version 1.8.0 (r1490375);
compiled Jun 17 2013, 19:47:41 on x86-microsoft-windows.
(Part of Tortoise SVN 1.8.0 x64 <at> Win7 x64).
PS
I’m not subscribed and would appreciate being explicitly Cc:ed in any responses.
Best regards,
Igor Varfolomeev
RE: svn move and sign in filepath
Posted by Варфоломеев Игорь <i3...@mail.ru>.
> From: 'Daniel Shahaf' [mailto:d.s@daniel.shahaf.name]
> Sent: Wednesday, July 10, 2013 9:53 PM
>
> I am sure similar points were made on dev@ when the 'svn add
> foo@' problem was discussed there last year (that's part of the reason I
> asked you to search for already-filed issues before filing an issue about add:
> it's possible we decided to followthe semantics you describe, so even 'svn
> add' targets require peg escaping for consistency).
I think I've just found the discussion you're talking about:
http://thread.gmane.org/gmane.comp.version-control.subversion.devel/129600
Indeed, two similar issues are mentioned there:
http://subversion.tigris.org/issues/show_bug.cgi?id=3416
http://subversion.tigris.org/issues/show_bug.cgi?id=3651
but they are both marked as "RESOLVED"...
Issue #3651 looks very similar...
Thanks for the hint!
I've also just added an according notice to Issue #4392
( http://subversion.tigris.org/issues/show_bug.cgi?id=4392 )
As for test script - I think it might be quite similar to
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/copy_tests.py?annotate=952992&pathrev=952992
test, designed for issue #3651
(it's referenced in http://thread.gmane.org/gmane.comp.version-control.subversion.devel/129600 ).
> Would you be interested in writing patches and/or regression tests for these
> issues?
I'd love to, but I've got a couple of deadlines ahead in a couple of weeks...
Maybe... If no one else would fix this before...
Re: svn move and sign in filepath
Posted by 'Daniel Shahaf' <d....@daniel.shahaf.name>.
Варфоломеев Игорь wrote on Wed, Jul 10, 2013 at 06:40:39 +0400:
> > From: 'Daniel Shahaf' [mailto:d.s@daniel.shahaf.name]
> > Sent: Wednesday, July 10, 2013 5:45 AM
> >
> > The question is whether we should not be parsing peg revisions in some
> > places. The target arguments to 'add' seem like a clear-cut case. The 'dest'
> > argument of move seems like such a case too: assuming Q is a versioned
> > directory, what would be the meaning of, say, 'svn move alpha beta gamma
> > Q@r42'?
>
> This is not my call, of course, I don't see the whole picture.
> But, as for me, it's easier to parse peg revision in all cases.
> (And throw error if specifying a revision is not supported)
> In this case:
> * User-interface is more "uniform". User won't need to remember, whether this command is able to handle revision each time.
> * If you're writing a wrapper for svn, you would need only one "svn_path = make_svn_path(path,rev)" function.
> You won't need to pass any weired additional arguments to it.
> * One can imagine, theoretically, that there's a svn command, that is not supporting revision specification first,
> but this functionality might be added in next release. So, in case it now "parses peg revision" but it was not
> parsing it before - some 3rd party scripts might become incompatible.
> * It's harder to get unexpected results.
> If user is doing something wrong, he would run into an error message,
> which is, often, much better that getting unexpected result.
>
Fair points. I am sure similar points were made on dev@ when the 'svn
add foo@' problem was discussed there last year (that's part of the
reason I asked you to search for already-filed issues before filing an
issue about add: it's possible we decided to followthe semantics you
describe, so even 'svn add' targets require peg escaping for
consistency).
>
> Anyway, I don't like the way svn move works with @-files:
> Both
> svn move wc\@2.txt@ wc\A\@2.txt@
> and
> svn move wc\@3.txt@ wc\A\@3.txt
> Provide strange results:
> "wc\A\@2.txt@" in first case
> "wc\A@3.txt" in second case.
>
> (see batch file attached)
>
> But how do I get "wc\A\@4.txt" ?
I don't think you can. Please file a bug.
Workarounds:
- Use copy followed by delete of the source.
Problem: in the future we will implement true renames, which are real
renames distinct from copy+delete. So that's not a good habit to
get into.
- Use the bindings to call svn_client_move() directly, bypssing svn's
peg revision parsing.
Would you be interested in writing patches and/or regression tests for
these issues? See https://subversion.apache.org/patches and
https://svn.apache.org/repos/asf/subversion/trunk/subversion/tests/cmdline/README
RE: svn move and sign in filepath
Posted by Варфоломеев Игорь <i3...@mail.ru>.
> From: 'Daniel Shahaf' [mailto:d.s@daniel.shahaf.name]
> Sent: Wednesday, July 10, 2013 5:45 AM
>
> The question is whether we should not be parsing peg revisions in some
> places. The target arguments to 'add' seem like a clear-cut case. The 'dest'
> argument of move seems like such a case too: assuming Q is a versioned
> directory, what would be the meaning of, say, 'svn move alpha beta gamma
> Q@r42'?
This is not my call, of course, I don't see the whole picture.
But, as for me, it's easier to parse peg revision in all cases.
(And throw error if specifying a revision is not supported)
In this case:
* User-interface is more "uniform". User won't need to remember, whether this command is able to handle revision each time.
* If you're writing a wrapper for svn, you would need only one "svn_path = make_svn_path(path,rev)" function.
You won't need to pass any weired additional arguments to it.
* One can imagine, theoretically, that there's a svn command, that is not supporting revision specification first,
but this functionality might be added in next release. So, in case it now "parses peg revision" but it was not
parsing it before - some 3rd party scripts might become incompatible.
* It's harder to get unexpected results.
If user is doing something wrong, he would run into an error message,
which is, often, much better that getting unexpected result.
Anyway, I don't like the way svn move works with @-files:
Both
svn move wc\@2.txt@ wc\A\@2.txt@
and
svn move wc\@3.txt@ wc\A\@3.txt
Provide strange results:
"wc\A\@2.txt@" in first case
"wc\A@3.txt" in second case.
(see batch file attached)
But how do I get "wc\A\@4.txt" ?
Re: svn move and sign in filepath
Posted by 'Daniel Shahaf' <d....@daniel.shahaf.name>.
Варфоломеев Игорь wrote on Wed, Jul 10, 2013 at 05:22:49 +0400:
> > From: Daniel Shahaf [mailto:d.s@daniel.shahaf.name]
> > Sent: Tuesday, July 09, 2013 9:30 PM
> >
>
> > Can you please file an issue for this?
>
> OK. I've just created the issue: http://subversion.tigris.org/issues/show_bug.cgi?id=4392
> Thank you!
>
>
> > (It's probably "bar@" that's the correct desination name in this case.)
>
> Em... is it?
> I thought, " svn cares only about the last at sign in the argument, and it is not considered
> illegal to omit a literal peg revision specifier after that at sign. "
> ( http://svnbook.red-bean.com/en/1.7/svn.advanced.pegrevs.html )
> means that only "@" in "svn copy foo bar@" is considered as an "at-sign for revision".
The rule for parsing a peg revision from a string is: if '@' is present,
everything up to and not including the rightmost '@' is the path, and
everything to the left of the rightmost '@' is the peg; else, the peg is
unspecified.
As it happens, an empty string after the rightmost @ is valid. That's
why appending an '@' to a filename escapes it (regardless of whether the
filename includes an '@' sign or not).
The question is whether we should not be parsing peg revisions in some
places. The target arguments to 'add' seem like a clear-cut case. The
'dest' argument of move seems like such a case too: assuming Q is
a versioned directory, what would be the meaning of, say,
'svn move alpha beta gamma Q@r42'?
RE: svn move and sign in filepath
Posted by Варфоломеев Игорь <i3...@mail.ru>.
> From: Daniel Shahaf [mailto:d.s@daniel.shahaf.name]
> Sent: Tuesday, July 09, 2013 9:30 PM
>
> Can you please file an issue for this?
OK. I've just created the issue: http://subversion.tigris.org/issues/show_bug.cgi?id=4392
Thank you!
> (It's probably "bar@" that's the correct desination name in this case.)
Em... is it?
I thought, " svn cares only about the last at sign in the argument, and it is not considered
illegal to omit a literal peg revision specifier after that at sign. "
( http://svnbook.red-bean.com/en/1.7/svn.advanced.pegrevs.html )
means that only "@" in "svn copy foo bar@" is considered as an "at-sign for revision".
Re: svn move and sign in filepath
Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
I agree that it's a bug that, given a file 'foo', when 'bar' does not
exist[1],
svn copy foo bar@
and
svn move foo bar@
don't create a destination file with the same name. (It's probably
"bar@" that's the correct desination name in this case.) Can you please
file an issue for this?
Thanks
Daniel
Варфоломеев Игорь wrote on Tue, Jul 09, 2013 at 06:32:42 +0400:
> Hi all,
>
>
>
> I think, I ran into a bug:
>
>
>
> although svn book declares “add one more @-sign” principle
>
> (http://svnbook.red-bean.com/en/1.7/svn.advanced.pegrevs.html ),
>
> it looks like it’s working incorrectly in case of “svn move”.
>
>
>
> %svn% move wc\@2.txt@ wc\A\@2.txt@
>
>
>
> - this would result in “wc\A\@2.txt@” file, instead of “wc\A\@2.txt”.
>
>
>
>
>
> It’s noteworthy, that “svn copy” works as it should.
>
>
>
> Please, find the full reproduction script here: https://skydrive.live.com/redir?resid=8FD4EC3161ABA67A!939 .
>
>
>
> tested on svn, version 1.8.0 (r1490375);
>
> compiled Jun 17 2013, 19:47:41 on x86-microsoft-windows.
>
> (Part of Tortoise SVN 1.8.0 x64 <at> Win7 x64).
>
>
>
>
>
> PS
>
> I’m not subscribed and would appreciate being explicitly Cc:ed in any responses.
>
>
>
>
>
> Best regards,
>
> Igor Varfolomeev
>
>
>