5

I'd like to understand how subversion stores revisions in FSFS, and how a view/shapshot is constructed for a given revision number.

What I have gleaned from Googling is that FSFS is a simple directory structure, with sub-directories for each revision like:

..svn/rev/0/
..svn/rev/1/
..svn/rev/2/

Presumably only the changes (deltas) are recorded under each revision directory. So does this mean that when constructing the view/snapshot for revision N, all the deltas from 0 to N have to be looped over?

Any links to resources on this much appreciated.

Thanks

bahrep
  • 29,961
  • 12
  • 103
  • 150
Richard H
  • 38,037
  • 37
  • 111
  • 138

2 Answers2

6

Subversion stores all deltas of each revision in one single (flat) revision file. Each file/folder inside the repository (called a "node") has an internal ID.

A single revision file consists of all compressed deltas for this particular commit, however the deltas are not against the previous revision, but use a scheme called "skipped deltas" avoiding linear growing search time for growing version history.

Important is that FSFS uses forward deltas instead of backward deltas using the BDB-backend. So FSFS is faster on commits, but slower on checkout, Berkeley DB's performance characteristic is other way around.

You can read a lot more inside SVN design note about FSFS.

Nayuki
  • 17,911
  • 6
  • 53
  • 80
Peter Parker
  • 29,093
  • 5
  • 52
  • 80
3

Here is a link to the FSFS structure reference (including file format description): https://svn.apache.org/repos/asf/subversion/trunk/subversion/libsvn_fs_fs/structure

Nayuki
  • 17,911
  • 6
  • 53
  • 80
Pavel Horal
  • 17,782
  • 3
  • 65
  • 89