You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Steve Karg <st...@kargs.net> on 2004/03/11 20:03:43 UTC

svn import of working directory

Hi List!

I started using subversion the other day, and I thought I would use it 
like I have used CVS in the past.  I performed an import in one of my 
project directories.  However, no .svn directory was created in that 
directory, so even though I had the project in svn, I cannot update any 
files in the working directory and commit them to svn.  The only way I 
was able to accomplish this was to delete the working directory and 
contents, and then 'checkout' the directory project.  Am I just missing 
something, or is this how it is supposed to work?

I wanted to use svn on my /etc files - but am a little timid about 
deleting that directory and having it checkout correctly the first time :-)

Steve
-- 
http://www.kargs.net/


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

Re: svn import of working directory

Posted by Steve Karg <st...@kargs.net>.
Hi Ben,

> There's a cute trick you can do, however, in the FAQ.  It exactly
> answers your question about '/etc':
> 
> http://subversion.tigris.org/project_faq.html#in-place-import

Yes!  It answers my question exactly!

Thanks!

Steve
-- 
http://www.kargs.net/


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

Re: svn import of working directory

Posted by Brian Mathis <bm...@directedge.com>.
Derek Scherger wrote:

> So what will you do when you want to check out your /etc config to a 
> second machine? I'm currently struggling to set up svn with common and 
> unique configurations from a small (i.e. home) network and it isn't so 
> clean.
>
> There's a bunch of places in the code that have problems if the target 
> directory or file already exist. I'm looking into the idea of checking 
> out only the admin (i.e. .svn) directories over top of an existing 
> "working copy" that just isn't associated with any particular repository.
>
> I have had some negative reactions to this idea a long time ago when 
> cvs was the topic, but I really can't see any significant problems 
> myself. There won't be any "damage" to the existing tree if no 
> directories or files are touched (i.e. create only .svn directories 
> where their parent directory already exists). If a directory is "in 
> the way" that's perfect, just go into it and keep going. If a file is 
> in the way, just leave it alone and create the associated admin info. 
> If a directory is missing, do not create it but do create the 
> associated admin info. Once this is all done, an svn diff should show 
> the state of the current "working copy" verses the HEAD and anything 
> that was different should show up as changed.
>
> This isn't a problem that's particularly unique to svn though, I can't 
> seem to find any vc  system that does what I want, which makes me 
> wonder if what I want is crazy...
>
> There is a hint that handling the "sysadmin/many machines" case that 
> I'm talking about might be sensible on the arch wiki at 
> http://wiki.gnuarch.org/moin.cgi/Versioning_20strategies but the page 
> has yet to be created which is unfortunate.
>
> The basic problem is that machines will share some common config 
> (internal machines mta config in /etc/postfix) and also have some 
> unique config (/etc/fstab). At the moment I have an svn repository 
> with /config/common, /config/foo and /config/bar where foo and bar are 
> the machine specific things. With this I can switch parts of the 
> working copy trees to their machine specific repository locations and 
> it works ok. The problem comes in when I decide that some new config 
> files should be in svn, I can add them on one machine just fine, but 
> there are other machines that also already have these 
> files/directories and an update is blocked because they already exist.
>
> Any thoughts, solutions, ideas?


Once again I will propose that a VC type system is not the correct type 
of system for storing system configuration files, specfically because of 
what you just mentioned.

Anyone doing this should really take a look at cfengine, which is 
designed for this sort of thing:
    http://www.cfengine.org/
and a nice intro here:
    http://www.linuxjournal.com/article.php?sid=6848

You can always keep the cfengine files in svn.  Otherwise, you wind up 
making more problems than the solution you are trying to solve - 
creating more and more non-standard scripts to keep your system in 
place, forcing svn to grab things from here and there when it really 
shouldn't be.

I love svn and I'm also a sysadmin of 10 years - svn just isn't the 
right tool here.

-- 
Brian Mathis
http://directedge.com/b/


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

Re: svn import of working directory

Posted by Derek Scherger <de...@echologic.com>.
Steve Karg wrote:
> Jeff Bowden wrote:
> 
>>>> There's a cute trick you can do, however, in the FAQ.  It exactly
>>>> answers your question about '/etc':
>>>>
>>>> http://subversion.tigris.org/project_faq.html#in-place-import
> 
> 
>> If you want to do this with an existing repository the steps are more 
>> like
>>
>>    svn mkdir url/of/repository/sompath/etc -m ''
>>    svn co url/of/repository/somepath/etc
>>    cd etc
>>    ...
>>
>> I wrote that FAQ entry before I knew much about subversion.  Now I 
>> know better.
> 
> 
> And that works *exactly* as I needed it to work.

So what will you do when you want to check out your /etc config to a second machine? I'm 
currently struggling to set up svn with common and unique configurations from a small 
(i.e. home) network and it isn't so clean.

There's a bunch of places in the code that have problems if the target directory or file 
already exist. I'm looking into the idea of checking out only the admin (i.e. .svn) 
directories over top of an existing "working copy" that just isn't associated with any 
particular repository.

I have had some negative reactions to this idea a long time ago when cvs was the topic, 
but I really can't see any significant problems myself. There won't be any "damage" to the 
existing tree if no directories or files are touched (i.e. create only .svn directories 
where their parent directory already exists). If a directory is "in the way" that's 
perfect, just go into it and keep going. If a file is in the way, just leave it alone and 
create the associated admin info. If a directory is missing, do not create it but do 
create the associated admin info. Once this is all done, an svn diff should show the state 
of the current "working copy" verses the HEAD and anything that was different should show 
up as changed.

This isn't a problem that's particularly unique to svn though, I can't seem to find any vc 
  system that does what I want, which makes me wonder if what I want is crazy...

There is a hint that handling the "sysadmin/many machines" case that I'm talking about 
might be sensible on the arch wiki at 
http://wiki.gnuarch.org/moin.cgi/Versioning_20strategies but the page has yet to be 
created which is unfortunate.

The basic problem is that machines will share some common config (internal machines mta 
config in /etc/postfix) and also have some unique config (/etc/fstab). At the moment I 
have an svn repository with /config/common, /config/foo and /config/bar where foo and bar 
are the machine specific things. With this I can switch parts of the working copy trees to 
their machine specific repository locations and it works ok. The problem comes in when I 
decide that some new config files should be in svn, I can add them on one machine just 
fine, but there are other machines that also already have these files/directories and an 
update is blocked because they already exist.

Any thoughts, solutions, ideas?
-- 
Cheers,
Derek

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

Re: svn import of working directory

Posted by Steve Karg <sk...@openoffice.org>.
Jeff Bowden wrote:

>>> There's a cute trick you can do, however, in the FAQ.  It exactly
>>> answers your question about '/etc':
>>>
>>> http://subversion.tigris.org/project_faq.html#in-place-import

> If you want to do this with an existing repository the steps are more like
> 
>    svn mkdir url/of/repository/sompath/etc -m ''
>    svn co url/of/repository/somepath/etc
>    cd etc
>    ...
> 
> I wrote that FAQ entry before I knew much about subversion.  Now I know 
> better.

And that works *exactly* as I needed it to work.

Thanks for helping me.  Will someone be updating the FAQ?

Steve


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

Re: svn import of working directory

Posted by Jeff Bowden <jl...@houseofdistraction.com>.
Steve Karg wrote:

> Hi Ben,
>
>> There's a cute trick you can do, however, in the FAQ.  It exactly
>> answers your question about '/etc':
>>
>> http://subversion.tigris.org/project_faq.html#in-place-import
>
>
> Well, that seems to work *only* if the repository is clean/empty.  
> When I tried it using my existing repository, I got all the projects 
> in the repository checked out into the destination directory.  The 
> feature of the 'add' won't work if you don't checkout something first, 
> correct?  Or did I not understand the FAQ?



If you want to do this with an existing repository the steps are more like

    svn mkdir url/of/repository/sompath/etc -m ''
    svn co url/of/repository/somepath/etc
    cd etc
    ...

I wrote that FAQ entry before I knew much about subversion.  Now I know 
better.


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

Re: svn import of working directory

Posted by Steve Karg <st...@kargs.net>.
Hi Ben,

> There's a cute trick you can do, however, in the FAQ.  It exactly
> answers your question about '/etc':
> 
> http://subversion.tigris.org/project_faq.html#in-place-import

Well, that seems to work *only* if the repository is clean/empty.  When 
I tried it using my existing repository, I got all the projects in the 
repository checked out into the destination directory.  The feature of 
the 'add' won't work if you don't checkout something first, correct?  Or 
did I not understand the FAQ?

Steve
-- 
http://www.kargs.net/


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

Re: svn import of working directory

Posted by Steve Karg <sk...@openoffice.org>.
Hi Ben,

> There's a cute trick you can do, however, in the FAQ.  It exactly
> answers your question about '/etc':
> 
> http://subversion.tigris.org/project_faq.html#in-place-import

Yes, that is exactly what I needed!  Thanks for pointing me to the FAQ!

Steve


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

Re: svn import of working directory

Posted by Ben Collins-Sussman <su...@collab.net>.
On Thu, 2004-03-11 at 14:03, Steve Karg wrote:
>  The only way I 
> was able to accomplish this was to delete the working directory and 
> contents, and then 'checkout' the directory project.  Am I just missing 
> something, or is this how it is supposed to work?

Yes, this is how it's supposed to work.  CVS is the same way.

There's a cute trick you can do, however, in the FAQ.  It exactly
answers your question about '/etc':

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


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

Re: svn import of working directory

Posted by Steve Karg <st...@kargs.net>.
Hi Jens,

> This is exactly the same way that it works in CVS.  When you do the import,
> it does not make the imported directory a checked out CVS repository.  After
> you import, you usually go to another directory, or another directory name
> and check the project out.

Thanks for the clarification.

I guess I was thinking of when I used a locally mounted repository 
directory on a working directory (cvs make new module on :local:).  Can 
I do the same with svn?

Steve
-- 
http://www.kargs.net/

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

RE: svn import of working directory

Posted by Jens Wessling <we...@soartech.com>.
Hey,

This is exactly the same way that it works in CVS.  When you do the import,
it does not make the imported directory a checked out CVS repository.  After
you import, you usually go to another directory, or another directory name
and check the project out.

--Jens Wessling

> -----Original Message-----
> From: Steve Karg [mailto:steve@kargs.net] 
> Sent: Thursday, March 11, 2004 3:04 PM
> To: users@subversion.tigris.org
> Subject: svn import of working directory
> 
> 
> Hi List!
> 
> I started using subversion the other day, and I thought I 
> would use it 
> like I have used CVS in the past.  I performed an import in one of my 
> project directories.  However, no .svn directory was created in that 
> directory, so even though I had the project in svn, I cannot 
> update any 
> files in the working directory and commit them to svn.  The 
> only way I 
> was able to accomplish this was to delete the working directory and 
> contents, and then 'checkout' the directory project.  Am I 
> just missing 
> something, or is this how it is supposed to work?
> 
> I wanted to use svn on my /etc files - but am a little timid about 
> deleting that directory and having it checkout correctly the 
> first time :-)
> 
> Steve
> -- 
> http://www.kargs.net/
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
> 
> 


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