ScriptSvnRemoteSession

class ScriptSvnRemoteSession.SvnRemoteSession

Bases: object

Creates a persistent remote session for SVN remote access.

Remote sessions can be more efficient than the ISvnRemoteService access as they can cache state (like the svn:// tcp connection) across accesses, but they provide less functionality at the moment.

This interface is safe to be called from background threads, but a single instance cannot handle concurrent calls from several threads. (IOW, only one thread at a time may call into a method of one instance.)

property Url

Gets the base url of this session. All relative pathes are relative to this url.

Return type:

Uri

Returns:

The URL.

Reparent(url)

Changes the base url of this session. All relative pathes are relative to this url.

Parameters:

url (Uri) – The new URL.

property Root

Gets the repository root url.

Return type:

Uri

MakeRelativePath(url)

Gets the relative directory (relative to the base url).

Parameters:

url (Uri) – The URL.

Return type:

str

Returns:

The relative directory of this url.

List(stRelDir, revision, entryTypes, bSwallowNonExistingException)

Lists the specified Url on the server.

Parameters:
  • stRelDir (str) – The st rel dir.

  • revision (SvnRevision) – The revision. Currently, the only allowed revisions are numeric revisions, as well as HEAD and NONE ( which is mapped to HEAD).

  • entryTypes (SvnDirEntryItems) – The extended entry types.

  • bSwallowNonExistingException (bool) – If set to True, the exceptions for non existing destination entries are suppressed, and an empty list is returned instead.

Return type:

list[SvnDirEntry]

Returns:

The list of SVN entries.

GetNodeKind(stRelPath, revision, bSwallowNonExistingException)

Gets the node kind of the specified URL on the server.

Parameters:
  • stRelPath (str) – The relative path.

  • revision (SvnRevision) – The revision. Currently, the only allowed revisions are numeric revisions, as well as HEAD and NONE (which is mapped to HEAD).

  • bSwallowNonExistingException (bool) – If set to True, the exceptions for non existing destination entries are suppressed, and SvnNodeKind.None is returned instead.

Return type:

SvnNodeKind

Returns:

The NodeKind.

ResolveRevision(revision)

Resolves a revision (e. G. Head or DateTime) to a numeric revision.

Parameters:

revision (SvnRevision) – The revision.

Return type:

int

Returns:

The resolved numeric revision.

Stat(stRelPath, revision, bSwallowNonExistingException)

Stats the specified destination.

Parameters:
  • stRelPath (str) – The relative path.

  • revision (SvnRevision) – The revision.

  • bSwallowNonExistingException (bool) – If set to True, the exceptions for non existing destination entries are suppressed, and null is returned instead.

Return type:

SvnDirEntry

Returns:

The Svn Directory entry.

GetProperties(url, revision, stPropName=None)

Gets the properties of an SVN object.

Parameters:
  • url (Uri) – The URL.

  • revision (SvnRevision) – The revision.

  • stPropName (str) – Name of the property, or null if you want to get all properties.

Return type:

PropDictWithException

Returns:

The Property Dictionary, or the exception object.

Validate()

Validates this instance. This checks whether the connection is still valid and the server is reachable.

see also SvnRemoteSession.IsConnectionLess and SvnIntegration.IsConnectionLessRepository

property IsConnectionLess

Gets a value indicating whether this instance is connection less.

Return type:

bool

Returns:

True if this instance is connection less; otherwise, False.

see also SvnIntegration.IsConnectionlessRepository

class ScriptSvnRemoteSession.PropDictWithException

Bases: object

This class maps properties to their name.

property Exception

Gets the exception, or null if no exception happened.

Return type:

SvnException