You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Marian Petras <ma...@sun.com> on 2009/05/25 17:41:16 UTC

sequence "/@" in file path causes failure - Subversion bug?

Hello,

I am re-posting this question about a possible bug in Svn because I got 
no response on the users' mailing list (for the original e-mail, see 
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2300569).

I cannot 'svn add' or 'svn commit' a file if the file's name starts with 
an at sign (@) and the specified file path contains at least one 
directory element.

For example, I would expect the following behavior:

     $ svn add 'dir/@File.txt'
     A         dir/@File.txt

but I get

     $ svn add 'dir/@File.txt'
     svn: warning: 'dir@File.txt' not found

(Note the missing slash in the Svn output.)

Appending an extra at sign to the end of the path does not help:

     $ svn add 'dir/@File.txt@'
     svn: warning: 'dir/@File.txt@' not found

Now the slash was maintained but the trailing at sign was maintained, 
too, which makes the path invalid.

This issue can be quite easily worked around by first changing to the 
directory containing the file, invoking "svn add @File.txt" (i.e. 
without any directory element in the file's path) and changing back to 
the original directory:

     $ cd dir
     $ svn add '@File.txt'
     A         @File.txt
     $ cd ..

The more serious problem is that 'svn commit' fails the same way:

     $ svn commit -m 'added file' 'dir/@File.txt'
     svn: Commit failed (details follow):
     svn: '/home/mp/wc/dir@File.txt' is not under version control

     $ svn commit -m 'added file' 'dir/@File.txt@'
     svn: Commit failed (details follow):
     svn: '/home/mp/wc/dir/@File.txt@' is not under version control

In some cases, this issue can be worked around by committing the whole 
directory. But it is not an option if a subset of files in the given 
directory is to be committed.

I attached a test script (for Unix-like systems). It creates two 
subdirectories in the current directory ("working-copy", "test-repo") 
and runs a test on them, displaying the executed commands on the console 
as if invoked by the user.

Environment:

Operating system:

     Linux - Debian Lenny running on x86-64

Subversion info:

   Svn version 1.6.2 (r37639), compiled with:

      gcc (Debian 4.3.2-1.1) 4.3.2

      Configuration options:

           --with-berkeley-db=db.h:/usr/include:/usr/lib:db-4.6
           --with-gnome-keyring
           --enable-javahl
           --with-jdk=/usr/local/java/jdk1.5.0_18
           --with-junit=/usr/local/java/junit3.8.1/junit.jar

      uname -m = x86_64
      uname -r = 2.6.26-1-amd64
      uname -s = Linux
      uname -v = #1 SMP Fri Mar 13 17:46:45 UTC 2009

   No private modifications.

   Berkeley DB: 4.6

The problem is only with the command-line client. When JavaHL is used to 
invoke the equivalent commands, everything works. This was discovered 
during evaluation of a bug reported to the NetBeans project 
(http://www.netbeans.org/issues/show_bug.cgi?id=165329). The Subversion 
module of the NetBeans IDE prefers JavaHL but if it does not find one, 
it falls back to using the command-line client.

I have also reproduced this behavior on the following systems:

     Linux (Debian Lenny, x86-64)
     Subversion version 1.5.1 (r32289)

     Linux (openSUSE, x86-64)
     Subversion version 1.6.0 (r36650)

     Windows XP 32-bit
     Subversion version 1.6.1 (r37116)


Marián Petráš
developer of the NetBeans IDE

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

Re: sequence "/@" in file path causes failure - Subversion bug?

Posted by Zing <zi...@fastmail.fm>.
On Mon, 25 May 2009, Marian Petras wrote:

> but I get
>
>      $ svn add 'dir/@File.txt'
>      svn: warning: 'dir@File.txt' not found

I posted what might be similar problem I was having searching history with
the working copy:

http://subversion.tigris.org/ds/viewMessage.do?dsMessageId=1221514&dsForumId=1065

It looks like the operations on the local working copy aren't as
functional as operations done directly to the server.  I was hoping the
new working copy code would help, but I still got similar errors.

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

Re: sequence "/@" in file path causes failure - Subversion bug?

Posted by Marian Petras <ma...@sun.com>.
Reported as bug #3416 
(http://subversion.tigris.org/issues/show_bug.cgi?id=3416).

Marián


Marian Petras wrote:
> Hello,
> 
> I am re-posting this question about a possible bug in Svn because I got 
> no response on the users' mailing list (for the original e-mail, see 
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2300569).
> 
> I cannot 'svn add' or 'svn commit' a file if the file's name starts with 
> an at sign (@) and the specified file path contains at least one 
> directory element.
> 
> For example, I would expect the following behavior:
> 
>      $ svn add 'dir/@File.txt'
>      A         dir/@File.txt
> 
> but I get
> 
>      $ svn add 'dir/@File.txt'
>      svn: warning: 'dir@File.txt' not found
> 
> (Note the missing slash in the Svn output.)
> 
> Appending an extra at sign to the end of the path does not help:
> 
>      $ svn add 'dir/@File.txt@'
>      svn: warning: 'dir/@File.txt@' not found
> 
> Now the slash was maintained but the trailing at sign was maintained, 
> too, which makes the path invalid.
> 
> This issue can be quite easily worked around by first changing to the 
> directory containing the file, invoking "svn add @File.txt" (i.e. 
> without any directory element in the file's path) and changing back to 
> the original directory:
> 
>      $ cd dir
>      $ svn add '@File.txt'
>      A         @File.txt
>      $ cd ..
> 
> The more serious problem is that 'svn commit' fails the same way:
> 
>      $ svn commit -m 'added file' 'dir/@File.txt'
>      svn: Commit failed (details follow):
>      svn: '/home/mp/wc/dir@File.txt' is not under version control
> 
>      $ svn commit -m 'added file' 'dir/@File.txt@'
>      svn: Commit failed (details follow):
>      svn: '/home/mp/wc/dir/@File.txt@' is not under version control
> 
> In some cases, this issue can be worked around by committing the whole 
> directory. But it is not an option if a subset of files in the given 
> directory is to be committed.
> 
> I attached a test script (for Unix-like systems). It creates two 
> subdirectories in the current directory ("working-copy", "test-repo") 
> and runs a test on them, displaying the executed commands on the console 
> as if invoked by the user.
> 
> Environment:
> 
> Operating system:
> 
>      Linux - Debian Lenny running on x86-64
> 
> Subversion info:
> 
>    Svn version 1.6.2 (r37639), compiled with:
> 
>       gcc (Debian 4.3.2-1.1) 4.3.2
> 
>       Configuration options:
> 
>            --with-berkeley-db=db.h:/usr/include:/usr/lib:db-4.6
>            --with-gnome-keyring
>            --enable-javahl
>            --with-jdk=/usr/local/java/jdk1.5.0_18
>            --with-junit=/usr/local/java/junit3.8.1/junit.jar
> 
>       uname -m = x86_64
>       uname -r = 2.6.26-1-amd64
>       uname -s = Linux
>       uname -v = #1 SMP Fri Mar 13 17:46:45 UTC 2009
> 
>    No private modifications.
> 
>    Berkeley DB: 4.6
> 
> The problem is only with the command-line client. When JavaHL is used to 
> invoke the equivalent commands, everything works. This was discovered 
> during evaluation of a bug reported to the NetBeans project 
> (http://www.netbeans.org/issues/show_bug.cgi?id=165329). The Subversion 
> module of the NetBeans IDE prefers JavaHL but if it does not find one, 
> it falls back to using the command-line client.
> 
> I have also reproduced this behavior on the following systems:
> 
>      Linux (Debian Lenny, x86-64)
>      Subversion version 1.5.1 (r32289)
> 
>      Linux (openSUSE, x86-64)
>      Subversion version 1.6.0 (r36650)
> 
>      Windows XP 32-bit
>      Subversion version 1.6.1 (r37116)
> 
> 
> Marián Petráš
> developer of the NetBeans IDE
> 
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2353599
>

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


Re: sequence "/@" in file path causes failure - Subversion bug?

Posted by "B. Smith-Mannschott" <bs...@gmail.com>.
On Tue, May 26, 2009 at 09:45, Andreas Schweigstill
<an...@schweigstill.de> wrote:
> Hello!
>
> B. Smith-Mannschott schrieb:
>> This is not a bug. When Subversion sees the last (or only) "@" in a
>> path, it expects what follows to be a peg revision. The escaping
>> mechanism for paths containing "@", where you don't want to specify a
>> peg revision is to terminate the path with "@":
>>
>> /trunk/@somefile@
>
> But that's what Marian already did:
>  >> Appending an extra at sign to the end of the path does not help:
>  >>
>  >>      $ svn add 'dir/@File.txt@'
>  >>      svn: warning: 'dir/@File.txt@' not found
>  >>
>  >> Now the slash was maintained but the trailing at sign was maintained,
>  >> too, which makes the path invalid.
>
> The big difference is that Marian specifies a path in the WC, not in
> the repository.

Ah! you're quite right! I didn't read the the original message
carefully enough. Eager greedy pattern recognition strikes again.

// Ben

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


Re: sequence "/@" in file path causes failure - Subversion bug?

Posted by Marian Petras <ma...@sun.com>.
I got a confirmation via IRC.

Marián


Marian Petras wrote:
> Thank you,
> 
> can you confirm it is a bug?
> 
> Thank you.
> 
> Marián
> 
> 
> Andreas Schweigstill wrote:
>> Hello!
>>
>> B. Smith-Mannschott schrieb:
>>> This is not a bug. When Subversion sees the last (or only) "@" in a
>>> path, it expects what follows to be a peg revision. The escaping
>>> mechanism for paths containing "@", where you don't want to specify a
>>> peg revision is to terminate the path with "@":
>>>
>>> /trunk/@somefile@
>> But that's what Marian already did:
>>  >> Appending an extra at sign to the end of the path does not help:
>>  >>
>>  >>      $ svn add 'dir/@File.txt@'
>>  >>      svn: warning: 'dir/@File.txt@' not found
>>  >>
>>  >> Now the slash was maintained but the trailing at sign was maintained,
>>  >> too, which makes the path invalid.
>>
>> The big difference is that Marian specifies a path in the WC, not in
>> the repository.
>>
>> Regards
>> Andreas Schweigstill
>>
> 
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2355793

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


Re: sequence "/@" in file path causes failure - Subversion bug?

Posted by Marian Petras <ma...@sun.com>.
Thank you,

can you confirm it is a bug?

Thank you.

Marián


Andreas Schweigstill wrote:
> Hello!
> 
> B. Smith-Mannschott schrieb:
>> This is not a bug. When Subversion sees the last (or only) "@" in a
>> path, it expects what follows to be a peg revision. The escaping
>> mechanism for paths containing "@", where you don't want to specify a
>> peg revision is to terminate the path with "@":
>>
>> /trunk/@somefile@
> 
> But that's what Marian already did:
>  >> Appending an extra at sign to the end of the path does not help:
>  >>
>  >>      $ svn add 'dir/@File.txt@'
>  >>      svn: warning: 'dir/@File.txt@' not found
>  >>
>  >> Now the slash was maintained but the trailing at sign was maintained,
>  >> too, which makes the path invalid.
> 
> The big difference is that Marian specifies a path in the WC, not in
> the repository.
> 
> Regards
> Andreas Schweigstill
>

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


Re: sequence "/@" in file path causes failure - Subversion bug?

Posted by Andreas Schweigstill <an...@schweigstill.de>.
Hello!

B. Smith-Mannschott schrieb:
> This is not a bug. When Subversion sees the last (or only) "@" in a
> path, it expects what follows to be a peg revision. The escaping
> mechanism for paths containing "@", where you don't want to specify a
> peg revision is to terminate the path with "@":
> 
> /trunk/@somefile@

But that's what Marian already did:
 >> Appending an extra at sign to the end of the path does not help:
 >>
 >>      $ svn add 'dir/@File.txt@'
 >>      svn: warning: 'dir/@File.txt@' not found
 >>
 >> Now the slash was maintained but the trailing at sign was maintained,
 >> too, which makes the path invalid.

The big difference is that Marian specifies a path in the WC, not in
the repository.

Regards
Andreas Schweigstill

-- 
BITTE BEACHTEN SIE UNSERE NEUE TELEFONNUMMER!

Dipl.-Phys. Andreas Schweigstill
Schweigstill IT | Embedded Systems
Schauenburgerstraße 116, D-24118 Kiel, Germany
Phone: (+49) 431 53035-435, Fax: (+49) 431 53035-436
Mobile: (+49) 171 6921973, Web: http://www.schweigstill.de/

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


Re: sequence "/@" in file path causes failure - Subversion bug?

Posted by "B. Smith-Mannschott" <bs...@gmail.com>.
On Mon, May 25, 2009 at 19:41, Marian Petras <ma...@sun.com> wrote:
> Hello,
>
> I am re-posting this question about a possible bug in Svn because I got
> no response on the users' mailing list (for the original e-mail, see
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2300569).
>
> I cannot 'svn add' or 'svn commit' a file if the file's name starts with
> an at sign (@) and the specified file path contains at least one
> directory element.

This is not a bug. When Subversion sees the last (or only) "@" in a
path, it expects what follows to be a peg revision. The escaping
mechanism for paths containing "@", where you don't want to specify a
peg revision is to terminate the path with "@":

/trunk/@somefile@

see also
http://svnbook.red-bean.com/en/1.5/svn.advanced.pegrevs.html

[quote]
The perceptive reader is probably wondering at this point whether the
peg revision syntax causes problems for working copy paths or URLs
that actually have at signs in them. After all, how does svn know
whether news@11 is the name of a directory in my tree or just a syntax
for “revision 11 of news”? Thankfully, while svn will always assume
the latter, there is a trivial workaround. You need only append an at
sign to the end of the path, such as news@11@. 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. This
workaround even applies to paths that end in an at sign—you would use
filename@@ to talk about a file named filename@.
[/quote]

// ben

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