Setting up a local
Subversion with OSX Lion and Netbeans 7.0.1
I've just recently found
that my projects are starting to get large and I'm having trouble
containing and editing all the scripts in my head. Including all the
required libraries, bitmap files, associated widgets and doodads, my
project has ballooned out to approximately 80 Meg. I'm still not sure
if svn is the best tool for the job, but, it's been around long
enough and a few random blogs seemed to suggest that it would be fine
for my purposes. I will explain how I setup a local svn repository on my local
MacBook hard drive.
A wealth of information
is located
www.netbeans.org
however, some of it is slightly dated with reference to Netbeans 6.0
and not personally relevant (at the moment) with reference to Ubuntu.
A great tutorial is located at
http://netbeans.org/kb/docs/ide/subversion.html
from where I gleaned a great deal of the information in this post.
The very first step is to
use a terminal and create the local repository. The repository
directory will be where svn will store all the files on the local
machine. Issuing the following command will setup the repository on
your computer:
svnadmin
create /Users/norman/Documents/workspace/seams.svn/
The folder name can be
anything you desire. Just don't go messing around with the internal files after you have created it, unless you know why you are playing with them.
Now we can fire up netbeans.
To set the path to the
Subversion executable file in the IDE:
Choose Tools >
Options (NetBeans > Preferences on Mac) from the main menu. The
Options dialog opens.
Select the
Miscellaneous icon along the top of the dialog, then click the
Versioning tab. In the left pane under Versioning Systems, select
Subversion. User-defined options for Subversion display in the main
window of the dialog:
In the Specify the
SVN Home Folder text field, either type in the path to the
executable file or click Browse to navigate to it on your system.
Note that you need not include the Subversion executable file
in the path.
Check “Prefix
Repository Location with Repository Url”.
-
Click OK, then
restart the IDE to allow changes to take effect.
Importing the
working files.
The next step is to
import your working files into the repository. Whilst you are
actually exporting files from your system, the term 'import' is used
in version control systems to signify that files are being imported
into a repository.
To import a project to a
repository:
From the Projects
window (Ctrl-1), select your unversioned project and choose
Versioning > Import into Subversion Repository from the node's
right-click menu. The Subversion Import wizard opens.
In the Subversion
Repository panel of the Import wizard, specify the protocol and
location of the Subversion repository as defined by the Subversion
URL. Depending on your selection, you may need to specify further
settings, such as repository username and password, or, in the case
of svn+ssh://, you must specify the tunnel command to establish the
external tunnel. See the Subversion User FAQ for further details.
Click Next.
-
In the Repository
Folder panel, specify the repository folder in which you want to
place the project in the repository. A folder containing the name of
your project is suggested for you in the Repository Folder text
field by default.
-
In the text area
beneath Specify the Message, enter a description of the project you
are importing into the repository.
Click Finish to
initiate the import, or optionally, click Next to continue to a
third panel that enables you to preview all files that are prepared
for import. From this panel, you can choose to exclude individual
files from the import, or identify the MIME types of files before
importing.
Thats it! All I need to
do now is work out how to merge trunks, setup svn+ssh:// and get the
project finished!
As I noted earlier, my
project is ballooning in size and complexity, so I'm also looking at
getting a UML-CASE tool, such as Visual Paradigm, working with my project. That, however, shall be left for another day. I've only so much time on my hands.