Subversion repository
From FIFE development wiki
|
[edit] Introduction
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:
- The subversion book by O'Reilly Media; a complete subversion reference
- Working with TortoiseSVN under Windows
[edit] 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.
[edit] Anonymous secure checkout
The following lists the svn commands that can be used to get the source code from the repository:
[edit] trunk
svn co http://fife.svn.cvsdude.com/engine/trunk
[edit] 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/
[edit] 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
[edit] 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
[edit] Gaining write access
[edit] Requirements
- 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.
[edit] SVN guidelines
- Code should compile without warnings on a recent gcc(4.x) and at least the -Wall flag before you consider commiting it. It's ok to commit something with some warnings if you are still working on it and it's not finished yet.
- Don't commit something that doesn't compile
- If you do something that breaks lots of stuff and will take some time, create your own branch
- Apart from the previous points, commit often
- Set SVN:eol-style to "native" for the following file types:
- .h, .hpp
- .c, .cpp
- .py
- .txt
- .xml
- .dot
- Set SVN:executable to "*" only for Python scripts that *nix users should be able to run directly. Add a shebang to these scripts and only to these scripts as well
- Set SVN:ignore for the following file types:
- .dll
- .exe
- .pyc
- thumbs.db
- The commit log message should contain a summarization of your commited changes
- Check your changes before commiting with svn status (command line client) / Check for modifications (TortoiseSVN)
- Always test your code before your commit. Testing has been tried to make as easy as possible. At minimum, run our main test client (island demo) and unit test set ("python test_fife -a" from trunk/) to see if your code really works as part of the system
[edit] Common tasks
[edit] 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
- svn copy -m "[YOUR BRANCH MESSAGE]" https://fife.svn.cvsdude.com/engine/trunk https://fife.svn.cvsdude.com/engine/branches/active/[YOURBRANCHNAME]
- 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)

