# Re: Removing a directory locally

From: Ryan Schmidt <subversion-2007b_at_ryandesign.com>
Date: Sat, 2 Feb 2008 17:49:52 -0600

On Feb 2, 2008, at 17:38, Greg Lutz wrote:

> As a relative newcomer to Subversion, I find a capability
> surprisingly missing: the ability to remove a directory from a
> working copy, but not from the repository. At least, it seems to be
> missing.
>
> In a toy example, I have a repository with two directories under
> the root, Project1 and Project2.
>
> I create a working copy /Temp/wc non-recursively, then use svn
> update to add Project1 to the working copy.
>
> From within the working copy, svn status -v now reports
>
> 1 1 Greg .
> 1 1 Greg Project1
>
> I now use svn update again, to add Project2 to the working copy.
> The svn status -v report is now
>
> 1 1 Greg .
> 1 1 Greg Project1
> 1 1 Greg Project2
>
> Suppose I now decide that fetching Project2 was a mistake -- it's
> big and ugly, I don't need it, I just want it back out of there.
> Not out of the repository, just out of my working copy, so I don't
> want to use svn delete. If I use plain file system commands to
> remove Project2, then svn status -v gives me a *bad* report:
>
> 1 1 Greg .
> 1 1 Greg Project1
> ! ? ? ? Project2
>
> If I then try to add a file to the root of the repository with svn
> add, I'm not allowed to commit it:
>
> A File1.txt
> C:/Temp/wc>svn commit
> svn: Commit failed (details follow):
> svn: Directory 'C:\Temp\wc\Project2' is missing
>
> There *is* a non-kosher workaround: I can edit .svn/entries and
> remove the lines for Project 2:
>
> Project2
> dir
> <ff>
>
> After doing this, the commit works fine.
>
> Is there a kosher way to do this operation?

The non-recursive checkout operation is a bit sketchy, and broken in
the ways you've discovered.

Subversion 1.5 will include a new sparse-directory feature which may
meet your needs better. (I don't know; I haven't tried it.)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org