Recent Changes - Search:

Tracking

Hardware

Software

Mega Plan

Etc.

SVNInstructions

Subversion

The project is using Subversion for source control.

SVN is a control system which allows us to create branches for code development that is independent of the production code. These branches allow the infrastructure developers to create their own copy of the trunk and make changes as needed, committing their changes to the repository in the process. Once development is stable, the developer is then able to merge their changes into the main production code for universal use.

In general, only the infrastructure developers will need their own branch. Developers of behaviors will continue to develop directly on the trunk. Branches will be used heavily for arduino, vision library, and core systems development.

Working copies are tied to a particular branch of the repository and are given local names. The current branch can be switched from the main (trunk) to a local development branch (branch) using the svn switch command, as specified below. To find your current working copy's repository root, run the svn info command.

pi@raspberrypi ~/flockbot $ svn info
Path: .
Working Copy Root Path: /home/pi/flockbot
URL: http://robo1.cs.gmu.edu/svn/robot/arc/flockbot/trunk
Repository Root: http://robo1.cs.gmu.edu/svn/robot
...

For infrastructure developers, ensure to run this when you grab a new robot and verify the URL. If you are one a different repository URL than intended, use the switch command to change your robot to the desired branch. Once you finish your work for the day, please switch the robot back to trunk for the users.

The new directory structure is:

flockbot
trunk
pi
arduino
wsn
vision_libraries
branches
completed
flockbot_v3_development
pi
arduino
wsn
vision_libraries
...
tags
flockbot_2_0
pi
arduino
wsn
vision_libraries
...

As an overview, the main, production code is that which is contained in trunk. This is what all of the flockbots will be using for their code. Branches will contain all development branches until they are merged back into the trunk. Once this occurs, that completed branch will be moved into the completed subdirectory, and a copy of the new trunk will be made in the tags directory. This enables us to maintain checkpoints that we can use if a particular merge needs to be regressed.

Common SVN Commands

Checking Out (Already Complete on All Robots)

  1. cd ~/
  2. svn co http://robo1.cs.gmu.edu/svn/robot/arc/flockbot/trunk flockbot

This command is run at the directory you wish to check the trunk code out to. The last argument here, flockbot, states that you want to give your working copy of the trunk a local name, flockbot. This has already been executed on all of the robots and does not need to be run again. Creating branches uses a different command, as listed below.

Creating a New Branch

  1. cd ~/flockbot
  2. svn cp http://robo1.cs.gmu.edu/svn/robot/arc/flockbot/trunk http://robo1.cs.gmu.edu/svn/robot/arc/flockbot/branches/newbranchname 
      -m "INITIALS: Informative Message Here" 

This creates a new branch named newbranchname in the repository.

Switching Branches

  1. cd ~/flockbot
  2. svn switch http://robo1.cs.gmu.edu/svn/robot/arc/flockbot/branches/newbranchname

Only run this from ~/flockbot on the robots. This will change the working copy to the specified branch. A series of SVN transactions will execute to put the working copy in the proper branch. Once the command returns, you will be in your development branch, or back on the trunk, as specified.

Integrating changes between Branches/Trunk

  1. cd ~flockbot

On clients running Subversion 1.8 or higher (Most modern OSs):

  1. svn merge http://robo1.cs.gmu.edu/svn/robot/arc/flockbot/trunk

On clients running older versions of Subversion:

  1. svn merge --reintegrate http://robo1.cs.gmu.edu/svn/robot/arc/flockbot/trunk
  2. svn commit -m "Reintegrating information"

Merging your Branch into the Trunk

  1. cd ~/flockbot
  2. svn merge http://robo1.cs.gmu.edu/svn/robot/arc/flockbot/trunk 
        http://robo1.cs.gmu.edu/svn/robot/arc/flockbot/branches/yourbranchname --dry-run 
  3. svn merge http://robo1.cs.gmu.edu/svn/robot/arc/flockbot/trunk 
        http://robo1.cs.gmu.edu/svn/robot/arc/flockbot/branches/yourbranchname 
  4. svn commit -m "INITIALS: Information on the merge"
  5. svn mv http://robo1.cs.gmu.edu/svn/robot/arc/flockbot/branches/yourbranchname 
        http://robo1.cs.gmu.edu/svn/robot/arc/flockbot/branches/completed/yourbranchname 

Only run this from ~/flockbot on the robots. This will change the working copy to the specified branch. A series of SVN transactions will execute to put the working copy in the proper branch. Once the command returns, you will be in your development branch, or back on the trunk, as specified.

Edit - History - Print - Recent Changes - Search
Page last modified on October 21, 2014, at 04:56 PM