Hosting documentation/Subversion

From Bioinformatics.Org Wiki

(Difference between revisions)
Jump to: navigation, search
m (See also)
m
(One intermediate revision not shown)
Line 5: Line 5:
Type the following, making the necessary obvious substitution for the repository and module names:
Type the following, making the necessary obvious substitution for the repository and module names:
-
  $ svn checkout svn://bioinformatics.org/svnroot/repository[/module] [directory]
+
  $ svn checkout <nowiki>svn://bioinformatics.org/svnroot/</nowiki>''repository''[/''module''] [''directory'']
Note that you do not need to specify the destination directory. If you are checking out a repository named "bioworks", for example, you could change to the directory where you want the repository to be placed, and then type the following:
Note that you do not need to specify the destination directory. If you are checking out a repository named "bioworks", for example, you could change to the directory where you want the repository to be placed, and then type the following:
-
  $ svn checkout svn://bioinformatics.org/svnroot/bioworks
+
  $ svn checkout <nowiki>svn://bioinformatics.org/svnroot/bioworks</nowiki>
==Subversion clients==
==Subversion clients==
Line 30: Line 30:
# Change your primary group affiliation to "svn" using the '''newgrp''' command ([http://svnbook.red-bean.com/en/1.1/svn-book.html#svn-ch-6-sect-5 explanation]).
# Change your primary group affiliation to "svn" using the '''newgrp''' command ([http://svnbook.red-bean.com/en/1.1/svn-book.html#svn-ch-6-sect-5 explanation]).
-
 
# Use the "FSFS" filesystem type ([http://svnbook.red-bean.com/en/1.1/ch05.html#svn-ch-5-sect-1.3 explanation]).
# Use the "FSFS" filesystem type ([http://svnbook.red-bean.com/en/1.1/ch05.html#svn-ch-5-sect-1.3 explanation]).
Line 45: Line 44:
The next set of Subversion commands can be run from your local machine, and they will have the following form:
The next set of Subversion commands can be run from your local machine, and they will have the following form:
-
  $ svn command svn+ssh://username@bioinformatics.org/svnroot/repository
+
  $ svn ''command'' svn+ssh://''username''@bioinformatics.org/svnroot/''repository''
 +
 
 +
'''Important''': If you want to ''disable'' anonymous downloads and access via the [http://www.bioinformatics.org/websvn/ Web interface], you must edit /svnroot/''repository''/conf/svnserve.conf, and add the following line:
 +
 
 +
anon-access = none
==Importing source code into a Subversion repository as a developer==
==Importing source code into a Subversion repository as a developer==
Line 51: Line 54:
On your local machine, change to the parent directory of the directory whose files (and subdirectories) you want to import.
On your local machine, change to the parent directory of the directory whose files (and subdirectories) you want to import.
-
Type the following:
+
Type the following, where ''directory'' is the directory you want to import, ''module'' is the name of the new root-level module for the repository, ''repository'' is the unix name of your group, and ''username'' is your shell account username on the server:
  $ svn import ''directory''/ svn+ssh://''username''@bioinformatics.org/svnroot/''repository''[/''module''] -m 'message about import'
  $ svn import ''directory''/ svn+ssh://''username''@bioinformatics.org/svnroot/''repository''[/''module''] -m 'message about import'
-
where ''directory'' is the directory you want to import, ''module'' is the name of the new root-level module for the repository, ''repository'' is the unix name of your group, and ''username'' is your shell account username on the server. If, for example, your username is "jdoe", and you are importing a new module named "trunk" into the repository named "bioworks", you would type the following:
+
If, for example, your username is "jdoe", and you are importing a new module named "trunk" into the repository named "bioworks", you would type the following:
  $ svn import bioworks/ svn+ssh://jdoe@bioinformatics.org/svnroot/bioworks/trunk -m 'Initial import.'
  $ svn import bioworks/ svn+ssh://jdoe@bioinformatics.org/svnroot/bioworks/trunk -m 'Initial import.'
Line 65: Line 68:
Change to the directory where you want the module to be placed. ('''Important''': This has to be a different directory from the one you used to import the module, since the module will be downloaded as a new directory with some version control files in it.) Then, type the following, making the necessary obvious substitution for the username, repository and module names:
Change to the directory where you want the module to be placed. ('''Important''': This has to be a different directory from the one you used to import the module, since the module will be downloaded as a new directory with some version control files in it.) Then, type the following, making the necessary obvious substitution for the username, repository and module names:
-
  $ svn checkout svn+ssh://username@bioinformatics.org/svnroot/repository[/module] [directory]
+
  $ svn checkout svn+ssh://''username''@bioinformatics.org/svnroot/''repository''[/''module''] [''directory'']
After the initial checkout, you can change into this directory and execute other Subversion commands without using the URL of the server. For example:
After the initial checkout, you can change into this directory and execute other Subversion commands without using the URL of the server. For example:
Line 81: Line 84:
* [http://svnbook.red-bean.com/ Version Control with Subversion] (a free book)
* [http://svnbook.red-bean.com/ Version Control with Subversion] (a free book)
-
* [http://svn.collab.net/repos/svn/trunk/doc/user/cvs-crossover-guide.html CVS to SVN Crossover Guide]
+
* [http://svn.apache.org/repos/asf/subversion/trunk/doc/user/cvs-crossover-guide.html CVS to SVN Crossover Guide]
* [http://subversion.tigris.org/files/documents/15/177/svn-ref.ps Subversion Quick Reference] (PostScript)
* [http://subversion.tigris.org/files/documents/15/177/svn-ref.ps Subversion Quick Reference] (PostScript)

Revision as of 06:01, 10 December 2012

Contents

Anonymous Subversion access

Anonymous Subversion access uses svnserve and does not require SSH.

Type the following, making the necessary obvious substitution for the repository and module names:

$ svn checkout svn://bioinformatics.org/svnroot/repository[/module] [directory]

Note that you do not need to specify the destination directory. If you are checking out a repository named "bioworks", for example, you could change to the directory where you want the repository to be placed, and then type the following:

$ svn checkout svn://bioinformatics.org/svnroot/bioworks

Subversion clients

If you are using a Unix-variant, Subversion clients are easy to find or may already be installed on your system. Simply type svn to see if you have one.

For Windows, TortoiseSVN is one of the best clients and highly recommended.

Plus, Bioinformatics.Org has a Web interface for browsing and downloading source code from Subversion.

Developer access

For all developer (read/write) access, you will be using SSH (Secure Shell). The SSH (2.x or better) client must be available to your local machine. Note that you will need to type in your password for each command, unless you use ssh-agent with SSH keys. SecurityFocus has articles on generating SSH keys and setting up ssh-agent.

Creating a repository as a developer

This part requires shell access.

Important: If you want to enable anonymous downloads and access via the Web interface, you must use the following modifications to repository creation:

  1. Change your primary group affiliation to "svn" using the newgrp command (explanation).
  2. Use the "FSFS" filesystem type (explanation).

From your shell account on the Bioinformatics.Org server, type the following:

$ newgrp svn
$ svnadmin create --fs-type fsfs /svnroot/repository

where repository is the unix name of your group. If you are creating a new repository named "bioworks", for example, you would type the following:

$ newgrp svn
$ svnadmin create --fs-type fsfs /svnroot/bioworks

The next set of Subversion commands can be run from your local machine, and they will have the following form:

$ svn command svn+ssh://username@bioinformatics.org/svnroot/repository

Important: If you want to disable anonymous downloads and access via the Web interface, you must edit /svnroot/repository/conf/svnserve.conf, and add the following line:

anon-access = none

Importing source code into a Subversion repository as a developer

On your local machine, change to the parent directory of the directory whose files (and subdirectories) you want to import.

Type the following, where directory is the directory you want to import, module is the name of the new root-level module for the repository, repository is the unix name of your group, and username is your shell account username on the server:

$ svn import directory/ svn+ssh://username@bioinformatics.org/svnroot/repository[/module] -m 'message about import'

If, for example, your username is "jdoe", and you are importing a new module named "trunk" into the repository named "bioworks", you would type the following:

$ svn import bioworks/ svn+ssh://jdoe@bioinformatics.org/svnroot/bioworks/trunk -m 'Initial import.'

Conventional repositories contain trunk, branches and tags modules at the root level.

Initial checkout and other commands as a developer

Change to the directory where you want the module to be placed. (Important: This has to be a different directory from the one you used to import the module, since the module will be downloaded as a new directory with some version control files in it.) Then, type the following, making the necessary obvious substitution for the username, repository and module names:

$ svn checkout svn+ssh://username@bioinformatics.org/svnroot/repository[/module] [directory]

After the initial checkout, you can change into this directory and execute other Subversion commands without using the URL of the server. For example:

$ svn update
$ svn add filename
$ svn delete filename
$ svn commit

See also

External links

Personal tools
Namespaces
Variants
Actions
wiki navigation
Toolbox