Einführung Versionkontrolle ist die Kunst Änderungen zu Verwalten. Es war lange Zeit ein kritisches Werkzeug für Programmierer die üblicherweise ihre Zeit damit verbrachten kleine Änderungen an Software vorzunehmen und diese am nächsten Tag wieder rückgängig zu machen. Aber die Nützlichkeit von Versionkontrollsoftware liegt weit außerhalb der Grenzen der Softwareentwicklungswelt. Überall wo Menschen Computer Verwenden, um Daten zu Verwalten ändern sich diese häufig/ständig. Und das ist der Punkt wo Subversion ins Spiel kommt. Version control is the art of managing changes to information. It has long been a critical tool for programmers, who typically spend their time making small changes to software and then undoing those changes the next day. But the usefulness of version control software extends far beyond the bounds of the software development world. Anywhere you can find people using computers to manage information that changes often, there is room for version control. And that's where Subversion comes into play. Das Kapitel enthält eine Einführung in Subversion auf hoher Ebene. Was es ist? Was es tut? Wie man es bekommt? This chapter contains a high-level introduction to Subversion—what it is; what it does; how to get it. Was ist Subversion? What is Subversion? Subversion ist ein freies/Open-Soucrce Versionskontroll System. Subversion verwaltet Dateien und Verzeichnisse über die Zeit hinweg. Ein Baum der Dateien wird in ein Zentrales repository abgelegt. Das Repository ist wie ein gewöhlicher File Server, aussser das der sich an jede jemals gemachte Änderung erinnert. Das erlaubt es Ihnen jede ältere Version Ihrer Daten wieder her zustellen, oder die Geschichte der Änderungen zu untersuchen. In dieser Hinsicht, stellen sich viele Leute ein Versionskontrollsystem als eine Art von Zeitmaschine vor. Subversion is a free/open-source version control system. That is, Subversion manages files and directories over time. A tree of files is placed into a central repository. The repository is much like an ordinary file server, except that it remembers every change ever made to your files and directories. This allows you to recover older versions of your data, or examine the history of how your data changed. In this regard, many people think of a version control system as a sort of time machine. Subversions erlaubt den Zugriff auf sein Repository durch ein Netzwerk, womit der Zugriff von Leuten auf unterschiedlichen Rechnern ermöglicht wird. ...At some Level die Möglichkeit verschiedener Leute Datensätze an unterschiedlichen Orten zu Verwalten und zu modifizieren fördert die Zusammenarbeit. Fortschritt kann früher eintreten als ohne eine Kanaliserung durch die alle Änderung laufen müssen. Und Aufgrund der Tatsache, dass die Arbeit Versioniert wird brauchen Sie nicht zu befürchten, dass die Qualität der Ausgleich für den Verlust der Kanalisierung ist wenn eine Fehlerhafte Änderung an den Daten durchgeführt wurde. Es kann einfach rückgängig gemacht werden. Subversion can access its repository across networks, which allows it to be used by people on different computers. At some level, the ability for various people to modify and manage the same set of data from their respective locations fosters collaboration. Progress can occur more quickly without a single conduit through which all modifications must occur. And because the work is versioned, you need not fear that quality is the trade-off for losing that conduit—if some incorrect change is made to the data, just undo that change. Einige Versionskontrollesystem sind auch Software Konfigurations Management Systems (SKM). Diese Systeme sind speziell darauf zugeschnitten, Quellcodebäume zu verwalten. Sie haben sehr viele Funktionalitäten, die auf die Software Entwicklung ausgerichtet sind. z.B. die Angebore Fähigkeit Programmiersprachen zu verstehen oder liefern Spezielle Werkzeuge zum Erzeugen (build) von Software. Subververion, aber ist keines von diesen Systemen. Es ist ein allgemeines System welches zur Verwaltung jeder Art von Dateien verwendet werden kann. Für Sie diese Dateien können Quellcode sein, während es für andere eine Einkaufsliste im Supermarkt ist bis zur Video Liste und darüber hinaus. Some version control systems are also software configuration management (SCM) systems. These systems are specifically tailored to manage trees of source code, and have many features that are specific to software development—such as natively understanding programming languages, or supplying tools for building software. Subversion, however, is not one of these systems. It is a general system that can be used to manage any collection of files. For you, those files might be source code—for others, anything from grocery shopping lists to digital video mixdowns and beyond. Subversion's History Die Geschichte von Subversion Anfang 2000, CollabNet, Inc. (http://www.collab.net) suchte Entwickler to eine Ersatz für CVS erstellen sollten. CollabNet bot eine Collaboration Software Suite genannt SourceCast an, von deren eine Komponente Versionskontrolle ist. Obwohl SourceCast CVS als initiale Versionskontrolle verwendete, die Grenzen von CVS waren von Anfang an offensichtlich, wusste CollabNet dass es etwas besseres finden mußte. Bedauerlicherweise war CVS ein de facto Standard in der Welt der Open Source weil es nichts besseres gab, wenigstens nicht unter einer freien Lizenz. Somit entschied sich CollabNet ein neues Versionskontrollsystem von Grund auf neu zu entwickeln, aber unter zurückhaltender Übernahme der Grundideen von CVS, aber ohne deren Fehler und Misständen. In early 2000, CollabNet, Inc. (http://www.collab.net) began seeking developers to write a replacement for CVS. CollabNet offers a collaboration software suite called SourceCast, of which one component is version control. Although SourceCast used CVS as its initial version control system, CVS's limitations were obvious from the beginning, and CollabNet knew it would eventually have to find something better. Unfortunately, CVS had become the de facto standard in the open source world largely because there wasn't anything better, at least not under a free license. So CollabNet determined to write a new version control system from scratch, retaining the basic ideas of CVS, but without the bugs and misfeatures. Im Frebruar 2000, nahmen Sie kontakt zu Karl Fogel, dem Autor von Open Source Development with CVS (Coriolis, 1999) und fragten Ihn ob er an diesem neuen Projekt arbeiten wollte. Zu dieser Zeit war Karl Fogel zufälligerweise in Kontakt mit seinem Freund Jim Blandy und diskutierte ein neues Design eines neuen Versionskontrollsystems. 1995 hatten die beiden Cyclic Software gegründet welches Support Verträge für CVS bot, welche Sie später verkauften, wärend die Verwendung von CVS in der täglichen Arbeit weiter geführt wurde. Die Frustration mit CVS gab Jim den Anstoss genau über das Konzept der Versionierten Daten In February 2000, they contacted Karl Fogel, the author of Open Source Development with CVS (Coriolis, 1999), and asked if he'd like to work on this new project. Coincidentally, at the time Karl was already discussing a design for a new version control system with his friend Jim Blandy. In 1995, the two had started Cyclic Software, a company providing CVS support contracts, and although they later sold the business, they still used CVS every day at their jobs. Their frustration with CVS had led Jim to think carefully about better ways to manage versioned data, and he'd already come up with not only the name Subversion, but also with the basic design of the Subversion repository. When CollabNet called, Karl immediately agreed to work on the project, and Jim got his employer, RedHat Software, to essentially donate him to the project for an indefinite period of time. CollabNet hired Karl and Ben Collins-Sussman, and detailed design work began in May. With the help of some well-placed prods from Brian Behlendorf and Jason Robbins of CollabNet, and Greg Stein (at the time an independent developer active in the WebDAV/DeltaV specification process), Subversion quickly attracted a community of active developers. It turned out that many people had had the same frustrating experiences with CVS, and welcomed the chance to finally do something about it. The original design team settled on some simple goals. They didn't want to break new ground in version control methodology, they just wanted to fix CVS. They decided that Subversion would match CVS's features, and preserve the same development model, but not duplicate CVS's most obvious flaws. And although it did not need to be a drop-in replacement for CVS, it should be similar enough that any CVS user could make the switch with little effort. After fourteen months of coding, Subversion became self-hosting on August 31, 2001. That is, Subversion developers stopped using CVS to manage Subversion's own source code, and started using Subversion instead. While CollabNet started the project, and still funds a large chunk of the work (it pays the salaries of a few full-time Subversion developers), Subversion is run like most open-source projects, governed by a loose, transparent set of rules that encourage meritocracy. CollabNet's copyright license is fully compliant with the Debian Free Software Guidelines. In other words, anyone is free to download, modify, and redistribute Subversion as he pleases; no permission from CollabNet or anyone else is required. Subversion's Features When discussing the features that Subversion brings to the version control table, it is often helpful to speak of them in terms of how they improve upon CVS's design. If you're not familiar with CVS, you may not understand all of these features. And if you're not familiar with version control at all, your eyes may glaze over unless you first read , in which we provide a gentle introduction to version control in general. Subversion provides: Directory versioning CVS only tracks the history of individual files, but Subversion implements a virtual versioned filesystem that tracks changes to whole directory trees over time. Files and directories are versioned. True version history Since CVS is limited to file versioning, operations such as copies and renames—which might happen to files, but which are really changes to the contents of some containing directory—aren't supported in CVS. Additionally, in CVS you cannot replace a versioned file with some new thing of the same name without the new item inheriting the history of the old—perhaps completely unrelated— file. With Subversion, you can add, delete, copy, and rename both files and directories. And every newly added file begins a with a fresh, clean history all its own. Atomic commits A collection of modifications either goes into the repository completely, or not at all. This allows developers to construct and commit changes as logical chunks, and prevents problems that can occur when only a portion of a set of changes is successfully sent to the repository. Versioned metadata Each file and directory has a set of properties—keys and their values— associated with it. You can create and store any arbitrary key/value pairs you wish. Properties are versioned over time, just like file contents. Choice of network layers Subversion has an abstracted notion of repository access, making it easy for people to implement new network mechanisms. Subversion can plug into the Apache HTTP Server as an extension module. This gives Subversion a big advantage in stability and interoperability, and instant access to existing features provided by that server—authentication, authorization, wire compression, and so on. A more lightweight, standalone Subversion server process is also available. This server speaks a custom protocol which can be easily tunneled over SSH. Consistent data handling Subversion expresses file differences using a binary differencing algorithm, which works identically on both text (human-readable) and binary (human-unreadable) files. Both types of files are stored equally compressed in the repository, and differences are transmitted in both directions across the network. Efficient branching and tagging The cost of branching and tagging need not be proportional to the project size. Subversion creates branches and tags by simply copying the project, using a mechanism similar to a hard-link. Thus these operations take only a very small, constant amount of time. Hackability Subversion has no historical baggage; it is implemented as a collection of shared C libraries with well-defined APIs. This makes Subversion extremely maintainable and usable by other applications and languages. Subversion's Architecture Figure 1.1 illustrates what one might call a mile-high view of Subversion's design.
Subversion's Architecture
On one end is a Subversion repository that holds all of your versioned data. On the other end is your Subversion client program, which manages local reflections of portions of that versioned data (called working copies). Between these extremes are multiple routes through various Repository Access (RA) layers. Some of these routes go across computer networks and through network servers which then access the repository. Others bypass the network altogether and access the repository directly.
Installing Subversion Subversion is built on a portability layer called APR (the Apache Portable Runtime library). This means Subversion should work on any operating system that the Apache httpd server runs on: Windows, Linux, all flavors of BSD, Mac OS X, Netware, and others. The easiest way to get Subversion is to download a binary package built for your operating system. Subversion's website (http://subversion.tigris.org) often has these packages available for download, posted by volunteers. The site usually contains graphical installer packages for users of Microsoft operating systems. If you run a Unix-like operating system, you can use your system's native package distribution system (RPMs, DEBs, the ports tree, etc.) to get Subversion. Alternately, you can build Subversion directly from source code. From the Subversion website, download the latest source-code release. After unpacking it, follow the instructions in the INSTALL file to build it. Note that a released source package contains everything you need to build a command-line client capable of talking to a remote repository (in particular, the apr, apr-util, and neon libraries). But optional portions of Subversion have many other dependencies, such as Berkeley DB and possibly Apache httpd. If you want to do a complete build, make sure you have all of the packages documented in the INSTALL file. If you plan to work on Subversion itself, you can use your client program to grab the latest, bleeding-edge source code. This is documented in . Subversion's Components Subversion, once installed, has a number of different pieces. The following is a quick overview of what you get. Don't be alarmed if the brief descriptions leave you scratching your head—there are plenty more pages in this book devoted to alleviating that confusion. svn The command-line client program. svnversion A program for reporting the state (in terms of revisions of the items present) of a working copy. svnlook A tool for inspecting a Subversion repository. svnadmin A tool for creating, tweaking or repairing a Subversion repository. svndumpfilter A program for filtering Subversion repository dumpfile format streams. mod_dav_svn A plug-in module for the Apache HTTP Server, used to make your repository available to others over a network. svnserve A custom standalone server program, runnable as a daemon process or invokable by SSH; another way to make your repository available to others over a network. Assuming you have Subversion installed correctly, you should be ready to start. The next two chapters will walk you through the use of svn, Subversion's command-line client program.