Difference between revisions of "Subversion repository"

From FIFE development wiki
Jump to: navigation, search
Line 77: Line 77:
=== TortoiseSVN ===
=== TortoiseSVN ===
[[Category: Developers]]
[[Category: ArchiveDevelopers]]
[[Category: Archive]]
[[Category: Archive]]

Revision as of 08:03, 13 March 2013


This article was written assuming that you already worked with CVS or Subversion. If you did not do so, consider reading these useful guides that explain the subversion system and svn clients in detail:

SVN structure

SVN repository is divided into following folders:

  • branches
    Branches contain code that is developed in separation to the trunk version. Potentially disruptive changes are isolated with this mechanism (disruptive being a change that may alter the behavior in many places, thus breaking the existing functionality). Branches are integrated as part of trunk when change has been validated to be functional.
  • tags
    Old releases are stored here.
  • trunk
    The latest and greatest "main branch" is stored here.

Anonymous secure checkout

The following lists the svn commands that can be used to get the source code from the repository:


svn co http://fife.svn.cvsdude.com/engine/trunk

Trac SVN browser for trunk

In case you want to view the SVN trunk via the trac browser tool, follow this link: https://fife.trac.cvsdude.com/engine/browser/trunk/

Whole repository (all branches)

Note that you don't usually need this, trunk versions should be enough in most cases.

svn co http://fife.svn.cvsdude.com/engine

Trac SVN browser for whole repository

In case you want to view the whole SVN repository via the trac browser tool, follow this link: https://fife.trac.cvsdude.com/engine/browser

Gaining write access


  • You resolved at least a couple of issues and created a DIFF / patch file for them that you attached to the corresponding trac tickets.
  • You are actively participating in the project since at least one month.
  • You've got a subversion client (TortoiseSVN recommended for Windows users!).
  • The active staff will decide about whom to give write access on a case by case basis. The discussion will take place at IRC channel.
  • After the staff agreed to give you SVN write access, one of the project admins will set up an SVN account for you. This account works for the Subversion repository as well as for the Trac project management software.

Common tasks

Command line client

  • checkout
    • For checkout, see examples above
  • update
    • svn update updates latest stuff from repository into your work area. Watch out for possible conflicts!
  • update to a specific revision
    • svn update --revision <revision> updates to a specific revision. This is useful to find out when a bug was introduced.
  • add new file
    • svn add newfilename
  • remove file
    • svn remove filename
  • copy files
    • svn copy sourcefilename destfilename
  • move files
    • svn move sourcefilename destfilename. This is same as copy + remove the old file
  • checking what changes you have made in file name level
    • svn status -q → lists all changed files in comparison to your latest sync with the repository. Hides files that are not under version control
  • checking what changes you have made in file content level
    • svn diff <filename> → shows differences in given file. If filename is omitted, shows difference in all files
  • commiting your changes
    • In most simplest form → svn commit. This assumes that you have already committed earlier and set your username and password. It opens editor to enter your comments related to commit. Enter the commit message on top of the file and press alt+0 to exit.
    • Complete form → svn commit -m "your commit message here" --username youruserid --password yourpassword
  • create a new branch
  • merging back from branch to trunk
    • run the following from trunk directory svn merge -r [BRANCH_CREATION_REVISION]:HEAD https://fife.svn.cvsdude.com/engine/branches/active/[YOURBRANCHNAME]
    • After succesful merge, you can remove your branch. In case development gets stalled in branch, it gets eventually moved into historic branches
    • for branching and merging, see svnbook
  • merging trunk to branch
    • If you want to sync current trunk changes back to branch use similar command than with other merges: svn merge -r [LATEST_SYNC_REVISION]:HEAD https://fife.svn.cvsdude.com/engine/trunk (run from branch directory)