ScriptSvnExtension

class ScriptSvnExtension.SvnExtension

Bases: ScriptObject, ScriptProject

All ScriptObject and ScriptProject instances are extended with this interface, to provide access to the subversion functionality.

property svn

Gets the svn extension for this object. This extension will be ProvidesIsVersioned or one of the appropriate sub-interfaces or this instance.

Return type:

ProvidesIsVersioned

class ScriptSvnExtension.ProvidesIsVersioned

Bases: object

All objects and projects have this common base functionality.

property is_versioned

Gets a value indicating whether this ScriptObject or ScriptProject is versioned.

Return type:

bool

Returns:

True if it is versioned; otherwise, False.

class ScriptSvnExtension.UnversionedProject

Bases: ProvidesIsVersioned

Unversioned projects implement this interface.

import(url: Uri, message: str)

Imports the project into subversion at the specified URL.

Parameters:
  • url (Uri) – The URL.

  • message (str) – The commit message.

import_project(url: Uri, message: str, version_info_mode: SvnVersionInfoMode)

Imports the project into subversion at the specified URL. Workaround for the fact that “import” is a reserved keyword in python.

Parameters:
  • url (Uri) – The URL.

  • message (str) – The commit message.

  • version_info_mode (SvnVersionInfoMode) – The version info mode.

class ScriptSvnExtension.VersionedProject

Bases: ProvidesIsVersioned

Versioned projects implement this interface.

commit(message: str, objects, keep_locks: bool = False, keep_changelists: bool = False)

Commits the project (or the specified objects in the project).

Parameters:
  • message (str) – The message.

  • objects (list[object]) – The objects to commit. You can pass instances of DeletedScriptObject, ScriptObject`s and the :class:`ScriptProject itsself. This parameter is optional. If it is omitted, all modifications in the project are committed.

  • keep_locks (bool) – if set to True, locks are kept. This parameter is optional, the default is false.

  • keep_changelists (bool) – if set to True, the changelists are kept. This parameter is optional, the default is false.

disconnect()

Disconnects this project from subversion, converting it into an unversioned project.

include_external(url: Uri, revision: DateTime)

Includes the specified URI as external object.

Parameters:
  • url (Uri) – The URI of the external object to include.

  • revision (DateTime) – The revision.

mark_as_resolved()

Marks the project as resolved (e. G. if there were tree conflicts).

revert(recursive: bool = False)

Reverts the project top level.

Parameters:

recursive (bool) – if set to True, the revert is recursive to all child objects. This parameter is optional, the default is False. Non-recursive reverts can be used to revert top-level property changes.

switch(url: Uri, revision: DateTime)

switches the project to the specified new location.

Parameters:
  • url (Uri) – The destination repository URL.

  • revision (DateTime) – The revision.

get_deleted_children(recursive: bool = False)

Gets the deleted children of the project, or an empty python list if none.

Parameters:

recursive (bool) – if set to True, deleted sub children are included recursively. This parameter is optional, default is false.

Return type:

list[object]

Returns:

A python list of deleted children.

get_children(recursive: bool = False)

Gets all children of the project, or an empty python list if none. This includes deleted children.

Parameters:

recursive (bool) – if set to True, sub children are included recursively. This parameter is optional, default is false.

Return type:

list[object]

Returns:

A python list of deleted children.

find(name: str, recursive: bool = False)

Finds objects matching the given name (including deleted objects).

Parameters:
  • name (str) – The name.

  • recursive (bool) – Whether we search recursively (This parameter is optional, default = False).

Return type:

list[object]

Returns:

The collection of objects.

revalidate_locks()

Revalidates the locks in this project.

merge(url: str, flags: SvnMergeFlags, revision_ranges: object)

Merges the specified URL. Due to some constraints, merging is currently only supported for the primary project.

Parameters:
  • url (str) – The URL specifying the merge source.

  • flags (SvnMergeFlags) – The flags for the merge.

  • revision_ranges (object) – The revison_ranges.

property effective_conflict_resolution_mode

Gets the effective conflict resolution mode. If the mode is not specifically configured for this project, the global setting is resolved.

Return type:

SvnConflictResolutionMode

property project_conflict_resolution_mode

Gets or sets the project conflict specific resolution mode.

Return type:

SvnConflictResolutionMode

Returns:

The project resolution mode.

property effective_auto_locking_mode

Gets the effective auto locking mode. If the mode is not specifically configured for this project, the global setting is resolved.

Return type:

SvnAutoLockingMode

property project_auto_locking_mode

Gets or sets the project specific auto locking mode.

Return type:

SvnAutoLockingMode

Returns:

The project_auto_locking_mode.

property project_conflict_resolution_use_markers

Gets or sets the default whether conflict resolution allows conflict markers.

Return type:

SvnConflictUseMarkerMode

Returns:

The default_conflict_resolution_use_markers. Reading it always returns true or false, setting it to null restores to the Default setting of the current implementation.

property effective_conflict_resolution_use_markers

Gets or sets the default whether conflict resolution allows conflict markers.

The effective project specific setting.

Return type:

SvnConlictUseMarkerMode

lock(objects, message: str = 'script lock', steal_lock: bool = False)

Locks the specified objects on the subversion server.

Parameters:
  • objects (list[object]) – The objects. If you pass null or an empty collection here, the whole project is locked.

  • message (str) – The message.

  • steal_lock (bool) – if set to True, the lock is stolen (IOW, existing locks are broken).

unlock(objects)

Releases the svn lock for the given objects. Does nothing if the object is not locked.

Parameters:

objects (list[object]) – The objects. If you pass null or an empty collection here, the whole project is unlocked.

revert_project_to_revision(revision: DateTime, overwrite_local_changes: bool = False)

Reverts the contents of the project to the given revision.

Parameters:
  • revision (DateTime) – The revision.

  • overwrite_local_changes (bool) – If set to True, local changes are silently overwritten. Throws “InvalidOperationException” when local changes exist, but overwrite_local_changes is set to False.

copy(newLocation: str, commit_message: str, source_revision: DateTime, switch_to_new_location: bool = False)

Creates a copy (branch or tag) of the project at the specified new location.

Parameters:
  • newLocation (str) – The new location.

  • commit_message (str) – The commit message.

  • source_revision (DateTime) – The source revision.

  • switch_to_new_location (bool) – if set to True, switches to the new location after branching.

property info

Get the SVN info of this VersionedProject from the working copy.

Return type:

SvnInfo

get_version_summary()

Get the version summary of the svn working copy (similar to svnversion.exe).

Return type:

SvnVersionSummary

Returns:

Version summary

check_objects_preventing_safe_merge()

Checks whether the working copy is in a “safe” state for merging.

Return type:

str

Returns:

A string explaining why the project cannot be merged, or null if there is no obstacle.

update(objects, recursive: bool = True, omit_externals: bool = False, prevent_treeconflicts: bool = False)

Updates the specified objects to HEAD

Parameters:
  • objects (list[object]) – The objects. You can pass ScriptObjects and the ScriptProject itsself. This parameter is optional, if omitted, the Project root itsself is updated.

  • recursive (bool) – if set to True, the update recursively includes all child objects. This parameter is optional, the default is true.

  • omit_externals (bool) – if set to True, externals are omitted during the update operation. This parameter is optional, the default is false.

  • prevent_treeconflicts (bool) – if set to True, we try to predict and avoid tree conflict by throwing a SvnTreeConflictImminentException.

update_to(revision: DateTime, objects=None, recursive: bool = True, omit_externals: bool = False, prevent_treeconflicts: bool = False)

Updates the specified objects to a specified revision.

Parameters:
  • revision (DateTime) – The revision.

  • objects (list[object]) – The objects. You can pass ScriptObjects and the ScriptProject itsself. This parameter is optional, if omitted, the Project root itsself is updated.

  • recursive (bool) – if set to True, the update recursively includes all child objects. This parameter is optional, the default is true.

  • omit_externals (bool) – if set to True, externals are omitted during the update operation. This parameter is optional, the default is false.

  • prevent_treeconflicts (bool) – if set to True, we try to predict and avoid tree conflict by throwing a SvnTreeConflictImminentException.

class ScriptSvnExtension.ObjectInVersionedProject

Bases: ProvidesIsVersioned

Objects in versioned projects have this extension.

property is_deleted

Gets a value indicating whether this ObjectInVersionedProject is deleted.

Return type:

bool

Returns:

True if deleted; otherwise, False.

property is_added

Gets a value indicating whether this ObjectInVersionedProject is added.

Return type:

bool

class ScriptSvnExtension.UnversionedObjectInVersionedProject

Bases: ObjectInVersionedProject

Unversioned objects in versioned projects implement this interface.

add()

Adds the specific object to version control.

class ScriptSvnExtension.VersionedObject

Bases: ObjectInVersionedProject

Common functionality for existing and deleted versioned objects.

property ignore_on_commit

Gets or sets a value indicating whether this VersionedObject is ignored on commit.

Return type:

bool

Returns:

True if is_ignored_on_commit; otherwise, False.

property is_locked

Gets a value indicating whether this VersionedObject is locked.

Return type:

bool

Returns:

True if locked; otherwise, False.

property has_modifications

Gets a value indicating whether this VersionedObject has any local changes against the base revision, including deletion, addition, property changes and conflicts.

Return type:

bool

Returns:

True if changed; otherwise, False.

property has_deleted_children

Gets a value indicating whether this VersionedObject has deleted children.

Return type:

bool

Returns:

True if has deleted children; otherwise, False.

property is_external

Gets a value indicating whether this VersionedObject is external.

Return type:

bool

Returns:

True if external; otherwise, False.

revert(recursive: bool = False)

Reverts the given object.

Parameters:

recursive (bool) – if set to True, the revert is recursive to all child objects. This parameter is optional, the default is false.

get_deleted_children(recursive: bool = False)

Gets the deleted children of the project, or an empty python list if none.

Parameters:

recursive (bool) – if set to True, deleted sub children are included recursively. This parameter is optional, default is false.

Return type:

list[object]

Returns:

A python list of deleted children.

get_children(recursive: bool = False)

Gets the children of the project, including deleted children, or an empty python list if none.

Parameters:

recursive (bool) – if set to True, deleted sub children are included recursively. This parameter is optional, default is false.

Return type:

list[object]

Returns:

A python list of deleted children.

commit(message: str, recursive: bool = True, keep_locks: bool = False, keep_changelists: bool = False)

Commits the specified object.

Parameters:
  • message (str) – The cinnnut message.

  • recursive (bool) – if set to True, all sub objects are committed recursively. This parameter is optional, the default is true.

  • keep_locks (bool) – if set to True, locks are kept. This parameter is optional, the default is false.

  • keep_changelists (bool) – if set to True, the changelists are kept. This parameter is optional, the default is false.

find(name: str, recursive: bool = False)

Finds objects matching the given name (including deleted objects).

Parameters:
  • name (str) – The name.

  • recursive (bool) – Whether we search recursively (This parameter is optional, default = False).

Return type:

list[object]

Returns:

The collection of objects.

lock(message: str = 'script lock', steal_lock: bool = False, recursive: bool = False)

Locks the specified object on the subversion server.

Parameters:
  • message (str) – The message.

  • steal_lock (bool) – if set to True, the lock is stolen (IOW, existing locks are broken).

  • recursive (bool) – if set to True, subnodes are recursively locked.

unlock(recursive: bool = False)

Releases the svn locks for this instance.

Parameters:

recursive (bool) – if set to True, subnodes are recursively unlocked.

property copied_to

Gets the objects this object was locally copied to, or an empty tuple if nothing was copied.

Return type:

list[object]

Returns:

The copied to.

property info

Get the SVN info of this VersionedObject from the working copy.

Return type:

SvnInfo

property has_conflict

Gets a value indicating whether this VersionedObject has any conflict.

Return type:

bool

revert_to_revision(revision: DateTime, recursive: bool)

Reverts the given object.

Parameters:
  • revision (DateTime) – the revision to revert to, provided as timestamp

  • recursive (bool) – if set to True, the revert is recursive to all child objects.

class ScriptSvnExtension.ExistingVersionedObject

Bases: VersionedObject

Versioned objects (which can only exist in versioned projects) provide the functionality specified in this interface.

resolve_conflict(resolution: SvnResolution)

Resolves a conflict on the given object.

mark_as_resolved()

Marks the conflicts of the object as resolved.

include_external(url: Uri, revision: DateTime)

Includes the specified URI as external object.

Parameters:
  • url (Uri) – The URI of the external object to include.

  • revision (DateTime) – The revision.

update(recursive: bool = True, omit_externals: bool = False)

Updates the object to HEAD revision.

Parameters:
  • recursive (bool) – if set to True, the update recursively includes all child objects.

  • omit_externals (bool) – if set to True, externals are omitted during the update operation.

update_to(revision: DateTime, recursive: bool = True, omit_externals: bool = False)

Updates the object to a specified revision.

Parameters:
  • revision (DateTime) – The revision.

  • recursive (bool) – if set to True, the update recursively includes all child objects.

  • omit_externals (bool) – if set to True, externals are omitted during the update operation.

property copied_from

Gets the object this was copied from, or None if this object was not locally copied.

Return type:

object

Returns:

The copy source object (which may be deleted by now).

property moved_from

Gets the object this was moved from, or None if this object was not locally copied.

Return type:

object

Returns:

The copy source object (which is marked as deleted).

class ScriptSvnExtension.DeletedScriptObject

Bases: object

Instances of ExtendedObject`{:class:`DeletedVersionedScriptObject} represent deleted objects which are still present in the working copy, and are returned by get_deleted_children and get_children.

property svn

Gets the svn extension for this object. This extension will be ObjectInVersionedProject or one of the appropriate sub-interfaces or this instance.

Return type:

DeletedVersionedObject

property is_root

Gets a value indicating whether this DeletedScriptObject is root.

Return type:

bool

Returns:

False, as the project root cannot be a deleted object.

property type

Gets the type guid.

Return type:

Guid

property guid

Gets the GUID of the object.

Return type:

Guid

property embedded_object_types

Gets the embedded object types.

Return type:

list[Guid]

get_name(resolve_localized_display_name: bool = False)

Gets the name of the object.

Parameters:

resolve_localized_display_name (bool) – This parameter is ignored (and is only for compatibility with IScriptObject instances). This parameter is optional, default = False)

Return type:

str

Returns:

The name of the object.

property index

Gets the index. Is only for compatibility with IScriptObject instances, and always returns -1.

Return type:

int

property is_folder

Gets a value indicating whether this instance is a folder.

Return type:

bool

Returns:

True if this instance is a folder; otherwise, False.

property parent

Gets the parent ScriptObject or DeletedSvnObject, or the Project if we are top-level.

Return type:

object

property project

Gets the project.

Return type:

ScriptProject

property handle

Gets the internal Automation Platform handle of the Project.

Return type:

int

find(name: str, recursive: bool = False)

Finds objects matching the given name. As this is a deleted object, all child objects are also deleted ones.

Parameters:
  • name (str) – The name.

  • recursive (bool) – Whether we search recursively (This parameter is optional, default = False).

Return type:

list[object]

Returns:

The collection of objects.

get_children(recursive: bool = False)

Gets the children of our object. As this is a deleted object, all child objects are also deleted ones.

Parameters:

recursive (bool) – If set to True, we work recursive (This parameter is optional, default = False).

Return type:

list[object]

Returns:

All child objects.

class ScriptSvnExtension.DeletedVersionedObject

Bases: VersionedObject

Deleted versioned objects have this interface on their .svn property. It currently only provides what IVersionedObject provides.

property moved_to

Gets the object this was moved to, or None if this object was deleted and not moved.

Return type:

object

Returns:

The copy source object (which is marked as deleted).

class ScriptSvnExtension.SvnVersionSummary

Bases: object

The version summary of a svn working copy (similar to svnversion.exe).

property min_version

Gets the min version.

Return type:

long

property max_version

Gets the max version.

Return type:

long

property is_incomplete_working_copy

Gets a value indicating whether [incomplete working copy].

Return type:

bool

Returns:

True if [incomplete working copy]; otherwise, False.

property is_modified

Gets a value indicating whether this SvnWorkingCopyVersionSummary is modified.

Return type:

bool

Returns:

True if modified; otherwise, False.

property is_switched

Gets a value indicating whether this SvnWorkingCopyVersionSummary is switched.

Return type:

bool

Returns:

True if switched; otherwise, False.

property is_clean_version

Gets a value indicating whetherthe version is clean (MINREVISION == MAXREVISION, not incomplete, not modified, not switched)

Return type:

bool

Returns:

True if [clean version]; otherwise, False.

property version_summary

Gets the version summary.

Return type:

str

property last_change_utc

Gets the time of the last change in UTC.

Return type:

DateTime

Returns:

The time of the last change in UTC.

property last_change_author

Gets author of the last change.

Return type:

str

Returns:

The author of the last change.

class ScriptSvnExtension.SvnInfo

Bases: object

SVN info of a versioned object or project.

property url

Gets the URL.

Return type:

Uri

property revision

Gets the queried revision.

Return type:

long

property repository_root

Gets the repository root.

Return type:

Uri

property repository_id

Gets the repository id, or Guid.Empty if not available.

Return type:

Guid

property last_change_revision

Gets the revision in which the subtree of the node had its last change.

Return type:

long

property last_change_time

Gets the last change time.

Return type:

DateTime

property last_change_author

Gets the last change author.

Return type:

str

property schedule

Gets the schedule.

Return type:

SvnSchedule

property content_time

Gets the content time.

Return type:

DateTime

property checksum

Gets the SHA1 checksum.

Return type:

str