Subversion 1.6.16
Data Structures | Defines | Typedefs | Enumerations | Functions

Dumping and loading filesystem data

The filesystem 'dump' format contains nothing but the abstract structure of the filesystem -- independent of any internal node-id schema or database back-end. More...

Data Structures

struct  svn_repos_parse_fns2_t
 A vtable that is driven by svn_repos_parse_dumpstream2(). More...
struct  svn_repos_parse_fns_t
 A vtable that is driven by svn_repos_parse_dumpstream(). More...

Defines

#define SVN_REPOS_DUMPFILE_MAGIC_HEADER   "SVN-fs-dump-format-version"
#define SVN_REPOS_DUMPFILE_FORMAT_VERSION   3
#define SVN_REPOS_DUMPFILE_UUID   "UUID"
#define SVN_REPOS_DUMPFILE_CONTENT_LENGTH   "Content-length"
#define SVN_REPOS_DUMPFILE_REVISION_NUMBER   "Revision-number"
#define SVN_REPOS_DUMPFILE_NODE_PATH   "Node-path"
#define SVN_REPOS_DUMPFILE_NODE_KIND   "Node-kind"
#define SVN_REPOS_DUMPFILE_NODE_ACTION   "Node-action"
#define SVN_REPOS_DUMPFILE_NODE_COPYFROM_PATH   "Node-copyfrom-path"
#define SVN_REPOS_DUMPFILE_NODE_COPYFROM_REV   "Node-copyfrom-rev"
#define SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_MD5   "Text-copy-source-md5"
#define SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_SHA1   "Text-copy-source-sha1"
#define SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_CHECKSUM   SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_MD5
#define SVN_REPOS_DUMPFILE_TEXT_CONTENT_MD5   "Text-content-md5"
#define SVN_REPOS_DUMPFILE_TEXT_CONTENT_SHA1   "Text-content-sha1"
#define SVN_REPOS_DUMPFILE_TEXT_CONTENT_CHECKSUM   SVN_REPOS_DUMPFILE_TEXT_CONTENT_MD5
#define SVN_REPOS_DUMPFILE_PROP_CONTENT_LENGTH   "Prop-content-length"
#define SVN_REPOS_DUMPFILE_TEXT_CONTENT_LENGTH   "Text-content-length"
#define SVN_REPOS_DUMPFILE_PROP_DELTA   "Prop-delta"
#define SVN_REPOS_DUMPFILE_TEXT_DELTA   "Text-delta"
#define SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_MD5   "Text-delta-base-md5"
#define SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_SHA1   "Text-delta-base-sha1"
#define SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_CHECKSUM   SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_MD5

Typedefs

typedef struct
svn_repos_parse_fns2_t 
svn_repos_parse_fns2_t
 A vtable that is driven by svn_repos_parse_dumpstream2().
typedef svn_repos_parse_fns2_t svn_repos_parser_fns2_t
typedef struct
svn_repos_parse_fns_t 
svn_repos_parser_fns_t
 A vtable that is driven by svn_repos_parse_dumpstream().

Enumerations

enum  svn_node_action {
  svn_node_action_change,
  svn_node_action_add,
  svn_node_action_delete,
  svn_node_action_replace
}
 

The different "actions" attached to nodes in the dumpfile.

More...
enum  svn_repos_load_uuid {
  svn_repos_load_uuid_default,
  svn_repos_load_uuid_ignore,
  svn_repos_load_uuid_force
}
 

The different policies for processing the UUID in the dumpfile.

More...

Functions

svn_error_tsvn_repos_verify_fs (svn_repos_t *repos, svn_stream_t *feedback_stream, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
 Verify the contents of the file system in repos.
svn_error_tsvn_repos_dump_fs2 (svn_repos_t *repos, svn_stream_t *dumpstream, svn_stream_t *feedback_stream, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_boolean_t incremental, svn_boolean_t use_deltas, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
 Dump the contents of the filesystem within already-open repos into writable dumpstream.
svn_error_tsvn_repos_dump_fs (svn_repos_t *repos, svn_stream_t *dumpstream, svn_stream_t *feedback_stream, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_boolean_t incremental, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
 Similar to svn_repos_dump_fs2(), but with the use_deltas parameter always set to FALSE.
svn_error_tsvn_repos_load_fs2 (svn_repos_t *repos, svn_stream_t *dumpstream, svn_stream_t *feedback_stream, enum svn_repos_load_uuid uuid_action, const char *parent_dir, svn_boolean_t use_pre_commit_hook, svn_boolean_t use_post_commit_hook, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
 Read and parse dumpfile-formatted dumpstream, reconstructing filesystem revisions in already-open repos, handling uuids in accordance with uuid_action.
svn_error_tsvn_repos_load_fs (svn_repos_t *repos, svn_stream_t *dumpstream, svn_stream_t *feedback_stream, enum svn_repos_load_uuid uuid_action, const char *parent_dir, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
 Similar to svn_repos_load_fs2(), but with use_pre_commit_hook and use_post_commit_hook always FALSE.
svn_error_tsvn_repos_parse_dumpstream2 (svn_stream_t *stream, const svn_repos_parse_fns2_t *parse_fns, void *parse_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
 Read and parse dumpfile-formatted stream, calling callbacks in parse_fns/parse_baton, and using pool for allocations.
svn_error_tsvn_repos_get_fs_build_parser2 (const svn_repos_parse_fns2_t **parser, void **parse_baton, svn_repos_t *repos, svn_boolean_t use_history, enum svn_repos_load_uuid uuid_action, svn_stream_t *outstream, const char *parent_dir, apr_pool_t *pool)
 Set *parser and *parse_baton to a vtable parser which commits new revisions to the fs in repos.
svn_error_tsvn_repos_parse_dumpstream (svn_stream_t *stream, const svn_repos_parser_fns_t *parse_fns, void *parse_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
 Similar to svn_repos_parse_dumpstream2(), but uses the more limited svn_repos_parser_fns_t vtable type.
svn_error_tsvn_repos_get_fs_build_parser (const svn_repos_parser_fns_t **parser, void **parse_baton, svn_repos_t *repos, svn_boolean_t use_history, enum svn_repos_load_uuid uuid_action, svn_stream_t *outstream, const char *parent_dir, apr_pool_t *pool)
 Similar to svn_repos_get_fs_build_parser2(), but yields the more limited svn_repos_parser_fns_t vtable type.

Detailed Description

The filesystem 'dump' format contains nothing but the abstract structure of the filesystem -- independent of any internal node-id schema or database back-end.

All of the data in the dumpfile is acquired by public function calls into svn_fs.h. Similarly, the parser which reads the dumpfile is able to reconstruct the filesystem using only public svn_fs.h routines.

Thus the dump/load feature's main purpose is for *migrating* data from one svn filesystem to another -- presumably two filesystems which have different internal implementations.

If you simply want to backup your filesystem, you're probably better off using the built-in facilities of the DB backend (using Berkeley DB's hot-backup feature, for example.)

For a description of the dumpfile format, see /trunk/notes/fs_dumprestore.txt.


Define Documentation

#define SVN_REPOS_DUMPFILE_PROP_DELTA   "Prop-delta"
Since:
New in 1.1.

Definition at line 2066 of file svn_repos.h.

#define SVN_REPOS_DUMPFILE_TEXT_DELTA   "Text-delta"
Since:
New in 1.1.

Definition at line 2068 of file svn_repos.h.

#define SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_CHECKSUM   SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_MD5
Since:
New in 1.6.

Definition at line 2074 of file svn_repos.h.

#define SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_MD5   "Text-delta-base-md5"
Since:
New in 1.5.

Definition at line 2070 of file svn_repos.h.

#define SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_SHA1   "Text-delta-base-sha1"
Since:
New in 1.6.

Definition at line 2072 of file svn_repos.h.


Typedef Documentation

A vtable that is driven by svn_repos_parse_dumpstream2().

Since:
New in 1.1.
Deprecated:
Provided for backward compatibility with the 1.2 API.

Definition at line 2341 of file svn_repos.h.

A vtable that is driven by svn_repos_parse_dumpstream().

Similar to svn_repos_parse_fns2_t except that it lacks the delete_node_property and apply_textdelta callbacks.

Deprecated:
Provided for backward compatibility with the 1.0 API.

Enumeration Type Documentation

The different "actions" attached to nodes in the dumpfile.

Definition at line 2078 of file svn_repos.h.

The different policies for processing the UUID in the dumpfile.

Definition at line 2087 of file svn_repos.h.


Function Documentation

svn_error_t* svn_repos_dump_fs ( svn_repos_t repos,
svn_stream_t dumpstream,
svn_stream_t feedback_stream,
svn_revnum_t  start_rev,
svn_revnum_t  end_rev,
svn_boolean_t  incremental,
svn_cancel_func_t  cancel_func,
void *  cancel_baton,
apr_pool_t *  pool 
)

Similar to svn_repos_dump_fs2(), but with the use_deltas parameter always set to FALSE.

Deprecated:
Provided for backward compatibility with the 1.0 API.
svn_error_t* svn_repos_dump_fs2 ( svn_repos_t repos,
svn_stream_t dumpstream,
svn_stream_t feedback_stream,
svn_revnum_t  start_rev,
svn_revnum_t  end_rev,
svn_boolean_t  incremental,
svn_boolean_t  use_deltas,
svn_cancel_func_t  cancel_func,
void *  cancel_baton,
apr_pool_t *  pool 
)

Dump the contents of the filesystem within already-open repos into writable dumpstream.

Begin at revision start_rev, and dump every revision up through end_rev. Use pool for all allocation. If non-NULL, send feedback to feedback_stream. If dumpstream is NULL, this is effectively a primitive verify. It is not complete, however; see svn_fs_verify instead.

If start_rev is SVN_INVALID_REVNUM, then start dumping at revision 0. If end_rev is SVN_INVALID_REVNUM, then dump through the HEAD revision.

If incremental is TRUE, the first revision dumped will be a diff against the previous revision (usually it looks like a full dump of the tree).

If use_deltas is TRUE, output only node properties which have changed relative to the previous contents, and output text contents as svndiff data against the previous contents. Regardless of how this flag is set, the first revision of a non-incremental dump will be done with full plain text. A dump with use_deltas set cannot be loaded by Subversion 1.0.x.

If cancel_func is not NULL, it is called periodically with cancel_baton as argument to see if the client wishes to cancel the dump.

Since:
New in 1.1.
svn_error_t* svn_repos_get_fs_build_parser ( const svn_repos_parser_fns_t **  parser,
void **  parse_baton,
svn_repos_t repos,
svn_boolean_t  use_history,
enum svn_repos_load_uuid  uuid_action,
svn_stream_t outstream,
const char *  parent_dir,
apr_pool_t *  pool 
)

Similar to svn_repos_get_fs_build_parser2(), but yields the more limited svn_repos_parser_fns_t vtable type.

Deprecated:
Provided for backward compatibility with the 1.0 API.
svn_error_t* svn_repos_get_fs_build_parser2 ( const svn_repos_parse_fns2_t **  parser,
void **  parse_baton,
svn_repos_t repos,
svn_boolean_t  use_history,
enum svn_repos_load_uuid  uuid_action,
svn_stream_t outstream,
const char *  parent_dir,
apr_pool_t *  pool 
)

Set *parser and *parse_baton to a vtable parser which commits new revisions to the fs in repos.

The constructed parser will treat UUID records in a manner consistent with uuid_action. Use pool to operate on the fs.

If use_history is set, then the parser will require relative 'copyfrom' history to exist in the repository when it encounters nodes that are added-with-history.

If parent_dir is not NULL, then the parser will reparent all the loaded nodes, from root to parent_dir. The directory parent_dir must be an existing directory in the repository.

Print all parsing feedback to outstream (if non-NULL).

Since:
New in 1.1.
svn_error_t* svn_repos_load_fs ( svn_repos_t repos,
svn_stream_t dumpstream,
svn_stream_t feedback_stream,
enum svn_repos_load_uuid  uuid_action,
const char *  parent_dir,
svn_cancel_func_t  cancel_func,
void *  cancel_baton,
apr_pool_t *  pool 
)

Similar to svn_repos_load_fs2(), but with use_pre_commit_hook and use_post_commit_hook always FALSE.

Deprecated:
Provided for backward compatibility with the 1.0 API.
svn_error_t* svn_repos_load_fs2 ( svn_repos_t repos,
svn_stream_t dumpstream,
svn_stream_t feedback_stream,
enum svn_repos_load_uuid  uuid_action,
const char *  parent_dir,
svn_boolean_t  use_pre_commit_hook,
svn_boolean_t  use_post_commit_hook,
svn_cancel_func_t  cancel_func,
void *  cancel_baton,
apr_pool_t *  pool 
)

Read and parse dumpfile-formatted dumpstream, reconstructing filesystem revisions in already-open repos, handling uuids in accordance with uuid_action.

Read and parse dumpfile-formatted dumpstream, reconstructing filesystem revisions in already-open repos. Use pool for all allocation. If non-NULL, send feedback to feedback_stream.

If the dumpstream contains copy history that is unavailable in the repository, an error will be thrown.

The repository's UUID will be updated iff the dumpstream contains a UUID and uuid_action is not equal to svn_repos_load_uuid_ignore and either the repository contains no revisions or uuid_action is equal to svn_repos_load_uuid_force.

If the dumpstream contains no UUID, then uuid_action is ignored and the repository UUID is not touched.

If parent_dir is not NULL, then the parser will reparent all the loaded nodes, from root to parent_dir. The directory parent_dir must be an existing directory in the repository.

If use_pre_commit_hook is set, call the repository's pre-commit hook before committing each loaded revision.

If use_post_commit_hook is set, call the repository's post-commit hook after committing each loaded revision.

If cancel_func is not NULL, it is called periodically with cancel_baton as argument to see if the client wishes to cancel the load.

Since:
New in 1.2.
svn_error_t* svn_repos_parse_dumpstream ( svn_stream_t stream,
const svn_repos_parser_fns_t parse_fns,
void *  parse_baton,
svn_cancel_func_t  cancel_func,
void *  cancel_baton,
apr_pool_t *  pool 
)

Similar to svn_repos_parse_dumpstream2(), but uses the more limited svn_repos_parser_fns_t vtable type.

Deprecated:
Provided for backward compatibility with the 1.0 API.
svn_error_t* svn_repos_parse_dumpstream2 ( svn_stream_t stream,
const svn_repos_parse_fns2_t parse_fns,
void *  parse_baton,
svn_cancel_func_t  cancel_func,
void *  cancel_baton,
apr_pool_t *  pool 
)

Read and parse dumpfile-formatted stream, calling callbacks in parse_fns/parse_baton, and using pool for allocations.

If cancel_func is not NULL, it is called periodically with cancel_baton as argument to see if the client wishes to cancel the dump.

This parser has built-in knowledge of the dumpfile format, but only in a general sense:

* it recognizes revision and node records by looking for either a REVISION_NUMBER or NODE_PATH headers.

* it recognizes the CONTENT-LENGTH headers, so it knows if and how to suck up the content body.

* it knows how to parse a content body into two parts: props and text, and pass the pieces to the vtable.

This is enough knowledge to make it easy on vtable implementors, but still allow expansion of the format: most headers are ignored.

Since:
New in 1.1.
svn_error_t* svn_repos_verify_fs ( svn_repos_t repos,
svn_stream_t feedback_stream,
svn_revnum_t  start_rev,
svn_revnum_t  end_rev,
svn_cancel_func_t  cancel_func,
void *  cancel_baton,
apr_pool_t *  pool 
)

Verify the contents of the file system in repos.

If feedback_stream is not NULL, write feedback to it (lines of the form "* Verified revision %ld\n").

If start_rev is SVN_INVALID_REVNUM, then start verifying at revision 0. If end_rev is SVN_INVALID_REVNUM, then verify through the HEAD revision.

If cancel_func is not NULL, call it periodically with cancel_baton as argument to see if the caller wishes to cancel the verification.

Since:
New in 1.5.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines