You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Tim Hill <ti...@realmsys.com> on 2006/03/25 00:35:31 UTC

How to trim working copy tree?

I seem to have stumbled on a missing command in Subversion (or, of 
course, my brain is just dead again!)...

Assume I have a repo with two folders: foo and foo/bar (that is, bar is 
a child of foo). Now I do the following:

 >>> svn checkout SOME-URL/foo -N

OK, so I now have foo in a working copy, but not bar (yet). If I now do 
an "svn update" on foo, I'll get updates to foo but svn won't attempt to 
also grab bar (which, I think, is correct).

OK, now let's add bar:

 >>> cd foo
 >>> svn update SOME-URL/foo/bar

This should add bar to the WC as a child of foo, which indeed it does. 
So far, so good. From now on, svn update will update both foo and bar, 
which is good :)

Now for the problem. Let's say I want to get rid of bar (from the WC 
only, not the repo), so I'm only working with foo again and not its 
child. How do I do this? It's not svn delete, since that deletes in the 
repo. And it's *not* as simple as a regular folder delete, because foo 
now "knows" about bar (in the .svn folder) and the next svn update will 
fetch the contents again.

In other words, I want to get back to the state after the first command 
above, with just the foo folder and no bar. But I don't see any way of 
erasing foo's memory of bar from the WC, aside from dumping the whole WC 
and starting from scratch.

Any comments? I keep hitting against this when fetching tags, and then 
can't get rid of the older tags I didn't want.

--Tim




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: How to trim working copy tree?

Posted by Daniel Berlin <db...@dberlin.org>.
On Fri, 2006-03-24 at 16:38 -0800, Garrett Rooney wrote:
> On 3/24/06, Tim Hill <ti...@realmsys.com> wrote:
> 
> > In other words, I want to get back to the state after the first command
> > above, with just the foo folder and no bar. But I don't see any way of
> > erasing foo's memory of bar from the WC, aside from dumping the whole WC
> > and starting from scratch.
> 
> There is no such command at the moment.  Subversion's handling of
> nonrecursive checkouts is currently rather poor.  When it's fixed such
> a command could be added, but I don't know if anyone's planning on
> doing that any time soon.
> 

Actually, there is a trick various gcc developers use.

Place an empty directory in the repository, and svn switch bar to it.
If you ever want the bar dir back, just svn switch it back to the real
bar.

(This of course, will be unswitched if you svn switch the parent
directory to some other branch, etc)




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: How to trim working copy tree?

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 3/24/06, Tim Hill <ti...@realmsys.com> wrote:

> In other words, I want to get back to the state after the first command
> above, with just the foo folder and no bar. But I don't see any way of
> erasing foo's memory of bar from the WC, aside from dumping the whole WC
> and starting from scratch.

There is no such command at the moment.  Subversion's handling of
nonrecursive checkouts is currently rather poor.  When it's fixed such
a command could be added, but I don't know if anyone's planning on
doing that any time soon.

> Any comments? I keep hitting against this when fetching tags, and then
> can't get rid of the older tags I didn't want.

I'd suggest simply checking out tags separately from any other working
copy, one at a time, rather than doing a nonrecursive checkout of the
top level and pulling in tags when you need them.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org