Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2007

Tip: Looking for answers? Try searching our database.

Ant Copy Task and Hidden Files

Thread view: 
russ.vanderwerff@sencore.com - 26 Sep 2007 15:37 GMT
I'm trying to copy a directory using the Ant "copy" task... the syntax
I'm using is below:

     <copy todir="${buildDir}">
        <fileset dir="."/>
     </copy>

The problem I'm having is this: the folder is an SVN working copy, and
I need the destination to be an SVN working copy as well.  However,
whenver I copy it with the Ant "copy" task, the hidden ".svn"
subdirectories (which SVN uses for its version control) are not copied
over.  Does anyone know if there's any way to tell Ant to copy hidden
files and folders as well?  I've been looking at the official
documentation here:

http://ant.apache.org/manual/index.html

but I can't seem to find anything.

Thanks!

Russ
Zig - 26 Sep 2007 18:15 GMT
> I'm trying to copy a directory using the Ant "copy" task... the syntax
> I'm using is below:
[quoted text clipped - 8 lines]
> subdirectories (which SVN uses for its version control) are not copied
> over.

The .svn files are part of Ant's default excludes:

http://ant.apache.org/manual/CoreTasks/defaultexcludes.html

You should be able to include
<defaultexcludes remove="**/.svn/**"/>
inside your <fileset> (though I haven't tested this)

HTH,

-Zig
russ.vanderwerff@sencore.com - 26 Sep 2007 19:36 GMT
> The .svn files are part of Ant's default excludes:
>
> http://ant.apache.org/manual/CoreTasks/defaultexcludes.html

Thanks! I'd see that after some pushing into the ant source - I guess
it's in the documenation, too, and somehow I managed to miss it!

> You should be able to include
> <defaultexcludes remove="**/.svn/**"/>
> inside your <fileset> (though I haven't tested this)

I ended up doing this:

     <copy todir="${buildDir}">
        <fileset dir="." defaultexcludes="no" />
     </copy>

which I believe had the same effect.

> HTH,
>
> -Zig

Mission accomplished!  A thousand thanks!

Russ
Lew - 26 Sep 2007 21:58 GMT
>> The .svn files are part of Ant's default excludes:
>>
[quoted text clipped - 20 lines]
>
> Mission accomplished!  A thousand thanks!

Isn't it bad for SVN to move its working-directory special files around?  I'm
not so familiar with Subversion, but copying a working directory that way
defeats the whole point of version control, which is that all copying flows
through the repository.

Signature

Lew

Jean-Baptiste Nizet - 27 Sep 2007 14:04 GMT
> Isn't it bad for SVN to move its working-directory special files around?  I'm
> not so familiar with Subversion, but copying a working directory that way
> defeats the whole point of version control, which is that all copying flows
> through the repository.

No. You may have multiple working copies of the same subversion
project on your disk if you want to. I don't know why it would be
useful, and why the OP wants that, but it's allowed and doesn't cause
any problem.
I've in fact done that once to make a demo of SVN usage to collegues:
they just had to consider that the first working copy was the one of
Alice, and the second working copy the one of Bob, Alice and Bob
working concurrently on the same project using SVN.

JB.
Lew - 27 Sep 2007 14:34 GMT
>> Isn't it bad for SVN to move its working-directory special files around?  I'm
>> not so familiar with Subversion, but copying a working directory that way
[quoted text clipped - 9 lines]
> Alice, and the second working copy the one of Bob, Alice and Bob
> working concurrently on the same project using SVN.

That doesn't answer my question.

I was asking about the direct copy of the directory, not about multiple
working directories.

Of course I'm familiar with having multiple working copies from version
control, only I use the v.c. product to create those copies.  I am wondering
if it's safe to copy them without mediation by the v.c.

Signature

Lew

Jean-Baptiste Nizet - 27 Sep 2007 14:47 GMT
> >> Isn't it bad for SVN to move its working-directory special files around?  I'm
> >> not so familiar with Subversion, but copying a working directory that way
[quoted text clipped - 18 lines]
> control, only I use the v.c. product to create those copies.  I am wondering
> if it's safe to copy them without mediation by the v.c.

Yes, it's safe. You'll just have a second working copy, in exactly the
same state as the first one.
A SVN working copy is just a bunch of directories, each directory
having a .svn subdirectory which indicates where the directory comes
from (URL), the revision of each file it contains, the modifications/
additions/removals that have not yet been committed, etc. Copying the
directory to another location is perfectly safe.

JB.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.