Il repository

Subversion is a centralized system for sharing information. At its core is a repository, which is a central store of data. The repository stores information in the form of a filesystem tree—a typical hierarchy of files and directories. Any number of clients connect to the repository, and then read or write to these files. By writing data, a client makes the information available to others; by reading data, the client receives information from others. Figura 2.1, «Un tipico sistema client/server» illustrates this.

Subversion è un sistema centralizzato per la condivisione delle informazioni. Al suo centro c'è il repository, che è l'archivio principale di dati. Il repository memorizza informazioni nella forma di un filesystem ad albero— la tipica gerarchia di file e directory. Un numero arbitrario di client può connettersi al repository e leggere o scrivere questi file. Scrivendo i dati, un client rende le informazioni disponibili agli altri; leggendo i dati, il client riceve le informazioni dagli altri. Figura 2.1, «Un tipico sistema client/server» illustra il meccanismo.

Figura 2.1. Un tipico sistema client/server

Un tipico sistema client/server

So why is this interesting? So far, this sounds like the definition of a typical file server. And indeed, the repository is a kind of file server, but it's not your usual breed. What makes the Subversion repository special is that it remembers every change ever written to it: every change to every file, and even changes to the directory tree itself, such as the addition, deletion, and rearrangement of files and directories.

Perché quindi questo aspetto dovrebbe sembrare interessante? Inizialmente potrebbe sembrare la tipica definizione di un file server. In effetti il repository è una sorta di file server, ma non nell'accezione comune. Quello che rende Subversion un repository speciale è che ricorda qualsiasi cambiamento scritto in esso: ogni cambiamento ad ogni file, e perfino modifiche allo stesso albero delle directory, come l'aggiunta, la cancellazione ed il riarrangiamento di file e directory.

When a client reads data from the repository, it normally sees only the latest version of the filesystem tree. But the client also has the ability to view previous states of the filesystem. For example, a client can ask historical questions like, What did this directory contain last Wednesday? or Who was the last person to change this file, and what changes did he make? These are the sorts of questions that are at the heart of any version control system: systems that are designed to record and track changes to data over time.

Quando un client legge i dati dal repository, normalmente vede solo l'ultima versione dell'albero del filesystem. Il client in realtà ha anche la possibilità di vedere uno stato precedente del filesystem. Ad esempio, un client può chiedere domande storiche come «Cosa conteneva questa directory l'ultimo Mercoledì?» oppure «Chi è stata l'ultima persona a cambiare questo file, e che modifiche ha apportato?». Queste sono le tipologie di domande che sono alla base di qualsiasi sistema di controllo di versione: sistemi che sono progettati per registrare e tenere traccia delle modifiche ai dati nel tempo.