You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Les Mikesell <le...@gmail.com> on 2009/09/14 18:41:10 UTC

Re: unversioned directory of the same name already exists

perm 2600 wrote:
> Hi -- first post here.
> 
> I'm completely new to version control and wanted to get my feet wet with
> subervsion.
> 
> I've read the relevant part about my question in the svn book. In page 
> 154 it
> says that a repository can be deleted with the 'rm' unix command, which I
> did.
> 
> I did a first run with svn to create a repo (svnrepo1) and created the test
> dir (xdatadir) from scratch. Then I decided to do it again but hit a snag.
> 
> My test dir looks like this:
> $ tree xdatadir
> xdatadir
> |-- dir1
> |   |-- file1_dir1
> |   `-- file2_dir1
> `-- dir2
>     |-- file1_dir2
>     |-- file2_dir1
>     `-- file2_dir2
> 
> Removed the repo I created in my first attempt.
> $ rm -rf /home/jdoe/svnrepo1
> 
> Then I tried to create the repo again
> 
> $ svnadmin create /home/jdoe/svnrepo1
> 
> Importing was not a problem.
> 
> $ svn import xdatadir/ file:///home/jdoe/svnrepo1 -m "First Import"
> Adding         xdatadir/dir1
> Adding         xdatadir/dir1/file1_dir1
> Adding         xdatadir/dir1/file2_dir1
> Adding         xdatadir/dir2
> Adding         xdatadir/dir2/file2_dir1
> Adding         xdatadir/dir2/file1_dir2
> Adding         xdatadir/dir2/file2_dir2
> 
> But when I try to 'checkout' I get the following error:
> 
> $ svn checkout file:///home/jdoe/svnrepo1 xdatadir/
> svn: Failed to add directory 'xdatadir/dir1': an unversioned directory 
> of the
> same name already exists
> 
> Why does it say that the directory exists if I had removed it earlier?
> Can this be fixed?
> 
> The status shows the '?' for dir1 and dir2 indicating that they are not
> under version control.
> 
> $ svn status
> !       .
> ?       dir1
> ?       dir2
> 


I think you are confusing the repository and your working copy which are 
different things.  Everything looked OK up through importing your 
unversioned tree into the repository.  Now when you check it back out, 
you are expected to create a new working copy in a different/empty place 
so the working copy can be created with the versioning metadata.   It is 
possible to force the original files to be re-used but that's not 
typical.  Normally your working copy is treated as expendable and just 
checked out from scratch any time you might want a new one, but you 
might want to keep your original tree around (perhaps rename the top 
level) until you are confident that your repository copy is good.

-- 
   Les Mikesell
    lesmikesell@gmail.com

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2394732

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: unversioned directory of the same name already exists

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Sep 14, 2009, at 20:19, perm 2600 wrote:

> On Mon, Sep 14, 2009 at 12:47 PM, Johan Corveleyn wrote:
>
>> Yes. What you've tried to do is an "in-place import".
>>
>> See http://subversion.tigris.org/faq.html#in-place-import
>
> Yes! a local import is what I wanted to do. I just learned the name  
> for it. Somewhere in the docs I saw a reference to using ssh to  
> access a remote resource. I'll try that later since I don't have a  
> web server setup for this. For now I wanted to learn the process in  
> a local setting.

It has nothing to do with whether your repository is hosted on the  
local computer or on a remote server. It has to do with how you  
perform the import: whether normally, using "svn import", or in place,  
using "svn checkout", "svn add" and "svn commit".


> I attempted to checkout the xdatadir a bit after I posted my initial  
> question and it looks like it added the contents of the directory,  
> but the status still shows the question mark. How does one interpret  
> that? Or, how do you correct that?
>
> $ svn checkout file:///home/foot/svnrepo1 xdatadir/
> A    xdatadir/dir1
> A    xdatadir/dir1/file1_dir1
> A    xdatadir/dir1/file2_dir1
> A    xdatadir/dir2
> A    xdatadir/dir2/file1_dir2
> A    xdatadir/dir2/file2_dir1
> A    xdatadir/dir2/file2_dir2
> Checked out revision 1.

Ok, you checked out file:///home/foot/svnrepo1 into a new local  
directory xdatadir in the current directory (".").


> The status still shows that xdatadir is not under version control.
>
> $ svn status
> !       .
> ?       dir1
> ?       xdatadir
> ?       dir2

So the current directory (".") is a working copy for some reason,  
perhaps unintentionally.


> And also, why does 'svn list' shows dir1 and dir2, leftovers from  
> the first try?
> $ svn list
> dir1/
> dir2/

"svn list" uses information about whatever repository the current  
directory is attached to -- presumably the old repository you already  
deleted.


> I guess the important question is: where does subversion keep track  
> of what has been done? how do you "clean" the history? I thought  
> that deleting the repository and the /home/jdoe/xdatadir/.svn  
> directory would take care of that.

You want to delete the ".svn" directory in the current directory. Then  
"svn status" and "svn list" in this directory should properly report  
that you are not in a working copy.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2394862

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: unversioned directory of the same name already exists

Posted by perm 2600 <pe...@gmail.com>.
On Mon, Sep 14, 2009 at 12:47 PM, Johan Corveleyn <
johan.corveleyn@uz.kuleuven.ac.be> wrote:

> Yes. What you've tried to do is an "in-place import".
>
> See http://subversion.tigris.org/faq.html#in-place-import
>
> Regards,
> Johan
>

(I'm resending this reply because I did not cc the list in it the first
time)

Yes! a local import is what I wanted to do. I just learned the name for it.
Somewhere in the docs I saw a reference to using ssh to access a remote
resource. I'll try that later since I don't have a web server setup for
this. For now I wanted to learn the process in a local setting.

I attempted to checkout the xdatadir a bit after I posted my initial
question and it looks like it added the contents of the directory, but the
status still shows the question mark. How does one interpret that? Or, how
do you correct that?

$ svn checkout file:///home/foot/svnrepo1 xdatadir/
A    xdatadir/dir1
A    xdatadir/dir1/file1_dir1
A    xdatadir/dir1/file2_dir1
A    xdatadir/dir2
A    xdatadir/dir2/file1_dir2
A    xdatadir/dir2/file2_dir1
A    xdatadir/dir2/file2_dir2
Checked out revision 1.

The status still shows that xdatadir is not under version control.

$ svn status
!       .
?       dir1
?       xdatadir
?       dir2

And also, why does 'svn list' shows dir1 and dir2, leftovers from the first
try?
$ svn list
dir1/
dir2/

I guess the important question is: where does subversion keep track of what
has been done? how do you "clean" the history? I thought that deleting the
repository and the /home/jdoe/xdatadir/.svn directory would take care of
that.

thanks
/perm

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2394825

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

RE: unversioned directory of the same name already exists

Posted by Johan Corveleyn <jo...@uz.kuleuven.ac.be>.
> Van: Les Mikesell [mailto:lesmikesell@gmail.com]
> perm 2600 wrote:
> > Hi -- first post here.
> >
> > I'm completely new to version control and wanted to get my feet
> wet with
> > subervsion.
> >
> > I've read the relevant part about my question in the svn book. In
> page
> > 154 it
> > says that a repository can be deleted with the 'rm' unix command,
> which I
> > did.
> >
> > I did a first run with svn to create a repo (svnrepo1) and
> created the test
> > dir (xdatadir) from scratch. Then I decided to do it again but
> hit a snag.
> >
> > My test dir looks like this:
> > $ tree xdatadir
> > xdatadir
> > |-- dir1
> > |   |-- file1_dir1
> > |   `-- file2_dir1
> > `-- dir2
> >     |-- file1_dir2
> >     |-- file2_dir1
> >     `-- file2_dir2
> >
> > Removed the repo I created in my first attempt.
> > $ rm -rf /home/jdoe/svnrepo1
> >
> > Then I tried to create the repo again
> >
> > $ svnadmin create /home/jdoe/svnrepo1
> >
> > Importing was not a problem.
> >
> > $ svn import xdatadir/ file:///home/jdoe/svnrepo1 -m "First
> Import"
> > Adding         xdatadir/dir1
> > Adding         xdatadir/dir1/file1_dir1
> > Adding         xdatadir/dir1/file2_dir1
> > Adding         xdatadir/dir2
> > Adding         xdatadir/dir2/file2_dir1
> > Adding         xdatadir/dir2/file1_dir2
> > Adding         xdatadir/dir2/file2_dir2
> >
> > But when I try to 'checkout' I get the following error:
> >
> > $ svn checkout file:///home/jdoe/svnrepo1 xdatadir/
> > svn: Failed to add directory 'xdatadir/dir1': an unversioned
> directory
> > of the
> > same name already exists
> >
> > Why does it say that the directory exists if I had removed it
> earlier?
> > Can this be fixed?
> >
> > The status shows the '?' for dir1 and dir2 indicating that they
> are not
> > under version control.
> >
> > $ svn status
> > !       .
> > ?       dir1
> > ?       dir2
> >
> 
> 
> I think you are confusing the repository and your working copy
> which are
> different things.  Everything looked OK up through importing your
> unversioned tree into the repository.  Now when you check it back
> out,
> you are expected to create a new working copy in a different/empty
> place
> so the working copy can be created with the versioning metadata.
> It is
> possible to force the original files to be re-used but that's not
> typical.  Normally your working copy is treated as expendable and
> just
> checked out from scratch any time you might want a new one, but you
> might want to keep your original tree around (perhaps rename the
> top
> level) until you are confident that your repository copy is good.

Yes. What you've tried to do is an "in-place import".

See http://subversion.tigris.org/faq.html#in-place-import

Regards,
Johan

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2394753

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].