wiki:SvnIntro

Version 7 (modified by emontgomery, 18 years ago) ( diff )

--

Introduction to subversion (svn)

Subversion is a tool for managing software development that keeps track of who modified what and allows returning to a previous version if changes don't do what was expected. All the code lives on hosted-projects, and users pull the most recent version to their local machines, use it, making modifications as needed, then may push their changes back to hosted projects.

Below is a general description of how subversion works. Please look at the book for more detailed information. Following the introduction are links to pages that discuss use of two GUI clients (one for PC and one for Linux).

Conceptual model

  • A svn server holds one or more code repositories
  • A repository consists of all versions of the program/document under development, plus info on who made changes, and when.
  • Each each change committed gets a new revision number.
    • if file_a is changed, then file_b, then file_a, then file_c, then file_b, at the end, the repository is a revision 5.
    • the revision history of file_a has 1,3; file_b has 2,5 and file_c has 4
    • revisions in a repository are sequential, but the revision history of individual files may skip some numbers.
  • The repository referred to here contains the ROMS Sediment Transport model code:
        http://svn1.hosted-projects.com/cmgsoft/roms_sed
    

Important Terms

  • Checkout = download a NEW project from the repository (do this once)
  • Update = get the most recent changes to a project from the repository (only possible after intial checkout)
  • Commit = send your changes to the project repository

Access

  • Anyone should be able to view the contents of the repository, look at this wiki and view the tickets.
  • A username and password are required to put your changes back into the repository.
  • To work with data from a repository, you "checkout" a version.
  • You can check out the most recent version or a specific release, and either the entire repository, or just certain subdirectories.
  • Checking a project out makes a copy of the most recent version on the client requesting checkout
  • Svn suggests only checking out into an empty directory

What you get

  • If you choose to checkout the project into my_roms_sed, you’ll find trunk, branches, and tags directories created in your local directory.
  • Trunk is the main area for development, and unless otherwise instructed, work with the code in trunk
  • Tags will contain stable versions if they exist
  • Branches will have offshoots implementing new functionality- develop in the branch, then merge back into the trunk

Work flow

  • Start each session with update:
  • Modify and debug the code locally
  • When you’re done with changes, commit changes to the repository
  • This will cause the version number to be updated at the repository
  • repeat

Conflict resolution

  • Svn uses copy, modify, merge as it’s operational model
  • It is possible for two people to change the same chunk of code at similar times, and when the commit happens, this will be detected, and the users will have to interact to resolve the conflicts
  • A process similar to diff finds the conflicts
  • Right click TortoiseSvn, and try merge and/or blame to deal with conflicts

Notes

  • Everything happens at the folder level- Svn doesn’t operate on single files.
  • Use svn tools to copy files into or our of a svn directory so the change can be tracked- the change will propagate to the repository on the next commit
  • The .svn directory in each project main directory keeps track of the repository information, so you don’t have to say where to put commits, it puts them where it got them.

Help on using TortoiseSVN, a GUI (subversion) client for PC

Help on using SmartSVN a java based multi-platform GUI (subversion) client

return to the roms_sed start page

Note: See TracWiki for help on using the wiki.