Difference between revisions of "SVN Migration"

From Lazarus wiki
Jump to navigationJump to search
m
Line 65: Line 65:
 
   ...
 
   ...
  
The URL for the repositories is:
+
The Read-Only (anonymous) URL prefix is:
 +
 
 +
http://www.freepascal.org/svn/
 +
 
 +
The URL prefix needed to be able to commit changes is:
  
 
  svn+ssh://username@www.freepascal.org/FPC/svn/
 
  svn+ssh://username@www.freepascal.org/FPC/svn/
  
This URL will be used in all examples below. On the local machine the repositories can be found with the URL
+
This URL will be used in all examples below.
 +
 
 +
On the local machine the repositories can be found with the URL
  
 
  file:///FPC/svn
 
  file:///FPC/svn
Line 77: Line 83:
 
  svn ls svn+ssh://username@www.freepascal.org/FPC/svn/fpcdocs/
 
  svn ls svn+ssh://username@www.freepascal.org/FPC/svn/fpcdocs/
 
  svn ls svn+ssh://username@www.freepascal.org/FPC/svn/fpc/trunk/
 
  svn ls svn+ssh://username@www.freepascal.org/FPC/svn/fpc/trunk/
 +
 +
'''Tip:''' Put the URL you need in an environment variable in your shell profile like
 +
 +
export SVNROOT=svn+ssh://username@www.freepascal.org/FPC/svn
 +
export SVNFPC=$SVNROOT/fpc
 +
export SVNFPCDOCS=$SVNROOT/fpcdocs
 +
 +
This way you can shorten the lines you need to type
 +
 +
  svn ls $SVNFPC
 +
  svn ls $SVNFPCDOCS
  
 
== Migration of CVS data ==
 
== Migration of CVS data ==

Revision as of 00:27, 13 May 2005

The Plan

  • Repository reorganisation
    • We won't use cvs2svn to migrate but simply import the whole source into svn to have a clean start.
    • Lazarus gets it's own repository.
    • The following repositories are planned:
      • fpc
      • fpcdocs
      • lazarus
      • contrib
      • projects
      • html (web page contents)
      • logs
    • another packages dir: packages/contrib with contains packages which are maintained externally. Something like the Delphi Companion CD. The long term goal is however to flatten the packages hierarchy (packages/base and packages/contrib?), work only with "build units/packages" in each directory. Making e.g. the fcl and fv a usual package as well.
    • Stuff in packages/contrib which isn't maintained actively anymore is moved to the contrib repository.
  • In the first step only ssh based authentification will be possible.
  • After everything is setup and working, a read-only cvs mirror will be installed.
  • The SVN project is updated regularily and releases new versions, so it's necessary to have policy when to update the SVN server. The proposed policy is to keep up always with the latest stable svn version.
  • Each repository gets it's own unix user group so permissions can be easily managed.

Usage

svn can be used very similiar to cvs. This wiki page gives some example commands to use the new subversion respository. For a complete list of commands use

 svn help
 svn help <command>

or read _the_ svn book can be found here: http://svnbook.red-bean.com/en/1.1/svn-book.html.

A sandbox repository is setup on idefix so you can test svn if you've an idefix account. The URL of this repository is svn+ssh://www.freepascal.org/FPC/svn/sandbox1

Repository layout

For the repository layout the defacto standard layout with trunk, tags and branches (virtual) directories will be used.

fpc/
  trunk/
    compiler/
    rtl/
    ...
  tags/
    release_2_0_0/
      compiler/
      rtl/
      ...
  branches/
    fixes_2_0/
      compiler/
      rtl/
      ...
    temporarydevelopment/
      compiler/
      rtl/
      ...
fpcdocs/
  trunk/
    Makefile
    *.tex
    ...
  tags/
    release_2_0_0/
  branches/
logs/
  Changes.fpc
  Changes.fpcdocs
  ...

The Read-Only (anonymous) URL prefix is:

http://www.freepascal.org/svn/

The URL prefix needed to be able to commit changes is:

svn+ssh://username@www.freepascal.org/FPC/svn/

This URL will be used in all examples below.

On the local machine the repositories can be found with the URL

file:///FPC/svn

To get a list of the directory layout the list command or its abbreviation ls can be used:

svn ls svn+ssh://username@www.freepascal.org/FPC/svn/fpcdocs/
svn ls svn+ssh://username@www.freepascal.org/FPC/svn/fpc/trunk/

Tip: Put the URL you need in an environment variable in your shell profile like

export SVNROOT=svn+ssh://username@www.freepascal.org/FPC/svn
export SVNFPC=$SVNROOT/fpc
export SVNFPCDOCS=$SVNROOT/fpcdocs

This way you can shorten the lines you need to type

 svn ls $SVNFPC
 svn ls $SVNFPCDOCS

Migration of CVS data

The weekend of 16-17 may it is planned to create the repository at idefix as described above. There is already scripting avaible to create the required directory structure from a CVS export of the FPC tree.

First release_2_0_0 tag will be imported, branched (fixes_2_0) and tagged (release_2_0_0). After that all changes made to CVS HEAD will be commited to the trunk and merged to the fixes_2_0 branch.

Checkout

To checkout the trunk (main development) of fpc use the following command:

svn co svn+ssh://username@www.freepascal.org/FPC/svn/fpc/trunk/ fpc

To checkout the latest stable that will make up the next release use the following command:

svn co svn+ssh://username@www.freepascal.org/FPC/svn/fpc/branches/fixes_2_0/ fpc-2.0

Updating and commiting

Updating and commiting works the same as with CVS with one expection. The exception is for files that had conflicts. Subversion requires you to explicitly mark files (or directories) that had conflicts as resolved.

To update the current directory use the follwing command:

svn up

To only update the compiler directory use the following command:

svn up compiler

To commit your changes

 svn ci

To mark a conflict as resolved:

 svn resolved <file>


Branching and tagging

For all major development tasks a branch will be created. This is to have the trunk allways be in a buildable state to don't disturb snapshot building. Only in branch it is allowed to not have code that can't be build.

Branching will only be done on a complete repository. Example command to branch:

svn copy svn+ssh://username@www.freepascal.org/FPC/svn/fpc/trunk/ \
         svn+ssh://username@www.freepascal.org/FPC/svn/fpc/branches/newdevelopment/

Tagging works the same as branching:

svn copy svn+ssh://username@www.freepascal.org/FPC/svn/fpc/trunk/ \
         svn+ssh://username@www.freepascal.org/FPC/svn/fpc/tags/newrelease/

After a branch or tag created it can be checkout with the following command:

svn checkout svn+ssh://username@www.freepascal.org/FPC/svn/fpc/branches/newdevelopment/ fpc-newdevelopment

Merging

For the compiler the policy is that all fixes and minor development will be done in the trunk. Merges of stable fixes can be merged to the fixes branch. Minor development changes are also allowed to be merged if the core developpers agree.

For the RTL, FCL and other packages. All fixes and new development can be merged as long as it also works with the latest released compiler.

TODO: Add example merge commands here

Tools

People prefer gui tools instead of command line clients. A good client with explorer integration for win32 is TortoiseSVN (http://tortoisesvn.tigris.org/ ). How to use it with ssh authenfication can be found here: http://tortoisesvn.berlios.de/faq/index.php?action=artikel&cat=8&id=30&artlang=en.