How exactly does subversion store files in the repository?

我是研究僧i 提交于 2019-11-27 03:48:53

Because Subversion's repository format is entirely internal, they are free to change the representation from one revision to the next. I believe the current revision generally stores reverse deltas (your option 2), but also stores complete snapshots periodically so it doesn't have to resolve 1000 diffs before returning a result.

The Subversion 1.6 release notes has a section on Filesystem storage improvements that has some notes on this, and links to other sources. Suffice to say that the details of Subversion data storage are complex and subject to change.

There is also a design document in the Subversion source tree that describes the use of skip deltas in Subversion. Generally, the /notes/ directory contains several useful documents regarding Subversion internals.

I believe the following link would be of assistance to understand the fsfs architecture

http://svn.apache.org/repos/asf/subversion/trunk/subversion/libsvn_fs_fs/structure

From the Subversion Design document (which is quite dated, though) you can get this:

Like many other revision control systems, Subversion stores changes as differences. It doesn't make complete copies of nodes; instead, it stores the latest revision as a full text, and previous revisions as a succession of reverse diffs (the word "diff" is used loosely here – for files, it means vdeltas, for directories, it means a format that expresses changes to directories).

I don't think that was changed since.

Also, see Bubble-Up Method.

the regular FSFS specification might help you.

Or if you use Berkeley DB, here's the specification for that.

FSFS uses reverse deltas to store the changes and skip-deltas to speed up some actions, if I understood everything correctly.

Each time you commit a change, the repository stores a new revision of that overall repository tree, and labels the new tree with a new revision number. Of course, most of the tree is the same as the revision before, except for the parts you changed.

The new revision number is a sequential label that applies to the entire new tree, not just to the files and directories you touched in that revision. However, colloquially, a revision number is used to refer to the change committed in that revision; for example, "the change in r588" ("r588" is shorthand for "revision 588") really means "the difference between repository trees 587 and 588", or put another way, "the change made to tree 587 to produce tree 588".

Have a look at : Subversion FAQ

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!