BGV Subversion (SVN) Repository

General information

The BGV SVN repository facilitates the collaborative development of software and documents.

SVN is a versioning and revision control system. The versioned data (files) are stored in a repository. CERN provides the needed infrastructure to create specific repositories on demand.

Documentation

Many resources are available on the web. Here are a few good ones:

Access & Authentication

  • The read and write access requires authentication
  • Access rights
    • Read: any user with a CERN computing account
    • Write: all members of the e-group "lhc-bgv" (a CERN computing account is required)
  • BGV repository root: svn.cern.ch/reps/bgv
  • Different access protocols can be used (mind authentication): http, https, svn, svn+ssh
  • Read-only access is possible with a web browser: https://svnweb.cern.ch/cern/wsvn/bgv

Ways to work (CL or GUI)

To work with SVN one can use the command-line (shell) or a wide range of graphical interfaces (see http://en.wikipedia.org/wiki/Comparison_of_Subversion_clients). The examples and instructions given below refer to the command-line option.

Organization of the BGV repository

There are 3 top-level folders
  • docs: Common development of documents
  • sw: Gaudi software
  • user: Private developments (note: by default there are no additional access restrictions)

Structure of folder sw

  • Standard structure is adopted which consists of 3 directories
  • trunk: the main line of development; contains all latest versions
  • tags: a tag is a set of specific package versions, which together form a self-consistent set (e.g. a Gaudi Project) that can be used for specific purposes (e.g. Digitization, Reconstruction, etc.)
  • branches: for independent developments parallel to the trunk

Commands reference

Only a few commands are sufficient for a large fraction of the interactions with svn:

  • svn help
    • SVN self-documentation. Can be used on the svn commands

  • svn checkout
    • Create a working copy (i.e. obtain a local copy of a specific version of a specific folder in the repository)
    • Any local folder can host the working copy
    • Example: get the latest version of sw package SciFi/SciFiDAQ
       svn checkout https://svn.cern.ch/reps/bgv/sw/trunk/SciFi/SciFiDAQ 

  • svn update
    • Update your working copy (if the repository contains files "newer" than the files in the working copy, the latter are updated)
    • Should be executed inside a directory which is under svn control. The repository address is determined automatically

  • svn status
    • Review the changes made to the working copy
    • Use -u to query the repository (by default only local info is used)
    • Use -v for listing all files (not only the modified ones)

  • svn add, svn delete
    • Schedule a file/directory to be added or removed from the repository (the actual operation is executed when svn commit is called)
    • Example: add new source file to a sw package. E.g. svn add src/NewAlgorithm.cpp when inside the SciFi/SciFiDAQ directory

  • svn commit
    • Publish the changes made on the working copy to the repository
    • Strongly recommended to use the -m option and provide a short description of the made changes

Guidelines for SVN commit

The list below provides useful guidelines and can serve as a checklist for making changes to the sw folder of the repository. This LHCb page was used as a prototype.

  1. Discuss with the package responsible
    • The name of the relevant person can be found in the doc/release.notes file of the package

  2. Document each modification in the doc/release.notes file of the package
    • See the existing packages for examples

  3. Commit often, but commit only code that compiles and runs
    • Also, make sure the package compiles with the latest versions of other relevant packages. For example, the SciFiDAQ package uses methods defined in the SciFiDet package. If SciFiDet is modified, SciFiDAQ should compile and run too

  4. Check what you are about to commit against the repository
    • svn status -u
    • This will list the files that have changes with respect to the versions in the repository. The type of difference will be marked with one or more letters. The most common are (the complete list can be found in the SVN documentation):
      • M for changes in your copy
      • ? for new files
      • ! for files removed
      • * for files that have a new version in the repository
      • C if there are conflicts between your changes and the ones in the repository
    • Make sure that there is no C in front of any file: C in front of a file means that several people are working on the same package so be careful: SVN has tried to merge your modifications with the changes already done and it has NOT succeeded. See the LHCb SVN page for more details
    • Check carefully, and eliminate or ignore any ? in source directories: These are files that you created newly and that are not in the repository. If you wish to save them in SVN, you have to svn add TheFileToAdd. Do not add any file in the cmt/ directory, or any file that should not be kept (e.g. files whose name ends with "~")
    • Tell SVN to remove from the repository the files you have deleted if any: files that were marked as lost are files that you removed. If you wish to remove them from SVN, issue the comand svn rm TheFileToRemove

  5. Check for conflicts
    • svn update
      • Ensures that the working copy is based on the current latest version
    • svn status -u
    • Any C should have been replaced by M
      • Don't commit before resolving the conflicts. If needed, discuss with colleagues
    • Any ? should have been replaced by A, or just ignored, you may have several ? left
    • Any ! should have been replaced by D

  6. Commit
    • Always add a meaningful comment: use the svn text editor or the -m   option
    • svn commit -m "some brief and meaningful comment"

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r5 - 2016-03-25 - PlamenHopchev
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    BGV All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback