This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 165329 - problem with "@" in filenames
Summary: problem with "@" in filenames
Status: RESOLVED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Subversion (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@versioncontrol
URL:
Keywords:
: 165367 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-05-16 17:09 UTC by tombart
Modified: 2010-01-19 03:14 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tombart 2009-05-16 17:09:00 UTC
SVN fails to commit file which name starts with "@"

eg. path 'templates/@layout.phtml' is changed to: 'templates@layout.phtml' (which is not under version control)

Probably more general issue, but for me is hard to find out which component is responsible for this.
Comment 1 Ondrej Vrabec 2009-05-18 07:50:41 UTC
*** Issue 165367 has been marked as a duplicate of this issue. ***
Comment 2 Marian Petras 2009-05-18 20:18:16 UTC
It is the command-line client what is broken. I sent a question about this issue to the Subversion mailing-list a few
hours ago and I am awaiting some reaction.

Meanwhile, I can provide you several work-arounds for your problem (details below the list).

1) Use the JavaHL library.
2) Use the command-line client from the console, following certain rules such the the bug does not manifest.

JavaHL
======
The NetBeans Subversion plug-in can use two ways of how to perform Subversion commands. The preferred way is using the
JavaHL library. If the JavaHL library cannot be found, then the command-line client is used. This bug happens only if
the command-line client is used. So if you manage to enable the JavaHL library, you will be done. If you decide to use
the JavaHL library, please tell what operating system are you using (including information whether it is 32-bit or
64-bit system) such that I can point you to the appropriate source of information.

Command-line client
===================
The command-line client for Subversion seems to be buggy. The problem is maily with commands 'svn add' and 'svn commit'.
Depending on version of your Subversion client, you can use one or two work-arounds:

svn add
-------
For 'svn add', make use the fact that the problem happens only if the path contains a slash. Instead of

    svn add templates/@layout.html

use

    cd temlates
    svn add @layout.html
    cd ..

If you have multiple '@...' files in multiple directories, adding the step-by-step is not problem.

svn commit - Subversion 1.4.x, 1.5.x
------------------------------------
To commit the files, if you want to make the commit atomic, you must commit all new/modified/removed files with a single
invocation of 'svn commit' so the above procedure.

If you want to commit all new/modified/removed file in the whole directory (tree), simply pass the directory name on the
command line:

    svn commit templates

If you want to commit all new/modified/removed files from a single directory, but exclude subdirectories, use

    svn commit --non-recursive templates

If there want to commit only some new/modified/removed files in a directory and:
 * you have Subversion 1.5.x, use the second work-around (below)
 * you have Subversion 1.4.x and you can upgrade to Subversion 1.5.x,
   upgrade to Subversion 1.5.x and use the second work-around (below)

Otherwise (you have Subversion 1.4.x and you cannot or do not want to upgrade to Subversion 1.5.x), the only work-around
that comes to my mind is to extract all changes you do not want to commit, save them (as a .diff file) somewhere else,
revert these changes, then commit the remaining changes (the ones you plan to commit) using one of the two above
procedures and then import the stored changes (from the .diff file) back.

svn commit - Subversion 1.5.x
-----------------------------
Subversion 1.5.x allows to build a named set of files and then commit the files using a reference to the set. In the
example below, the set of files is named 'to_commit':

    cd templates
    svn changelist to_commit '@layout.phtml'               <-- add the file to the set
    cd ..
    cd anotherdir
    svn changelist to_commit '@anotherfile.phtml'          <-- add the second file to the set
    cd ..
    ....
    ....
    ....
    svn commit --changelist to_commit -m "Commit message."    <-- commit all files in the set
Comment 3 Marian Petras 2009-05-21 20:20:45 UTC
The JavaHL library is installed by default on Windows platforms.

On Unix-like systems, JavaHL is usually not installed with Subversion. Some systems allow to install it via the
packaging system (Apt, RPM, etc.). On the rest of the systems, the JavaHL library must be compiled.

To compile Subversion together with the JavaHL library, do the following:
1) Get the Subversion sources from http://subversion.tigris.org/ (one of the links ".tar.bz2", ".tar.gz", ".zip").
2) Unpack the sources to some directory (e.g. /usr/local/src).
3) Install libraries that are needed for compilation of Subversion and JavaHL, i.e.:

        autoconf 2.58+
        libtool 1.4+
        C and C++ compiler
        libapr 1.0+
        zlib
        neon 0.25-0.25 -or- serf 0.1.2+
        openssl
        sqlite 3.4.0+

    It should be possible to install all these libraries via the packaging system.

4) Configure the compilation process:

        ./configure --enable-javahl --with-jdk=/path/to/jdk
    
    It may happen that the 'configure' script complaints about missing libraries and/or tools.
    But if all of the above libraries and tools are installed, it should run without any issues.

5) Compile Subversion and JavaHL:

        make
        make javahl

6) Install Subversion and JavaHL to the system:

        sudo make install
        sudo make install-javahl
        sudo ldconfig

    or

        su root
        make install
        make install-javahl
        /sbin/ldconfig

7) Restart NetBeans.

If Subversion and JavaHL were successfully installed, NetBeans should write something like this to the log file (main
menu: View > IDE Log):

        INFO [org.netbeans.modules.subversion.client.SvnClientFactory]: running on javahl
Comment 4 Marian Petras 2009-05-21 20:22:37 UTC
Priority lowered to P2 because a workaround exists (using the JavaHL library).
Comment 5 Marian Petras 2009-05-27 17:13:51 UTC
I reported the described issue (at sign at the beginning of a filename) as a Subversion bug
(http://subversion.tigris.org/issues/show_bug.cgi?id=3416).
Comment 6 Marian Petras 2009-05-27 17:15:26 UTC
I am working on a patch that would fix the cases that the at sign (@) is in the middle of the filename.
Comment 7 Marian Petras 2009-06-15 15:13:51 UTC
This fix will be a little bit tricky because different versions of Subversion clients are not consistent in handling
files containing at signs in their names. The behavior will change once again in Subversion 1.7.0 but it should be the
final fix.
Comment 8 Marian Petras 2009-06-25 11:01:51 UTC
I made a fix on the NetBeans side, which should fix this issue provided that the Subversion client works correctly.
Unfortunately, the Subversion client does not work correctly, even with the most recent patch for its bug 3416. I will
report to Subversion developers.

I also greatly expanded the unit tests - they now test most Subversion commands for the situation that names of files or
directories contain at signs.


Changeset:
ad697bbcfcf8

Because the NetBeans-side fix is ready, I lower priority of this bug to P3.
Comment 9 Marian Petras 2009-06-25 11:32:10 UTC
I just verified that the fixed Subversion module together with a patched Subversion command-line client allows to commit
a file whose name starts with "@".
Comment 10 Quality Engineering 2009-06-26 20:46:57 UTC
Integrated into 'main-golden', will be available in build *200906261401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/ad697bbcfcf8
User: Marian Petras <mpetras@netbeans.org>
Log: made a change that should (in theory) fix bug #165329 ("problem with at signs in filenames") - not fully working due to bugs in SVN clients
Comment 11 Ondrej Vrabec 2010-01-19 03:14:07 UTC
Fixed on our side, fixed also in subversion client (http://subversion.tigris.org/issues/show_bug.cgi?id=3416).