You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm-dev@maven.apache.org by Carlos Sanchez <ca...@apache.org> on 2006/04/26 05:19:07 UTC

Adding a directory recursively

I have created http://jira.codehaus.org/browse/SCM-188

For the scm wagon I'd need to add a whole directory to scm.

Right now the only solution is create a ScmFileSet, but none of the
current methods adds directories, i have to look for them and add in
order so the svn add works correctly.

It'd be a nice to have in the API an addDirectory or make the add
command add directories recursively (I don't know what's the use case
of the current behaviour)
eg. translated to svn it would call a svn add recursively, also
optimizing the current approach of calling lots of times to external
svn

WDYT?

--
I could give you my word as a Spaniard.
No good. I've known too many Spaniards.
                             -- The Princess Bride

RE: Adding a directory recursively

Posted by Jeff Jensen <je...@upstairstechnology.com>.
FYI Perforce will error on adding files already under source control,
rejecting the add request.


-----Original Message-----
From: Emmanuel Venisse [mailto:emmanuel@venisse.net] 
Sent: Wednesday, April 26, 2006 3:58 AM
To: scm-dev@maven.apache.org
Subject: Re: Adding a directory recursively



Brett Porter a écrit :
> Emmanuel Venisse wrote:
> 
>>
>> Brett Porter a écrit :
>>
>>> Emmanuel Venisse wrote:
>>>
>>>> I think it would be good to add this method and it's easy to do. 
>>>> For svn, we must check if :
>>>> - .svn directory exist in directory for subversion
>>>> - CVS directory exist in directory for CVS
>>>> - .bzr directory exist in directory for bazaar
>>>> - nothing to do for file provider
>>>> - don't know for clearcase, perforce and starteam
>>>
>>>
>>>
>>> Is that really necessary? Shouldn't it error out if you try to add 
>>> something that is already added?
>>
>>
>> If you don't have .svn, CVS... directories, they aren't already added.
>>
>> Emmanuel
>>
> 
> Exactly - maybe I misunderstood but what I meant was that you don't 
> need to check for it - if you do an addDirectory, you attempt to add 
> the whole directory (and if something is already added, with .svn, it 
> errors, but if none of them have .svn it is all happy).
> 

If I understand correctly what you mean, we call addDirectory for all
parents directory and we catch error for all already added directory, right?

svn doesn't fail when you try to add a directory already added, it just send
a warning.

Emmanuel


Re: Adding a directory recursively

Posted by Emmanuel Venisse <em...@venisse.net>.

Brett Porter a écrit :
> Emmanuel Venisse wrote:
> 
>>
>> Brett Porter a écrit :
>>
>>> Emmanuel Venisse wrote:
>>>
>>>> I think it would be good to add this method and it's easy to do. For 
>>>> svn, we must check if :
>>>> - .svn directory exist in directory for subversion
>>>> - CVS directory exist in directory for CVS
>>>> - .bzr directory exist in directory for bazaar
>>>> - nothing to do for file provider
>>>> - don't know for clearcase, perforce and starteam
>>>
>>>
>>>
>>> Is that really necessary? Shouldn't it error out if you try to add 
>>> something that is already added?
>>
>>
>> If you don't have .svn, CVS... directories, they aren't already added.
>>
>> Emmanuel
>>
> 
> Exactly - maybe I misunderstood but what I meant was that you don't need 
> to check for it - if you do an addDirectory, you attempt to add the 
> whole directory (and if something is already added, with .svn, it 
> errors, but if none of them have .svn it is all happy).
> 

If I understand correctly what you mean, we call addDirectory for all parents directory and we catch 
error for all already added directory, right?

svn doesn't fail when you try to add a directory already added, it just send a warning.

Emmanuel


Re: Adding a directory recursively

Posted by Brett Porter <br...@apache.org>.
Emmanuel Venisse wrote:
> 
> Brett Porter a écrit :
>> Emmanuel Venisse wrote:
>>
>>> I think it would be good to add this method and it's easy to do. For 
>>> svn, we must check if :
>>> - .svn directory exist in directory for subversion
>>> - CVS directory exist in directory for CVS
>>> - .bzr directory exist in directory for bazaar
>>> - nothing to do for file provider
>>> - don't know for clearcase, perforce and starteam
>>
>>
>> Is that really necessary? Shouldn't it error out if you try to add 
>> something that is already added?
> 
> If you don't have .svn, CVS... directories, they aren't already added.
> 
> Emmanuel
> 

Exactly - maybe I misunderstood but what I meant was that you don't need 
to check for it - if you do an addDirectory, you attempt to add the 
whole directory (and if something is already added, with .svn, it 
errors, but if none of them have .svn it is all happy).

- Brett

Re: Adding a directory recursively

Posted by Emmanuel Venisse <em...@venisse.net>.
Brett Porter a écrit :
> Emmanuel Venisse wrote:
> 
>> I think it would be good to add this method and it's easy to do. For 
>> svn, we must check if :
>> - .svn directory exist in directory for subversion
>> - CVS directory exist in directory for CVS
>> - .bzr directory exist in directory for bazaar
>> - nothing to do for file provider
>> - don't know for clearcase, perforce and starteam
> 
> 
> Is that really necessary? Shouldn't it error out if you try to add 
> something that is already added?

If you don't have .svn, CVS... directories, they aren't already added.

Emmanuel


Re: Adding a directory recursively

Posted by Brett Porter <br...@apache.org>.
Emmanuel Venisse wrote:
> I think it would be good to add this method and it's easy to do. For 
> svn, we must check if :
> - .svn directory exist in directory for subversion
> - CVS directory exist in directory for CVS
> - .bzr directory exist in directory for bazaar
> - nothing to do for file provider
> - don't know for clearcase, perforce and starteam

Is that really necessary? Shouldn't it error out if you try to add 
something that is already added?

- Brett

Re: Adding a directory recursively

Posted by Emmanuel Venisse <em...@venisse.net>.

Carlos Sanchez a écrit :
> I have created http://jira.codehaus.org/browse/SCM-188
> 
> For the scm wagon I'd need to add a whole directory to scm.
> 
> Right now the only solution is create a ScmFileSet, but none of the
> current methods adds directories, i have to look for them and add in
> order so the svn add works correctly.
> 
> It'd be a nice to have in the API an addDirectory or make the add
> command add directories recursively (I don't know what's the use case
> of the current behaviour)

Actual use case is to add all directories to add in scm in a scmFileSet.

> eg. translated to svn it would call a svn add recursively, also
> optimizing the current approach of calling lots of times to external
> svn
> 
> WDYT?

I think it would be good to add this method and it's easy to do. For svn, we must check if :
- .svn directory exist in directory for subversion
- CVS directory exist in directory for CVS
- .bzr directory exist in directory for bazaar
- nothing to do for file provider
- don't know for clearcase, perforce and starteam

Emmanuel