Ant Copy Task and Hidden Files

Discussion in 'Java' started by russ.vanderwerff@sencore.com, Sep 26, 2007.

  1. Guest

    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
     
    , Sep 26, 2007
    #1
    1. Advertising

  2. Zig Guest

    On Wed, 26 Sep 2007 10:37:49 -0400, <> wrote:

    > 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.


    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
     
    Zig, Sep 26, 2007
    #2
    1. Advertising

  3. Guest

    On Sep 26, 12:15 pm, Zig <> wrote:
    > 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
     
    , Sep 26, 2007
    #3
  4. Lew Guest

    wrote:
    > On Sep 26, 12:15 pm, Zig <> wrote:
    >> 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!


    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.

    --
    Lew
     
    Lew, Sep 26, 2007
    #4
  5. On 26 sep, 22:58, Lew <> wrote:
    >
    > 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.
     
    Jean-Baptiste Nizet, Sep 27, 2007
    #5
  6. Lew Guest

    Jean-Baptiste Nizet wrote:
    > On 26 sep, 22:58, Lew <> wrote:
    >> 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.


    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.

    --
    Lew
     
    Lew, Sep 27, 2007
    #6
  7. On 27 sep, 15:34, Lew <> wrote:
    > Jean-Baptiste Nizet wrote:
    > > On 26 sep, 22:58, Lew <> wrote:
    > >> 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.

    >
    > 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.
    >


    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.
     
    Jean-Baptiste Nizet, Sep 27, 2007
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Victor
    Replies:
    0
    Views:
    8,909
    Victor
    Sep 1, 2004
  2. Replies:
    6
    Views:
    30,500
    Diplomat
    Jan 12, 2011
  3. david wolf
    Replies:
    1
    Views:
    962
    Juha Laiho
    Jul 22, 2006
  4. krabhi
    Replies:
    1
    Views:
    9,461
    Marco Meschieri
    Aug 9, 2006
  5. teggy
    Replies:
    0
    Views:
    853
    teggy
    May 29, 2007
Loading...

Share This Page