top of page

Team Gallery

software (61).JPG

SVN USAGE

The Spartan Robotics Team uses Subversion (SVN/TortoiseSVN) to manage and share robot CAD, software source code, documentation, graphics, and other team files. 

Follow these rules whenever working with SVN.  This is especially important with SolidWorks CAD files.

SVN Files Rules

 

The SVN server is not an endless resource for saving files.  Only check these types of files into the repository.  People who don't follow these rules will lose their SVN server privileges.

  • 971 Team CAD Files - parts and assemblies.  Don't check in temporary files with "~" in the names or STEP files.

  • 971 Team Source code for the robot and drivers station.  Don't check in object files or executables or distribution files from other sites like WPILib zips or tar files.  Don't check in documentation that is available on other websites (e.g. WPILib documentation).  You can check in a simple Readme.txt or Readme.html files with directions and links to these resources, or better yet, update the build scripts to automatically download them when necessary.

    • Do not share team CAD or source code files with people outside of the team without first getting approval from the team Leadership Council.

  • 971 art work used for the logos on the robot.

  • Don't check in game documents or other files that are available on the web. 

  • Check files into the correct place.  The repository has a very clear structure.  Use it.  Ask Brian, Austin, or Michael if you have questions about where to check in a file.

  • If you are unsure about if a file is appropriate to check into the repository, then ask Brian, Austin, or Michael before checking it in.  The SVN repository is designed to permanently keep files.  The "svn delete" command does not delete the files from the repository.  They are always there once checked in.

  • If you have a file that does not fit in the above list, and want to share it with the team, use Google Docs, Drop Box, or some other similar way of sharing.

Before Editing

  • Close all open files in SolidWorks before doing anything with SVN, or else you are likely to need the "Fixing Hangs" section.

  • Right click on the top level SVN folder and click "SVN Update".

  • Type in your username and password if it asks.

  • If there are any conflicts (it says "Warning! One or more files are in a conflicted state" in red in the update window), resolve them (see RESOLVING CONFLICTS).

  • Make sure nobody else is working on the assemblies and/or parts you are going to edit.

  • YOU ARE NOT DONE EDITING ANYTHING UNTIL YOU CHECK IN (see AFTER EDITING)!

AFter editing

  • Close all open files in SolidWorks before doing anything with SVN.

  • Right click on the top level SVN folder and click "SVN Commit..." (if it hangs, see FIXING HANGS).

    • Think about exactly why you are checking in. If you have just finished 1 file and are planning to work on more, you should not check in. Instead, if there is no reason to check in immediately, finish your work for the day and then check in.

    • If you didn't change any of the files that are checked, right click on them and click "Revert..." (and then click the top button that says "Revert").  This is important because it helps prevent conflicts and save server space because each revision of each file is permanent.

    • If you don't want any of the files that aren't checked (new files), right click on them and click "Delete" (and then "Yes"). If you just leave them on team computers, it is confusing to others who then do not know what to do with them.

    • Make sure to check the check boxes next to any new files you created or they will not be checked in.

    • Type in your log message.  Here is some guidance for creating a good and helpful log message:

      • A commit message should always describe what you have changed.  When writing a commit message, you should always keep in mind it's purpose.  The purpose of a commit message is to make it easier to find out when changes were made to files and folders.  When someone is viewing your commit message, it will always be along with the date and time of your commit, the names of all of the files and folders that were changed and how they were changed, the SVN username you are using, and all of the other commit messages in order.  This means that you should NOT put the full names and paths of all the files that you edited into the commit message!! Instead, you should put a description of what the goal of your changes was.  Also, saying "here are my changes" is not very helpful, because there is no other reason for a commit message. For example, instead of something like
           "Today (2/23/2011) I edited CAD/roller_claw_number_2.SLDPRT, CAD/roller_claw_assembly.SLDASM, and CAD/roller_wheels.SLDPRT and created CAD/roller_claw_reinforcement_piece.SLDPRT"
        you should write something like
           "Fixed some dimensions on the claw and added a reinforcement piece to it."
        because anybody looking at your commit message will be able to see that you modified those 3 files and created that one.  However, what they will not be able to tell without a lot of work is what your changes did (fixed the size and made it stronger).

    • Click "OK".

    • Type in your username and password if it asks. If you're on a team computer, do NOT check the box to save them. However, on a personal computer, checking that box is probably a good idea.

    • If it says (in red) that something is out of date, update (see BEFORE EDITING) and then try again. Sometimes, TortoiseSVN will offer to update for you.

Fixing hangs​

  • If any SVN dialog box hangs for longer than usual, right click on the top level SVN folder and go to "TortoiseSVN" > "Clean up..." and then click "OK".

  • Right after doing this (as fast as you can move your mouse), do whatever you were trying again.

  • It sometimes takes a couple of tries to get it.

  • Also, there is an incompatibility between newer versions of TortoiseSVN and Solidwork on Windows 7 related to the preview icons on Solidworks files which results in the dialogs hanging all of the time. To fix it, download solidworks_registry_fix.reg and run it (as an adminstrator), clicking yes/ok/whatever to all of the Windows warnings (you can open it with a text editor to see what it's doing if you want).

Resolving conflicts​

  • Go to wherever the file that has the conflict is (it might have a yellow! on it).

  • There will be 3 files:

    • Just the filename, which is whatever you ended up with.

    • 2 files with .rxxxx appended to them.  These are the last file that you got from the repository and the file that is currently in the repository.

  • Either rename the file with the bigger xxxx appended to it to the original filename or delete the 2 .rxxxx files, depending on which version you want to keep.

bottom of page