P. 1
svn-book

svn-book

|Views: 23|Likes:
Published by Mohamad Efazati
svn book
svn book

More info:

Published by: Mohamad Efazati on Oct 17, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

09/08/2014

pdf

text

original

The difference here is that the Subversion filesystem has a nifty third dimension that most
filesystems do not have—Time! 1

In the filesystem interface, nearly every function that has
a path argument also expects a root argument. This svn_fs_root_t argument de-
scribes either a revision or a Subversion transaction (which is simply a revision in the mak-
ing) and provides that third dimension of context needed to understand the difference
between /foo/bar in revision 32, and the same path as it exists in revision 98. Figure 8.2,
“Versioning time—the third dimension!” shows revision history as an added dimension to
the Subversion filesystem universe.

Figure 8.2. Versioning time—the third dimension!

Embedding Subversion

208

As we mentioned earlier, the libsvn_fs API looks and feels like any other filesystem, ex-
cept that it has this wonderful versioning capability. It was designed to be usable by any
program interested in a versioning filesystem. Not coincidentally, Subversion itself is inter-
ested in that functionality. But while the filesystem API should be sufficient for basic file and
directory versioning support, Subversion wants more—and that is where libsvn_repos
comes in.

The Subversion repository library (libsvn_repos) sits (logically speaking) atop the
libsvn_fs API, providing additional functionality beyond that of the underlying versioned
filesystem logic. It does not completely wrap each and every filesystem function—only cer-
tain major steps in the general cycle of filesystem activity are wrapped by the repository in-
terface. Some of these include the creation and commit of Subversion transactions and the
modification of revision properties. These particular events are wrapped by the repository
layer because they have hooks associated with them. A repository hook system is not
strictly related to implementing a versioning filesystem, so it lives in the repository wrapper
library.

The hooks mechanism is but one of the reasons for the abstraction of a separate reposit-
ory library from the rest of the filesystem code. The libsvn_repos API provides several
other important utilities to Subversion. These include the abilities to:

• Create, open, destroy, and perform recovery steps on a Subversion repository and the
filesystem included in that repository.

• Describe the differences between two filesystem trees.

• Query for the commit log messages associated with all (or some) of the revisions in
which a set of files was modified in the filesystem.

• Generate a human-readable “dump” of the filesystem—a complete representation of the
revisions in the filesystem.

• Parse that dump format, loading the dumped revisions into a different Subversion repos-

itory.

As Subversion continues to evolve, the repository library will grow with the filesystem lib-
rary to offer increased functionality and configurable option support.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->