Difference between revisions of "Help:Subversion"

From Biowikifarm Metawiki
Jump to: navigation, search
m (Linux: +svn status)
Line 8: Line 8:
 
The normal procedure is to  
 
The normal procedure is to  
 
* make a local svn checkout on the private computer of a user (for Windows installing Tortoise SVN is recommended)
 
* make a local svn checkout on the private computer of a user (for Windows installing Tortoise SVN is recommended)
* checkout https://biowikifarm.net/svn into a folder biowikifarm
+
* checkout https://biowikifarm.net/svn into a folder name "biowikifarm" in any location on your machine that you find suitable
* edit there
+
* edit any files there, or
 +
* add new files and mark them with a svn command (right-click when using Tortoise) as to-be-added
 
* make a subversion commit (if Tortoise SVN is installed, this is done by right clicking on an appropriate folder containing the changes)
 
* make a subversion commit (if Tortoise SVN is installed, this is done by right clicking on an appropriate folder containing the changes)
  

Revision as of 21:33, 19 June 2012

See also Configuring the subversion repository!

The Subversion version control system is used for various parts of the biowikifarm programming or configuration. Typically this involves:

  • a set of files is managed by subversion
  • on the server (e.g. /usr/share/mediawiki/ext-LOCAL-svn) the files are checked out from subversion, but should not normally be edited there (unless using command-line svn-commit briefly after the change)

The normal procedure is to

  • make a local svn checkout on the private computer of a user (for Windows installing Tortoise SVN is recommended)
  • checkout https://biowikifarm.net/svn into a folder name "biowikifarm" in any location on your machine that you find suitable
  • edit any files there, or
  • add new files and mark them with a svn command (right-click when using Tortoise) as to-be-added
  • make a subversion commit (if Tortoise SVN is installed, this is done by right clicking on an appropriate folder containing the changes)

A general recommended documentation about using SVN is available at http://svnbook.spears.at/nightly/en/ Flag icon en.png or http://svnbook.spears.at/nightly/de/ Flag icon de.png.

Using subversion on your local computer

Windows

It is recommended to install Tortoise SVN (http://tortoisesvn.net/downloads.html). After this is done, create a new folder, e.g. named “biowikifarmSVN” in any convenient location on your local machine (desktop, user folder, etc.). Right click on this folder, select “SVN Checkout …” in the context menu. Enter https://biowikifarm.net/svn into “URL of the repository”, leave the rest on the default setting, and click OK.

You will be asked for a username and password.

Tortoise will now download all files in the repository to your local computer. You can edit any files. (To test it, you can create a folder with your user name and “test” in the folder name.)

At first any changes exist only on your local computer. To make them “active” on the server, you need to “commit” your changes. To do this, right click the checkout folder in the Windows Explorer and select “SVN Checkout …” in the context menu. Now all changes will be uploaded.

If you have created a new file, you need to add it to the repository; this can be done in the commit dialog (the checkbox in front of files that have been newly created local and are not in the repository is unchecked at first, check it to include the file in the commit).

To update the files (others may have made changes and committed them) right click the checkout folder in the Windows Explorer again and select “SVN Update” in the context menu. Now all the local files will be updated.

Note: The above is standard use of SVN. However, depending which files your are editing, one point in the setup may be unusual or confusing: when you commit local changes to the repository, the repository itself will ALSO automatically update these files in the place where they may be actively used on the server.

Linux

Once you have subversion installed you can simply do checkout, update and commit using the command line.

cd /my/local/svn/directory/
# checkout the first time
  # svn checkout --revision r69050 http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/SemanticForms/
  svn checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/SemanticForms/

# Test for unwanted local changes:
  cd /usr/share/mediawikistaging/
  sudo svn status phase3 extensions; 

# update local files
  svn update http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/SemanticForms/
# commit files
  cd /my/checked-out/svn/
  svn commit --message "Type your justification here" # or
  svn commit --message "Type your justification here" myfile.txt
KDESvn screenshot

It is more convenient to use a GUI, like kdesvn.

  1. Click “Open…” and type in a subversion repository
  2. Click “Check out” and specify where you want to put it

On the server itself

The first time something is brought into subversion, i is necessary to make a checkout into folders on the server itself:

cd /usr/share/mediawiki/extensions/
# will copy all files for the FIRST time into /usr/share/mediawiki/extensions/SemanticForms/
sudo svn checkout --revision r69050 http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/SemanticForms/

# just an update
sudo svn update --revision r69050 http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/SemanticForms/

# query status
cd /usr/share/mediawiki/extensions/SemanticForms/
svn status
# '?' not in version control
# 'A' Item is scheduled for addition.
# 'D' Item is scheduled for deletion.
# 'M' Item has been modified.
# 'C' The contents (as opposed to the properties) of the item conflict with updates received from the repository.

# MISCELLANEOUS: make files executable: 
# svn propset svn:executable PATH
# make files not executable: 
# svn propdel svn:executable PATH