class
ScriptSubversion.
Subversion
Bases: object
Scripting functionality for the “CODESYS SVN” plugin. An instance of this interface is injected into the default namespace under the name “svn”.
Only available if the “CODESYS SVN” Plugin is installed!
property
offline_mode
Gets a value indicating whether Subversion is in offline_mode.
bool
True if offline_mode; otherwise False.
set_offline_mode
mode: bool
revalidate_locks: bool = True
Sets the offline mode.
mode (bool) – The offline mode to set.
revalidate_locks (bool) – if set to True, all locks in the primary project are revalidated. This parameter is optional, the default is True.
Script should honor the offline mode set by the user, and maybe they should change it back at the end of the script.
checkout
url: Uri
project_path: str
project_name: str
revision: DateTime
as_library: bool
as_primary_project: bool = True
omit_externals: bool = True
Checks out a project of the given repository url.
url (Uri) – The URL.
project_path (str) – The path to check out the new project.
project_name (str) – The name of the checked out project.
revision (DateTime) – The revision.
as_primary_project (bool) – If set to True, the project is checked out as primary project. This parameter is optional, the default is True.
omit_externals (bool) – if set to True, externals are omitted. This parameter is optional, the default is False.
as_library (bool) – if set to True, the project is checked out as library project.
The created project.
get_log
remote_uri: object
revisions: Optional[object] = None
limit: int = 0
stop_on_copy: bool = True
retrieve_all_properties: bool = False
Gets the log for a given Url.
remote_uri (object) – The remote Url. This can either be a string or an Uri object.
revisions (object) – The revisions we want to get the log for. If you pass None, no revision filtering happens at all. If you pass -1, the Head Revision is fetched. If you pass a single integer or DateTime, that revision is fetched. If you pass a python slice of integer or DateTime, that range is fetched. If you pass a sequence of revisions or slices, the combination of all the items is fetched.
limit (int) – The maximum number of revisions to fetch. Pass 0 for unlimited.
stop_on_copy (bool) – if set to True, stop on copies.
retrieve_all_properties (bool) – if set to True, retrieve all revision properties. If set to False, only revision properties considered standard by svn (log message, author, date…) are fetched.
list[LogInfo]
A sequence of loginfos.
For revision slice objects, use the python builtin constructor: slice(start, stop). The order of start and stop is relevant in combination with limit, to determine whether the first or last {limit} entries of the slice are returned. Currently, steps for slices are not supported.
auth_username_password
eventargs: UsernamePasswordAuthenticationRequest
[Delegate] Request a username and a password for authentication. Currently comes with an AuthenticationRequest.type of SvnAuthenticationType.UsernamePassword to request a username and a password.
All event handlers will be unsubscribed on the end of script execution.
auth_username
eventargs: UserNameAuthenticationRequest
[Delegate] Request a username for authentication. Comes with an AuthenticationRequest.type of SvnAuthenticationType.Username
All event handlers will be unsubscribed on the end of script execution.
auth_password
eventargs: PasswordAuthenticationRequest
[Delegate] Request a password for authentication. Currently comes with an AuthenticationRequest.type of SvnAuthenticationType.SslClientCertificatePassword to request the passphrase to unlock a client certificate.
All event handlers will be unsubscribed on the end of script execution.
auth_certificate
eventargs: ClientCertificateRequest
[Delegate] Request a client certificate for authentication. Currently comes with an AuthenticationRequest.type of SvnAuthenticationType.SslClientCertificate to request a certificate file name.
All event handlers will be unsubscribed on the end of script execution.
auth_servertrust
eventargs: ServerTrustRequest
[Delegate] Request verification of trust for the server certificate. Currently comes with an AuthenticationRequest.type of SvnAuthenticationType.SslServerTrust to request trust for a server certificate.
All event handlers will be unsubscribed on the end of script execution.
working_set_modified
eventargs: SelectionModificationArgs
[Delegate] Occurs when the working set of a Subversion operation was modifed due to consistency constraints between several objects. Such constraints can be enforced by plugins. One example is that, for renamed objects, the old and new location can be committed or reverted only together.
Simple scripts can simply ingore this events. One possible use case is to abort the operation by throwing an exception when objects were suppressed by plugins, in other words, SelectionModificationArgs.objects_were_removed is true.
working_set_modification_conflict
eventargs: SelectionModificationConflictArgs
[Delegate] Occurs when the attempts to modify the working set of a Subversion operation due to consistency constraints between several objects failed due to a conflict. In other words, one plugin wants to select an object which a different plugin wants to deselect at the same time.
Subscribing a handler to this event normally suppresses the dialog shown in such occasions (and all other handlers installed by other plugins) if the handler does not set the ISelectionModificationConflictArgs.handled flag to false. So subscribing an empty function to this event is a simple method to suppress the user dialog. After this handler is called, a System.InvalidOperationException is thrown if the handler does not throw its own exception.
property
default_conflict_resolution_mode
Gets or sets the global default conflict resolution mode.
Setting this value to SvnConflictResolutionMode.Default will restore the implementation default settings of the current version.
SvnConflictResolutionMode
The resolution mode.
property
default_auto_locking_mode
Gets or sets the global default auto locking mode.
Setting this value to SvnAutoLockingMode.Default will restore the implementation default settings of the current version.
SvnAutoLockingMode
property
default_conflict_resolution_use_markers
Gets or sets the default whether conflict resolution allows conflict markers.
Some mergers allow the insertion of “conflict markers” into the merged objects. If this option is set, and the object contains some unmergeable conflicts, those conflicts are then represented by those conflict markers int the source code, and the object itsself is marked as successfully merged. Example:
SvnConflictUseMarkerMode
The default conflict resolution markers setting.
force_credentials
username: Optional[str] = None
password: Optional[str] = None
Forces a specific userName and password for all future operations, overriding the cache.
Instead of consulting the password cache / storage, the given username and password are tried. If those fail, interactive prompting is used. This is a global option, it influences all SVN operations, including background checks, repository browser etc. To prevent unintended side effects, overriding should be enabled only for very short timeframes. At the end of the script execution, the forcing of credentials will be automatically reset back.
auth_sshtrust
eventargs: SshTrustRequest
[Delegate] Request verification of trust for the server certificate. Currently comes with an AuthenticationRequest.type of SvnAuthenticationType.SshServerTrust to request trust for a server certificate.
All event handlers will be unsubscribed on the end of script execution.
class
ScriptSubversion.
LogInfo
Bases: object
Svn log info.
Only available if the CODESYS SVN Plugin is installed!
property
url
Gets the URL.
Uri
property
author
Gets the author.
str
property
message
Gets the commit message.
str
property
revision
Gets the revision.
int
property
time
Gets the time.
DateTime
property
changes
Gets the changes.
list[ChangeItem]
property
properties
Gets the revision properties. The keys are strings, the values are either strings (for text properties) or bytes (for binary properties).
Dictionary(object, object)
class
ScriptSubversion.
ChangeItem
Bases: object
Item describing a single change in a svn log info instance.
Only available if the CODESYS SVN Plugin is installed!
property
path
Gets the path (relative to the repo root)
str
property
url
Gets the URL (absolute).
Uri
property
action
Gets the action.
SvnChangeAction
property
copy_from_path
Gets the copy_from_path or None if no copy.
str
property
copy_from_revision
Gets the copy_from_revision or None if no copy.
int
class
ScriptSubversion.
SelectionModificationArgs
Bases: object
The exact description of the modifiation of the selection in the ISubversion4.working_set_modified event.
property
action
Gets the action whose working set was modified.
SvnSelectionVerificationAction
property
objects_were_removed
Gets a value indicating whether objects were removed from the working set.
Using this boolean to check whether objects were removed is more efficient than checking the length of removed_objects.
bool
True if objects were removed; otherwise, False.
property
objects_were_added
Gets a value indicating whether objects were added to the working set.
Using this boolean to check whether objects were added is more efficient than checking the length of added_objects.
bool
True if objects were added; otherwise, False.
property
result
Gets the final list of objects, the result of the hooks operation.
list[object]
property
original_objects
Gets the original list of objects.
list[object]
property
removed_objects
Gets the removed objects.
list[object]
property
added_objects
Gets the added objects.
list[object]
class
ScriptSubversion.
SelectionModificationConflictArgs
Bases: object
property
action
The action which caused the conflict.
SvnSelectionVerificationAction
property
conflicting_candidate
Gets the conflicting candidate, this is the object which the first hook wants to select, and the second hook wants to deselect.
object
property
reason_for_selection
This is the reason why the first hook wants to select the conflicting_candidate.
str
property
object_causing_selection
This is the object causing the first hook to select the conflicting_candidate.
object
property
reason_for_deselection
This is the reason why the second hook wants to deselect the conflicting_candidate.
str
property
object_causing_deselection
This is the object causing the second hook to deselect the conflicting_candidate.
object
property
handled
Gets or sets a value indicating whether this SelectionModificationConflictArgs is handled. This is set to true by default, which suppresses all other handlers installed by the system for this event (including the UI popup). You can set it to false to let the system call those other handlers.
bool
True if handled; otherwise, False.