tags:

views:

107

answers:

4

I've created a repo, and then I ran svn import . https://myrepo. It seems to have checked everything in nicely, and I can check it out on my other machine. However, it doesn't seem to create the .svn folder, so I can't run any svn ci commands at a later date.

This creates massive headaches to try and sync up later, because now all my stuff is already in the repo, but it conflicts with the changes I'm trying to commit.

What am I doing wrong? Is it just me that finds SVN astoundingly annoying to work with?

+4  A: 

i never use import because it's uncomfortable. import doesn't create .svn directories, you'll have to run an additional checkout of the newly imported directory.

instead of importing files i first create an empty directory in the repo and check it out into my existing project's directory that i want to "import". then you can simply run commit and it'll add all files.

stmax
You can check out to an existing folder with all your project files in it, and it won't explode?
Mark
exactly. you can checkout an empty directory from the repo into an existing local directory that can already contain files. all it'll do is to create a .svn in the local directory. once the .svn exists, you can run commit to commit all the existing files.
stmax
this method has one more advantage that i like about it - before committing you can already define your svn:ignores to exclude certain files. i use that very often. i think you can't do that with import, import always imports everything there is (binaries included), so you'll always have to clean up your dir before the import and you'll have to set the svn:ignores after the checkout and commit again.
stmax
+1  A: 

When you setup a project with subversion, after the initial import of your project, you should check the project out and continue work on the project in the copy that you checked out. I think the problem is that you kept on working on the copy that you checked in.

rubenvdg
So it seems. But that doesn't explain *why* `import` wouldn't create the `.svn` folder... is it not logical that you want to keep your import up to date?
Mark
This is a good question that I can't answer myself. Maybe people don't always want the imported directories to become a "working copy", even though it still would be nice to have that option. I have to say that I never actually thought too much about it.
rubenvdg
The manual explicitly mentions that an import does not convert the original directory tree in a working copy. No explanation about the why though.http://svnbook.red-bean.com/en/1.4/svn.tour.importing.html
rubenvdg
+4  A: 

Only a working copy will have an .svn folder. Import doesn't create a working copy. (Why not? Well suppose for example you were trying to import from media where you dodn't have write permissions. If import tried to create a working copy in that case, it would fail.) To create a working copy, you must use checkout.

Put another way, import pushes information to the repository. That's all it's intended to do, it has no impact on the original files. Most subversion commands only work in one direction: checkout, export, and update modify files on the local system/working copy. import and commit only update the repository. Aside from [un]lock operations, I can't think of a command which simultaneously impacts both the repository and the working copy.

ThatBlairGuy
A: 

After you've imported, you can run svn checkout --force to convert the imported directory into a working copy.

Michael Hackner