I am trying to come up with a canonical way to structure my source code projects. I use JetBrains IntelliJ IDEA and Subversion (1.6.12) (using SmartSVN as my GUI).
I have created a source directory structure like this:
project
+ trunk
+ branches
+ tags
and open a new IDEA project in the trunk directory. I write some code :-).
I am now going to add the project to a new repository I created on the SVN server (svnadmin create myproject). I am using SmartSVN 6.6.2.
In SmartSVN I tell it to import the code into a new project and point it at my repository using SVN+SSH. SmartSVN warns me that I am importing a directory other than the customary trunk because I gave it the top-level project directory. I am confused. Shouldn’t I import the whole directory structure into SVN?
Thanks.
When using the standard Subversion directory structure, you don’t usually have all of
trunk,branchesandtagschecked out on your machine, because that will give you many, many copies of the same files on your system, once you have multiple tags or branches. Instead, you usually just havetrunkchecked out, and may later switch your checkout to point to a branch or tag, or check out a branch or tag you are interested in in a separate directory, if you need to work on them.I haven’t used SmartSVN before, but it sounds like it expects to be given just the
trunkdirectory when creating a new project, because it expects that you will only have that checked out. It is perfectly correct to have the directory structure you describe on the server, it just isn’t expecting to get that for the import. Note that if you have already created anything in the tags or branches folders on the client, Subversion won’t know how how they relate to the trunk, and will thus just treat them as entirely separate files. But if those directories are empty upon import, you should be just fine, it’s just warning you that you were importing the code in a slightly unexpected way.