Hello again,
There seams to be some interest, so I will write a quick short tutorial for now.
<Warning: This post grew much longer then I expected. Please have patience while reading to the end >
For those that only backup by saving the whole project directory, this can work, but is error prone. It is very easy to mislabel a backup, and restore/delete the wrong data. Revision control removes that error, by controlling revision numbers, allowing browsing previous revisions. Tracking “whom did what” is incredibly easy. It remembers and controls what has and hasn’t been changed, and what needs to be merged. Making a backup of the revision system, can be as simple as copying the “repository” directory, (only 1 backup is ever needed) or as complicated as mirroring. I continually convince my co-workers that are working on a project alone to use revision control. I can not tell you how many times it has saved me from trouble. When used in very complicated situations, (far beyond the capability of zipping the project directory, and the scope of this post) it is possible to create problems, although they can be easy to avoid using correct procedures.
I am not sure which version of LabVIEW will be shipped with the robot kit, but each version is full of new features. I hope they ship LabVIEW 2010 with the kit, because LabVIEW 2010 has a very valuable feature. It is able to separate compiled code from the source. This is a project settable option, and a VI settable option. This means if you start a new project, and choose this option, it is applied to all existing/new VI’s in the project. In short, LabVIEW stores a lot of information in the VI file. 2 of those objects are the block diagram, (source code) and the compiled code. Every target requires recompilation. Many things can cause a code recompile, but it is very frustrating to cause a lot of conflicts when the code of those VI’s where not actually modified. Setting this special option, completely eliminates this kind of conflict.
A good resource for multi-developer FRC projects is the FRCMastery site. There are a lot of procedural programming that really assists in preventing collisions when more then 1 programmer is working on the project at the same time. I highly recommend watching this video:
http://frcmastery.com/try-me/one-project-multiple-programmers/
Before I start, each team will have to evaluate their needs, and decide on the possible options. The options are:
-
Localhost server
(simplest solution) - LAN server
-
WAN server
(Most complete, but expensive solution)
The localhost server option, can be free, and easy. It will not be accessible from other computers. It is however, a great backup solution.
The LAN server, is accessible via your local network. If the programmers will be physically near each other all of the time while developing, then this is a good solution. Somewhere between the LAN and WAN options, is the use of VPN software. This is a “virtual” LAN, and can be very complicated or simple. I personally use a program called Hamachi. It is near zero configuration. In any case, most school networks will probably try to block all VPN software.
The WAN solution will probably cost some amount of money. Most include wiki pages, bug tracking, and user control. Although some packages can be found for under $10/month, they are probably overkill, unless a team webpage/wiki are also required. A simple search will yield hundreds of results. If this option is chosen, I recommend it be setup well before the beginning of the kick-off because a lot of effort can be put into perfecting/customizing the system. All of the options can use the same client and operating procedures below. The server setup for WAN option, will be detailed on the providers website.
Server setup:
For the localhost/LAN options only. This tutorial will only outline how to setup SVN on windows. I am not as familiar with the other systems to write a tutorial off the top of my head. Administrator privileges will be required to install on most windows systems.
I recommend VisualSVN Server. It is very simple to setup and free.
- Download at:
http://www.visualsvn.com/server/
VisualSVN is a SVN client that integrates into Visual studio. It is probably very useful for C programming, but, not very useful for LabVIEW. They do not offer much support for their free server. It is actually a nice installer and configuration for the open source SVN and Apache servers. It should just install without much trouble.
2) After accepting the license agreement, choose “VisualSVN Server and Management Console.”
3) Choose install location, and repository location. The repository location may get fairly large, so choose a location with ample file space. I would recommend a minimum of 10x of the project size for last year. I guess in the neighborhood of 1GB, without documentation. The file size can be reduced, but must be done manually, and reduces the number of actual revisions that are available. A very large professional project that I work on consumes less then 50GB with thousands of revisions maintained. Revision systems are generally very efficient at data storage. Server port should default to 443, using a secure connection (https://) and Subversion authentication.
4) Allow the installer to complete. (We are almost done already)
5) Open the VisualSVN Server Manager. This is where users can be specified, along with passwords. For multiple developer, I suggest that each developer use a separate user name/password. This will be useful later when reading the commit logs for a specific file.
6) Add repository. Name it whatever you wish, but remember this name. (This name is used to access the repository, so choose something easy to type like, “FRC2011”)
7) One can browse the source at https://localhost:443/svn (Remote computers should replace localhost with the computer’s network name. At this point there won’t be any files however.
8) Windows Firewall may prompt to unblock the server. Other firewalls/institution security parameters may require modification. These are outside the scope of this post. The localhost will probably always work. Network connections may be more challenging. Using the robot wireless Access Point will work, but connecting each computer to the router is also beyond the scope of this post. Again if there is interest, and more importantly time, I may write more on those topics also.
Client:
I recommend TortoiseSVN. (TSVN) There are other options, but I personally use this client. I am currently still researching alternatives, however, I have not found anything that works better for my use scenario.
- Download at:
http://tortoisesvn.tigris.org/
- Install, following all default parameters. Allow the computer to restart when the installer completes.
- After reboot, navigate to a folder where you wish to store your code. Right click on the folder, and click “SVN Checkout…” In the “URL of repository” field, type in “https://localhost:443/svn/FRC2011” localhost again is replaced by the computer name if using a network and FRC2011 would be changed to the repository name chosen earlier in the server setup, step 6. Ensure that the “checkout directory” field is still valid. Sometimes the whole URL is inserted, which is not required. The recommended checkout directory is the folder that you right clicked on plus a descriptive folder name. (IE. FRC2011) Leaving all other options on default, Click OK.
- TSVN will likely prompt to accept the security certificate. This error occurs when installing using this method. The certificate was created by the installer, but is not verifiable against a third party. Third parties charge a lot of money for this service, and is generally not required for this use scenario. “Accept permanently” will not prompt this dialog anymore. This is the recommended choice.
- TSVN will prompt for an user name and password. Input the name/password chosen in the server setup, step 5. Each user again using a different log-in credentials.
- The folder is now ready for files, and a project. Add a project, and make your first commit. (Everything in TSVN is accessed via right clicking on the appropriate file/folder in the windows explorer) Important note: Always add a reasonable comment when committing anything. Useless comments will only harm you later! Other users may now repeat, and will receive the new project.
Some important procedures:
- Communicate! None of this will work if multiple developers do not communicate. This is critical!
- Commit OFTEN! This is very important to avoid conflicts and data loss. Only files that actually have changed will be committed, so file size should not be an issue. This also means that saving before committing is a must. Closing the project before updating is also required without using other tools. (Other tools are available, but are beyond the scope of this post. I may elaborate in a future post)
- If all of the techniques in the FRCMastery video are followed, collisions will be low, and generally easy to resolve. If LabVIEW 2010 is shipped available, use the “Separate compiled code” option. This will save a lot of headache. This one feature was my most desired feature in LV2010, and I don’t know how I survived without it.
- Make winning robot code. Good luck everyone!
- Communicate! Sorry but had to add that again, this is so very critical.
Edit: There is a program that I also recommend called CommitMonitor. It is made by the same guy that makes TSVN. It is not required, but if SVN is used remotely, this tool is great. When setup (Using the same URL field above) it will alert you when someone commits something to the server. It allows for better communication and it can be difficult to directly speak to other developers.
I believe this is the end, but it has taken more time then I had expected, so there maybe something missing. After a very long day, I am going to catch the lunar eclipse. This means I have not proof read very well, besides I am a programmer, not an English major. I, therefore, request that you excuse any mistakes that I may have made. 
Mike