Subversion für KDE benutzen
Dies ist eine kurze KDE-spezifische Einführung in Subversion.
Für weitere Details zu Subversion lesen Sie bitte das Buch "Version Control with Subversion" (englischsprachige Online-Ausgabe). Eine gedruckte Fassung des Buches in deutscher Sprache erhalten Sie unter dem Titel "Versionskontrolle mit Subversion" im O'Reilly-Verlag.
Inhalt
- Der Anfang
- Die Struktur des KDE-Repositories
- In das KDE-Repository einloggen
- Dateien auschecken (checkout) und aktualisieren (update)
- Den Status einer Datei ermitteln
- Änderungen in das Repository einspielen (commit)
- Dateien ignorieren
- Das Arbeiten mit Mehrfach-Revisionen und -Zweigen
- Anmerkungen von und zu kde.de
Der Anfang
Um das Subversion-Repository von KDE nutzen zu können brauchen Sie zwei Dinge:
- Ein Clientprogramm für Subversion
- Einen Account in unserem Repository
Subversion installieren:
Instruktionen für die Installation des Clients gibt es hier nicht. Folgen Sie den Installationsanweisungen Ihres Systems um Subversion zu installieren. Sie brauchen Version 1.1. oder höher. Wenn Sie selbst die Quelltexte kompilieren, denken Sie daran, dass das KDE-Repository SSL-Unterstützung benötigt und Sie somit die Option --with-ssl verwenden müssen.
Alternativ können Sie auch einen der vielen grafischen Subversion-Clients verwenden. Diese Anleitung ist für Leute gedacht, die nur das svn-Programm nutzen und zeigt Ihnen, wie Sie die bisherigen Befehle von CVS in Subversion umsetzen.
Einen Account bekommen:
Wenn Sie bereits einen CVS-Account besaßen, so wurde dieser im KDE-Subversion-Repository übernommen. Falls Sie bisher noch keinen CVS-Account hatten, informieren Sie sich bitte im Developer HOWTO weiter über die Einrichtung eines KDE-SVN-Accounts.
Anmerkung: Haben Sie Ihr Passwort verloren? Dann gibt es einfache Wege, es wieder zu erhalten. Nutzen Sie dazu eines der Werkzeuge cvspwd.c oder cvs-unscramble (Perl).
Die Struktur des KDE Repositories
svn.kde.org/home/kde
Dies ist die Adresse von KDE's Subversion Repository. Das Repository ist erreichbar via HTTPS oder SVN+SSH-Protokoll. Da bedeutet, Ihr Passwort ist sicher gegenüber Dritten.
Der MD5-Fingerabdruck (fingerprint) des Repository SSL-Zertifikates:
F6BF EDE2 D016 D1B2 4F18 742E 2C8F B7EF
Der SHA1-Fingerabdruck (fingerprint) des Repository SSL-Zertifikates:
e1:e6:41:96:3c:eb:ae:78:e2:73:0d:a2:32:2f:6b:21:13:bf:3d:0f
Das Repository ist in drei Hauptverzeichnisse unterteilt:
- /branches
- /tags
- /trunk
Sie können die Repository-Struktur unter http://websvn.kde.org/ betrachten.
Das oberste Verzeichnis /trunk
The /trunk top-level subdirectory is where the main development for KDE occurs. What you will find here is what will become the next KDE release, and of its associated programs. You will also find here the www module, which contains webpages for KDE's site and related ones.
/trunk is further subdivided into these sub-directories:
- KDE/
- KDE itself, what will become the next public release. It contains the following modules:
- arts - Soundserver
- kde-common - Common admin/ directory
- kde-i18n - Translations
- kdelibs - KDE basic libraries, used by all KDE programs
- kdebase - KDE base programs, like the KDE Control Center, Kicker (the panel) and Konqueror (the web browser)
- kdeaccessibility - Accessibility files
- kdeaddons - Add-ons and plug-ins to KDE programs
- kdeadmin - KDE Administration applications
- kdeartwork - Images, themes, sounds and other art files
- kdebindings - Bindings for languages other than C++
- kdeedu - KDE Educational applications
- kdegames - KDE Games
- kdegraphics - KDE Graphical applications
- kdemultimedia - KDE Multimedia applications
- kdenetwork - KDE Networking applications
- kdepim - KDE Personal Information Management applications
- kdesdk - KDE Software Development Kit applications
- kdetoys - KDE toy applications
- kdevelop - The KDevelop program
- kdeutils - KDE General utilities
- kdewebdev - KDE Web development applications
- bugs/
- Bugzilla files
- techbase.kde.org
- The content of techbase.kde.org (formerly developer.kde.org)
- extragear/
- KDE programs outside the main KDE releases.
- kdereview/
- Temporary home for KDE applications that are believed to have reached release-quality. From here, once all major issues are resolved, applications are moved either to /trunk/KDE/ or to /trunk/extragear/
- kdesupport/
- Supporting applications and libraries for KDE
- koffice/
- The KDE Office suite, containing the programs:
- karbon
- kchart
- kdatabase
- kexi
- kformula
- kivio
- kontour
- kplato
- kpresenter
- krita
- kspread
- kugar
- kword
- konstruct/
- Konstruct, the KDE build program
- playground/
- The KDE playground: applications being developed, but not having yet reached release-quality.
- qt-copy/
- The convenience copy of Trolltech's Qt library, which KDE is based upon.
- tests/
- khtml, KOffice and ksvg testcases
- valgrind/
- The Valgrind application, which is hosted on the KDE repository, but that is not part of KDE itself.
- www/
- Webpages for the KDE site (and related sites). Write access to this directory is restricted.
Das oberste Verzeichnis /tags/
Dieses Verzeichnis enthält offizielle Veröffentlichungen von Programmen die im KDE-Repository entwickelt und betreut werden. Jede einzelne Anwendung hat ein eigenes Unterverzeichnis. Darin finden Sie die Versionsnummern.
Beispiel: Der Code zu 3.5.7 liegt unter: /tags/KDE/3.5.7/.
Das oberste Verzeichnis /branches/
This directory contains the branch versions of the applications after a major release.
Most KDE applications adhere to the philosphy that new features (as well as new user-visible strings) are added only to the next release cycle ? the one that lives in /trunk/. However, bugfixes are applied to all applications, even after release.
In order to do that, a branch is created at the moment of the release, indicating the state of the files at that time. Bugfixes are then checked in to those files. Those branches are the ones in /branches/.
For instance, the KDE 3.4.x branch can be found under /branches/KDE/3.4/ .
.The subdirectories you will find inside /branches are the application subdirs, like akregator/, amarok/, arts/, k3b/, etc. You will also find a KDE/ subdir, containing the official KDE releases since time immemorial.
One special subdir is found in /branches: work/. This subdir contains the so-called "work branches", that is, branches containing features being worked on, sometimes highly experimental. Multi-application work branches always are checked in to /branches/work/, but single-application branches may be found in each application's subdir. That is a decision left to the developers.
In das KDE-Repository einloggen
Der Vorgang cvs login ist nicht mehr notwendig.
Dieser Vorgang wird nun beim auschecken automatisch ausgeführt wenn Sie per URL auf das Subversion-Repository zugreifen.
Dateien auschecken (checkout) und aktualisieren (update)
Auschecken
Um etwas mit Subversion auszuchecken, nutzen Sie das Unterkommando checkout.
Warnung: Wenn Sie trunk/KDE/ oder branches/KDE/foo/ auschecken laden Sie sich das komplette KDE-Archiv herunter!
Angenommen Sie möchten nur KDevelop aus dem KDE-Repository auschecken. Dann würden Sie folgendes tun:
CVS-Kommando:
cvs -d :pserver:yourname@cvs.kde.org:/home/kde login cvs -d :pserver:yourname@cvs.kde.org:/home/kde checkout kdevelop
Subversion-Kommando:
CVS-Nutzer die bisher per ssh zugegriffen haben, sollten nun svn+ssh nutzen, CVS-Nutzer die bisher per Passwort zugegriffen haben, sollten das https-Protokoll wie folgt benutzen.
svn checkout <protocol>://<username>@svn.kde.org/home/kde/trunk/KDE/kdevelop
Anmerkung: Für anonymen, nur lesenden Zugriff nutzen Sie bitte als Protokoll "svn", lassen den Teil "username@" weg und verwenden als Server "anonsvn.kde.org".
Aktualisieren (update)
Um zu aktualisieren nutzen Sie bitte das Unterkommando update.
Dies unterscheidet sich nicht von CVS. Sie können in die ausgecheckte Kopie wechseln und mit svn update ein Update machen (oder kürzer: svn up).
Den Status einer Datei ermitteln
Um zu erfahren, welche lokalen Dateien Sie verändert haben, benutzten die meisten Leute unter CVS
cvs up
und schauten nach Dateien mit M. Dies funktioniert mit svn nicht und Sie müssen stattdessen
svn status
eingeben um den Status zu erfahren.
Änderungen in das Repository einspielen (commit)
Genau wie bei CVS werden "Commits" in das Subversion-Repository mit den Unterkommandos commit oder checkin (Kurzform ci) eingeleitet.
CVS-Koommando:
cvs commit ODER cvs ci ODER cvs ci filename.cpp
Subversion-Kommando:
svn commit ODER svn ci ODER svn ci filename.cpp
Auf diesem Weg startet svn den in $SVN_EDITOR angegebenen Editor für Sie um die Nachricht für den Commit zu verfassen. Sie können auch svn mit der Option -m die komplette Nachricht mit übergeben:
svn ci -m "Update of german news"
Dateien ignorieren
Subversion speichert die ignorierten Dateien pro Verzeichnis. Um die Liste der ignorierten Dateien im aktuellen Verzeichnis zu bearbeiten geben Sie folgendes ein:
svn propedit svn:ignore .
Dies startet den Editor. Schreiben Sie die Namen der zu ignorierenden Dateien. Eine Datei pro Zeile. Sind Sie fertig? Dann machen Sie einen Commit um die Liste mit ignorierten Dateien auf dem Server zu aktualisieren.
Eine Reihe von Dateien wurden bei CVS mit Hilfe einer globalen Liste ignoriert. Dies wird noch nicht von SVN unterstützt. Sie können auf SVN 1.3 warten oder Sie fügen eine Liste zur (gemischten) Gruppe in Ihrer ~/.subversion/config hinzu. Alles in einer Zeile:
global-ignores = *.o *.lo *.la .*.rej *.rej .*~ *~ .#* #*# .DS_Store *.moc *.moc.cc *.moc.cpp config.log config.status config.cache *.gmo .deps .libs SunWS_cache *.lo *.la *.rpo *.la.closure *_la_closure.cpp *_la_closure.cc *_la_closure.cxx *.all_cc.cc *.all_cpp.cpp *.all_C.C *.all_cxx.cxx *_meta_unload.cc *_meta_unload.h *_meta_unload.cpp *_meta_unload.C *_meta_unload.cxx index.cache.bz2 .memdump Makefile.rules.in Makefile.calls.in Makefile.rules Makefile.calls autom4te.cache *.kidl
Das Arbeiten mit Mehrfach-Revisionen und -Zweigen
Unlike CVS, Subversion doesn't generate a revision number for each file modified. Instead, the full repository is versioned, as a whole. This way, a given revision number represents the state the repository was on a given date. In other words, a revision number is like a timestamp (in fact, the Subversion server uses this fact to search for dates in the repository faster).
So, for instance, when you check out the KDE repository, Subversion will tell you the following:
Updated to revision 403821.
This means that the latest revision available at the time of the operation was 403821. If you make a modification and commit, Subversion will update the server-side revision and will inform you of it. Like CVS, only the committed files will be updated: you will need run cvs up to update the rest of the files.
If you want to retrieve a specific revision of a file, you can use the -r switch. Besides the revision number itself, -r accepts a number of other possibilities:
- The revision number: for example, use -r 403819 to retrieve that version
- BASE: the revision you updated to
- COMMITTED: the revision a file was last modified, before BASE
- PREV: the revision of the previous commit to the file before COMMITTED
- HEAD: the most recent revision available in the server
- { date }: between curly brackets, you can specify a date for searching the closest revisions
The following illustrates the evolution of the keywords:
- You run svn up to update to the latest available revision. Suppose Subversion tells you it updated to revision 403821. This means that HEAD and BASE are 403821.
- You modify file README and commit it. Suppose Subversion tells you it committed revision 403822. This means HEAD, BASE and COMMITTED are 403822.
- You modify the file again and commit it. Now PREV is 403822, but HEAD, BASE and COMMITTED are updated to a new value (suppose it's 403823).
- Now someone else modifies the repository, and you update your working copy. If Subversion tells you it updated to 403824, this means now HEAD and BASE are moved to 403824 (but PREV and COMMITTED stay the same)
- If someone modifies the README file now, HEAD is moved. The other keywords stay the same for you, until you update. At this time, we will have HEAD = 403825 (the latest available revision), BASE = 403824 (the revision you last updated to), COMMITTED = 403823 (the revision of the latest change to the file when you last updated) and PREV = 403822 (the revision of the change before COMMITTED)
Those keywords are useful to retrieve logs and diffs for commits to the repository.
If you want to see the difference between your working copy and BASE, you can run:
svn diff
This is a very fast operation, since Subversion keeps a local copy of BASE. It doesn't need a network connection to accomplish this operation.
If you want to see the difference between your local copy and the latest available on the server, you will run:
svn diff -r HEAD
If you want to see what has changed in the repository since you've last updated, you can use:
svn diff -r BASE:HEAD
If you want to see the last change to a file before BASE, you can use:
svn diff -r PREV:BASE OR svn diff -r PREV:COMMITTED
That is also valid for the svn log command.
Anmerkungen von und zu kde.de
Unser Verzeichnis auf dem Server ist:
/home/kde/trunk/www/international/germany
Kontrollieren Sie die SSL-Unterstützung Ihres Subversion-Clients:
svn --version.
Im Ergebnis sollten folgende Zeilen auftauchen:
ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol. - behandelt 'http' Schema - behandelt 'https' Schema
Um nun das Repository von kde.de zu holen, erstellen Sie ein Verzeichnis auf Ihrem PC. Öffnen Sie eine Konsole und wechseln in das Verzeichnis.
Folgender Befehl holt die Dateien (checkout):
svn checkout https://svn.kde.org/home/kde/trunk/www/international/germany
Hierbei werden Sie nach Ihrem Benutzernamen und Passwort gefragt.
Bei Erscheinen der folgenden Fehlermeldung sollten Sie Ihre SVN Version auf SSL-Unterstützung prüfen:
svn: Unbekanntes URL Schema
Weiterführende Links
- Homepage von Subversion - http://subversion.tigris.org/
- Webinterface für KDEs SVN - http://websvn.kde.org/
- kdesvn - http://kde-apps.org/content/show.php?content=26589
- Subversion-Buch:
- Online-Ausgabe (englischsprachig)
- gedruckte Ausgabe (deutschsprachig)
- SVN Howto im KDE-Wiki - http://wiki.kde.org
[ Notice: Undefined index: Edit in /srv/www/svn/www/media/includes/functions.inc on line 231 Edit ]
KDE für deutschsprachige Benutzer