Package svndump :: Module file :: Class SvnDumpFile
[show private | hide private]
[frames | no frames]

Class SvnDumpFile


A class for reading and writing svn dump files.
Method Summary
  __init__(self)
  add_node(self, node)
Add a node to the current revision.
  add_rev(self, revProps)
Add a new revision to this dump file.
  add_rev_from_dump(self, dump)
Add the current revision of the specified SvnDumpFile to this one.
  close(self)
Close this svn dump file.
bool create_like(self, filename, srcfile)
Creates this dumpfile like srcfile.
  create_with_rev_0(self, filename, uuid, rev0date)
Create a new dump file starting with revision 0.
  create_with_rev_n(self, filename, uuid, firstRevNr)
Create a new dump file.
SvnDumpNode get_node(self, index)
Returns the node at the given index.
integer get_node_count(self)
Returns the count of nodes of the current revision.
  get_nodes_by_path(self, path, actions)
Returns a list of nodes matching path and actions.
  get_nodes_iter(self)
Returns an iterator returning the nodes.
string get_rev_author(self)
Returns the author of the current revision.
list( integer ) get_rev_date(self)
Returns the date of the current revision as ( time_t, micros ).
string get_rev_date_str(self)
Returns the date of the current revision as string.
string get_rev_log(self)
Returns the log message of the current revision.
integer get_rev_nr(self)
Returns the current revision number.
list( string ) get_rev_prop_names(self)
Returns a list of revision property names of the current revision.
string get_rev_prop_value(self, name)
Returns the value of the revision property with the specified name.
dict( string -> string ) get_rev_props(self)
Returns a dict containing the revision properties.
string get_uuid(self)
Returns the UUID of this dump file.
bool has_rev_prop(self, name)
Returns true if the revision has a property with the specified name.
bool has_revision(self)
Returns false when EOF occured.
  open(self, filename)
Open a dump file for reading and read the header.
bool read_next_rev(self)
Read the next revision.
  set_rev_author(self, author)
Set the author of this revision.
string set_rev_date(self, dateStr)
Check a date string, set and return a valid one.
  set_rev_log(self, logMsg)
Set the log message of this revision.
  set_rev_prop_value(self, name, value)
Set the value of the revision property with the specified name to the given value.
  set_uuid(self, uuid)
Returns the UUID of this dump file.

Method Details

add_node(self, node)

Add a node to the current revision.

This method uses SvnDumpNode.write_text_to_file().
Parameters:
node - The node to add.
           (type=SvnDumpNode)

add_rev(self, revProps)

Add a new revision to this dump file.
Parameters:
revProps - A dict with revision properties.
           (type=dict( string -> string ))

add_rev_from_dump(self, dump)

Add the current revision of the specified SvnDumpFile to this one.
Parameters:
dump - A dump file.
           (type=SvnDumpFile)

close(self)

Close this svn dump file.

create_like(self, filename, srcfile)

Creates this dumpfile like srcfile.

If the current revision number of srcfile is zero create_with_rev_0() is called on this dumpfile and read_next_rev() is called on srcfile.

If the current revision number of srcdump is greater than zero create_with_rev_n() is called.

In both cases True is returned if srcdump contains a revision and False if srcdump reached EOF.
Parameters:
filename - Name of the new dump file.
           (type=string)
srcfile - A dumpfile.
           (type=SvnDumpFile)
Returns:
False if EOF occured on srcfile.
           (type=bool)

create_with_rev_0(self, filename, uuid, rev0date)

Create a new dump file starting with revision 0.
Parameters:
filename - Name of the new dump file.
           (type=string)
uuid - UUID of the new dump file or None.
           (type=string)
rev0date - Svn date string for revision 0.
           (type=string)

create_with_rev_n(self, filename, uuid, firstRevNr)

Create a new dump file.
Parameters:
filename - Name of the new dump file.
           (type=string)
uuid - UUID of the new dump file or None.
           (type=string)
firstRevNr - First revision number (>0).
           (type=integer)

get_node(self, index)

Returns the node at the given index.
Parameters:
index - Index of the node to return.
           (type=integer)
Returns:
The node at the given index.
           (type=SvnDumpNode)

get_node_count(self)

Returns the count of nodes of the current revision.
Returns:
Node count of the curent revision.
           (type=integer)

get_nodes_by_path(self, path, actions='ACDR')

Returns a list of nodes matching path and actions.

Actions is a string that may contain one or more of the letters A, C, D and R which are the first letters of the actions Add, Change, Delete and Replace.
Parameters:
path - Path of the node.
           (type=string)
actions - Actions to search for.
           (type=string)

get_nodes_iter(self)

Returns an iterator returning the nodes.

get_rev_author(self)

Returns the author of the current revision.
Returns:
Author of the current revision.
           (type=string)

get_rev_date(self)

Returns the date of the current revision as ( time_t, micros ).
Returns:
The revision date.
           (type=list( integer ))

get_rev_date_str(self)

Returns the date of the current revision as string.
Returns:
The revision date.
           (type=string)

get_rev_log(self)

Returns the log message of the current revision.
Returns:
The log message.
           (type=string)

get_rev_nr(self)

Returns the current revision number.
Returns:
The current revision number.
           (type=integer)

get_rev_prop_names(self)

Returns a list of revision property names of the current revision.
Returns:
A list of revision property names.
           (type=list( string ))

get_rev_prop_value(self, name)

Returns the value of the revision property with the specified name.
Parameters:
name - Name of the property.
           (type=string)
Returns:
The value of the revision property.
           (type=string)

get_rev_props(self)

Returns a dict containing the revision properties.
Returns:
The revision properties.
           (type=dict( string -> string ))

get_uuid(self)

Returns the UUID of this dump file.
Returns:
UUID of this dump file or None if it doesn't have one.
           (type=string)

has_rev_prop(self, name)

Returns true if the revision has a property with the specified name.
Returns:
True if the revision has that property.
           (type=bool)

has_revision(self)

Returns false when EOF occured.
Returns:
False if EOF occured.
           (type=bool)

open(self, filename)

Open a dump file for reading and read the header.
Parameters:
filename - Name of an existing dump file.
           (type=string)

read_next_rev(self)

Read the next revision.
Returns:
False if EOF occured.
           (type=bool)

set_rev_author(self, author)

Set the author of this revision.
Parameters:
author - The author to set for this revision.
           (type=string)

set_rev_date(self, dateStr)

Check a date string, set and return a valid one.
Parameters:
dateStr - A svn date string.
           (type=string)
Returns:
A svn date string.
           (type=string)

set_rev_log(self, logMsg)

Set the log message of this revision.
Parameters:
logMsg - The log message to set for this revision.
           (type=string)

set_rev_prop_value(self, name, value)

Set the value of the revision property with the specified name to the given value.
Parameters:
name - Name of the property.
           (type=string)
value - Value of the property.
           (type=string)

set_uuid(self, uuid)

Returns the UUID of this dump file.
Parameters:
uuid - UUID to set for this dump file (may be None).
           (type=string)

Generated by Epydoc 2.1 on Mon Jun 16 03:33:12 2008 http://epydoc.sf.net