You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Lathan Bidwell <la...@andrews.edu> on 2013/01/23 17:20:19 UTC

check out everything except, '' subfolder should be shallower

Hey,

I have a subversion tree that has several sub-folders (buried deep in 
the tree) that contain large amounts of media files... mp3, m4v, ....

What I am trying to do is to checkout "smaller" versions of my 
repository by setting those media folders to be --depth empty.

I have been experimenting with --set-depth immediates and such.

What I am running into, is that there is no easy way to checkout the 
repository without downloading everything. It is quite a pain to 
checkout the repository as depth empty and then try to get it back to 
depth infinity.


/    (infinity)
/a    (infinity)
/b    (infinity)
*/b/media    (empty)*
/b/regular    (infinity)
/b/regular/files    (infinity)
/b/regular/files/here    (infinity)
/c    (infinity)
/d    (infinity)
*/d/media    (empty)*


How can i checkout out this sample repository without downloading the 
/b/media/ and /d/media folders?

The example i have (with checking it all out first is):
svn checkout '<repository>' --depth immediates
svn update --set-depth exclude /b/media
svn update --set-depth exclude /d/media
svn update --set-depth infinity *


Perhaps I am confused, but wouldn't that last depth infinity reset the 
depth exclude from the previous lines?

Thank you for your help,

Lathan Bidwell
Andrews University

Re: check out everything except, '' subfolder should be shallower

Posted by Lathan Bidwell <la...@andrews.edu>.
On 01/24/2013 10:07 AM, Johan Corveleyn wrote:
> On Thu, Jan 24, 2013 at 3:50 PM, Lathan Bidwell <la...@andrews.edu> wrote:
>> On 01/24/2013 05:14 AM, Philip Martin wrote:
>>> Lathan Bidwell <la...@andrews.edu> writes:
>>>
>>>> How can i checkout out this sample repository without downloading the
>>>> /b/media/ and /d/media folders?
>>>>
>>>> The example i have (with checking it all out first is):
>>>> svn checkout '<repository>' --depth immediates
>>>> svn update --set-depth exclude /b/media
>>>> svn update --set-depth exclude /d/media
>>>> svn update --set-depth infinity *
>>> You can do an empty checkout, use update and switch to make the
>>> directories into files, update the working copy to infinity, switch the
>>> directories back to empty and then update to excluded:
>>>
>>> svn co URL --depth empty wc
>>> svn up --depth empty wc/b
>>> svn up --depth empty wc/d
>>> svn sw ^/some/file --ignore-ancestry wc/b/media
>>> svn sw ^/some/file --ignore-ancestry wc/d/media
>>> svn up --set-depth infinity wc
>>> svn sw ^/b/media --set-depth empty --ignore-ancestry wc/b/media
>>> svn sw ^/d/media --set-depth empty --ignore-ancestry wc/d/media
>>> svn up --set-depth exclude wc/b/media
>>> svn up --set-depth exclude wc/d/media
>>>
>> So by using switch you make it look like a file so it won't try to update
>> its contents, then you switch it back to a directory and exclude / depth
>> empty it.
>>
>> Would that switch call need the --relocate flag?
>>
>> That solves half of the problem, I realize my example tree probably wasn't
>> extensive enough. The /b/media and /d/media subfolders are like 3 and 4
>> folders down in the tree, so its more like /b/1/2/3/media, .... It would be
>> ideal to not have to check out --depth empty all the parents directories.
> As of 1.7, 'svn update' has a '--parents' option that helps with that
> (see [1]). It creates any parent directory necessary, so you can do
> this:
>
> svn co URL --depth empty wc
> svn up --parents --depth empty wc/1/2/3
> ...
>
>> I
>> suppose I should just checkout out those exact directories in tmp and then
>> move them into the appropriate location?
> That won't work. Your checked out subdir will be a separate working
> copy, which you then embed in your larger working copy. Those will be
> embedded working copies, i.e. not the same as when the subdir is just
> another part of a (sparse) working copy. With embedded working copies,
> an 'svn up' of the parent working copy will not update the child
> working copy (it will regard is as an unversioned part).
>
>
> [1] http://subversion.tigris.org/issues/show_bug.cgi?id=3748
> (Implement --parents option for svn update)
>


Okay, so thank you for showing me that use of switch and the new flag of 
--parents

Have a good day,

Lathan Bidwell



Re: check out everything except, '' subfolder should be shallower

Posted by Johan Corveleyn <jc...@gmail.com>.
On Thu, Jan 24, 2013 at 3:50 PM, Lathan Bidwell <la...@andrews.edu> wrote:
>
> On 01/24/2013 05:14 AM, Philip Martin wrote:
>>
>> Lathan Bidwell <la...@andrews.edu> writes:
>>
>>> How can i checkout out this sample repository without downloading the
>>> /b/media/ and /d/media folders?
>>>
>>> The example i have (with checking it all out first is):
>>> svn checkout '<repository>' --depth immediates
>>> svn update --set-depth exclude /b/media
>>> svn update --set-depth exclude /d/media
>>> svn update --set-depth infinity *
>>
>> You can do an empty checkout, use update and switch to make the
>> directories into files, update the working copy to infinity, switch the
>> directories back to empty and then update to excluded:
>>
>> svn co URL --depth empty wc
>> svn up --depth empty wc/b
>> svn up --depth empty wc/d
>> svn sw ^/some/file --ignore-ancestry wc/b/media
>> svn sw ^/some/file --ignore-ancestry wc/d/media
>> svn up --set-depth infinity wc
>> svn sw ^/b/media --set-depth empty --ignore-ancestry wc/b/media
>> svn sw ^/d/media --set-depth empty --ignore-ancestry wc/d/media
>> svn up --set-depth exclude wc/b/media
>> svn up --set-depth exclude wc/d/media
>>
>
> So by using switch you make it look like a file so it won't try to update
> its contents, then you switch it back to a directory and exclude / depth
> empty it.
>
> Would that switch call need the --relocate flag?
>
> That solves half of the problem, I realize my example tree probably wasn't
> extensive enough. The /b/media and /d/media subfolders are like 3 and 4
> folders down in the tree, so its more like /b/1/2/3/media, .... It would be
> ideal to not have to check out --depth empty all the parents directories.

As of 1.7, 'svn update' has a '--parents' option that helps with that
(see [1]). It creates any parent directory necessary, so you can do
this:

svn co URL --depth empty wc
svn up --parents --depth empty wc/1/2/3
...

> I
> suppose I should just checkout out those exact directories in tmp and then
> move them into the appropriate location?

That won't work. Your checked out subdir will be a separate working
copy, which you then embed in your larger working copy. Those will be
embedded working copies, i.e. not the same as when the subdir is just
another part of a (sparse) working copy. With embedded working copies,
an 'svn up' of the parent working copy will not update the child
working copy (it will regard is as an unversioned part).


[1] http://subversion.tigris.org/issues/show_bug.cgi?id=3748
(Implement --parents option for svn update)

-- 
Johan

Re: check out everything except, '' subfolder should be shallower

Posted by Lathan Bidwell <la...@andrews.edu>.
On 01/24/2013 05:14 AM, Philip Martin wrote:
> Lathan Bidwell <la...@andrews.edu> writes:
>
>> How can i checkout out this sample repository without downloading the /b/media/ and /d/media folders?
>>
>> The example i have (with checking it all out first is):
>> svn checkout '<repository>' --depth immediates
>> svn update --set-depth exclude /b/media
>> svn update --set-depth exclude /d/media
>> svn update --set-depth infinity *
> You can do an empty checkout, use update and switch to make the
> directories into files, update the working copy to infinity, switch the
> directories back to empty and then update to excluded:
>
> svn co URL --depth empty wc
> svn up --depth empty wc/b
> svn up --depth empty wc/d
> svn sw ^/some/file --ignore-ancestry wc/b/media
> svn sw ^/some/file --ignore-ancestry wc/d/media
> svn up --set-depth infinity wc
> svn sw ^/b/media --set-depth empty --ignore-ancestry wc/b/media
> svn sw ^/d/media --set-depth empty --ignore-ancestry wc/d/media
> svn up --set-depth exclude wc/b/media
> svn up --set-depth exclude wc/d/media
>

So by using switch you make it look like a file so it won't try to 
update its contents, then you switch it back to a directory and exclude 
/ depth empty it.

Would that switch call need the --relocate flag?

That solves half of the problem, I realize my example tree probably 
wasn't extensive enough. The /b/media and /d/media subfolders are like 3 
and 4 folders down in the tree, so its more like /b/1/2/3/media, .... It 
would be ideal to not have to check out --depth empty all the parents 
directories. I suppose I should just checkout out those exact 
directories in tmp and then move them into the appropriate location?

Sorry for not getting that clear,

Lathan Bidwell

Re: check out everything except, '' subfolder should be shallower

Posted by Philip Martin <ph...@wandisco.com>.
Lathan Bidwell <la...@andrews.edu> writes:

> How can i checkout out this sample repository without downloading the /b/media/ and /d/media folders?
>
> The example i have (with checking it all out first is):
> svn checkout '<repository>' --depth immediates
> svn update --set-depth exclude /b/media
> svn update --set-depth exclude /d/media
> svn update --set-depth infinity *

You can do an empty checkout, use update and switch to make the
directories into files, update the working copy to infinity, switch the
directories back to empty and then update to excluded:

svn co URL --depth empty wc
svn up --depth empty wc/b
svn up --depth empty wc/d
svn sw ^/some/file --ignore-ancestry wc/b/media
svn sw ^/some/file --ignore-ancestry wc/d/media
svn up --set-depth infinity wc
svn sw ^/b/media --set-depth empty --ignore-ancestry wc/b/media
svn sw ^/d/media --set-depth empty --ignore-ancestry wc/d/media
svn up --set-depth exclude wc/b/media
svn up --set-depth exclude wc/d/media

-- 
Certified & Supported Apache Subversion Downloads:
http://www.wandisco.com/subversion/download