Development/Howto/Subversion
From Mandriva
This page contains a short summary of what you need to know to grab a snapshot from subversion.
Contents |
Subversion, rpm and associated tools
Subversion is split into several rpms. The client is in subversion.rpm. It will ask you to choose a library, to access a remote repository.
Since most of the time you will use webdav as a protocol, please choose subversion-client-dav.
There are some gui tools (like Rapidsvn) and svm, to mirror the repository. You may also be interested in svk, which enables use of subversion in a distributed fashion (Distributed Version Control with svk and SVK Wiki)
Subversion command
Subversion was designed to look like cvs. So, the command to check out a release is
svn checkout http://svn.server.org/path/to/file/
Subversion doesn't handle tags and branches like cvs does. If you want to keep a version, just use svn cp. That is why most of the time, you see 3 top level directories:
- trunk/ contains the working copies
- branches/ contains experimental branches, that will be merged in the main trunk once they are valid
- tags/ contains version tagged like cvs does. If you want the version labeled 0.1, it should be usually here
It is not mandatory to use this scheme. However, this is the recommended layout of the official documentation, so this is widely used.
cvs stores all information in a CVS subdirectory. subversion uses the .svn subdirectory. You should not include them, and RpmLint will give you a warning if you keep them.
Subversion commits are atomic. This means the whole repository is versioned. So there is only one version number for all files, called the revision. You see it when browsing the repository. You can use the -r switch to get an older revision
svn checkout -r 345 http://svn.server.org/path/to/file/trunk/
All files will be in a trunk subdirectory, if you checkout trunk.
More documentation about subversion can be found on Version Control with Subversion and on subversion site.
Subversion and RpmBuildUpdate
RpmBuildUpdate can be used to automatically retrieve svn snapshots. You need to follow some rules, however, as explained on RpmBuildUpdate.
Subversion for translators
Once you have your username and password to access svn, you should follow these steps:
First, define your username to avoid having to enter it each time:
export SVN_SSH="ssh -l username"
You can avoid having to define that each time, by adding the line to your ~/.bashrc
Next, chekout the relevant modules. You have to do this checkout only once for each module (later on, you can update the module already on your disk).
Currently most modules were migrated from cvs to svn. You can check them out like this:
mkdir ~/svn-mandriva
cd ~/svn-mandriva
export BASE_URL=svn+ssh://svn.mandriva.com/svn/
export URL=svn+ssh://svn.mandriva.com/svn/soft/
export DRAKX_URL=$URL/drakx/trunk/perl-install/
svn co $BASE_URL/theme/gfxboot/trunk/po bootloader
svn co $DRAKX_URL/install/share/po DrakX
svn co $DRAKX_URL/share/po libDrakX
svn co $DRAKX_URL/standalone/po libDrakX-standalone
svn co $URL/bootsplash/trunk/po bootsplash
svn co $URL/control-center/trunk/po control-center
svn co $URL/drak3d/trunk/po drak3d
svn co $URL/drakbackup/trunk/po drakbackup
svn co $URL/drakbt/trunk/po drakbt
svn co $URL/drakfax/trunk/po drakfax
svn co $URL/draklive-install/trunk/po draklive-install
svn co $URL/drakmenustyle/trunk/po drakmenustyle
svn co $URL/drakoo/trunk/po drakoo
svn co $URL/draktermserv/trunk/po draktermserv
svn co $URL/drakvirt/trunk/po drakvirt
svn co $URL/drakx-kbd-mouse-x11/trunk/po drakx-kbd-mouse-x11
svn co $URL/drakx-net/trunk/po network-tools
svn co $URL/ftw/trunk/po drakfirstboot
svn co $URL/initscripts/trunk/po initscripts
svn co $URL/mdkonline/trunk/po mdkonline
svn co $URL/printerdrake/trunk/po printerdrake
svn co $URL/rfbdrake/trunk/po rfbdrake
svn co $URL/rpm/urpmi/trunk/po urpmi
svn co $URL/rpmdrake/trunk/grpmi/po grpmi
svn co $URL/rpmdrake/trunk/po rpmdrake
svn co $URL/userdrake2/trunk/po userdrake2
The commands above will also create a directory in your home named svn-mandriva where the checked out modules will exist. You can use any other directory as you wish.
After each svn co command, you will need to enter your svn password (possibly several times).
To work on a specific module, you should edit the language file of your team, then check it in.
The following are common commands you are likely to run from the directory where the po file is:
To update your local copy to the latest version in Mandriva's svn:
svn update
To check which changes will be commited (one must do that, please avoid changing files that do not belong to your team!)
svn status
To commit changes:
svn commit --message "update translation for language"
Make sure the message has your own language listed in.
If you want to change your subversion password, please ssh to host kenobi, i.e.:
ssh kenobi.mandriva.com
yppasswd