class
ScriptSvnProjectServices.
SvnProjectServices
Bases: object
Contains all Svn functionality which is bound to a working copy / versioned project.
IncludeExternals
parentObject
url
revision
reporter
Includes an svn:externals directory tree.
parentObject (SvnObjectId) – The parent object, or null if you want to include it top level.
url (Uri) – The URL. (Currently, only absolute URLs are allowed, this will change
in the future. Peg revisions are allowed.)
revision (SvnRevision) – The revision, or null for an unversioned reference.
reporter (SvnReporter) – The Reporter.
DisconnectProject
nProjectHandle
reporter
Disconnects the project from subversion.
nProjectHandle (int) – The project handle.
reporter (SvnReporter) – The Reporter.
Switch
nProjectHandle
newUrl
revision
reporter
Switches the specified project handle to a different location (branch / tag).
nProjectHandle (int) – The project handle.
newUrl (Uri) – The new URL.
revision (SvnRevision) – The revision.
reporter (SvnReporter) – The reporter.
IsExternal
id
Determines whether the specified object is external.
id (SvnObjectId) – The object id.
bool
True if the specified n project handle is external; otherwise, False.
Resolved
objectIds
reporter
Marks subversion conflicts as resolved.
objectIds (list[SvnObjectId]) – The object ids. To guarantee consistency, you should pass this selection through SvnProjectServices.VerifySelection before calling.
reporter (SvnReporter) – The Reporter.
Resolve
objectId
resolution
reporter
Resolves a subversion conflict
objectId (SvnObjectId) – The object to resolve. To guarantee consistency, you should pass this selection through SvnProjectServices.VerifySelection before calling.
resolution (SvnResolution) – The resolution to apply to the conflict.
reporter (SvnReporter) – The Reporter.
RevalidateLocks
nProjectHandle
reporter
Checks all locks against the server, and releases all locks which have been broken, stolen or obsoleted in the given project.
nProjectHandle (int) – The project handle.
reporter (SvnReporter) – The Reporter.
AddToChangeList
objectIds
stChangelist
reporter
Adds or moves objects to a given changelist.
objectIds (list[SvnObjectId]) – The object ids. To guarantee consistency, you should pass this selection through SvnProjectServices.VerifySelection before calling.
stChangelist (str) – The changelist name.
reporter (SvnReporter) – The Reporter.
RemoveFromChangelist
objectIds
reporter
Removes objects from changelist.
objectIds (list[SvnObjectId]) – The object ids. To guarantee consistency, you should pass this selection through SvnProjectServices.VerifySelection before calling.
reporter (SvnReporter) – The Reporter.
GetChangelistNames
nProjectHandle
reporter
Gets all changelists.
nProjectHandle (int) – The project handle.
reporter (SvnReporter) – The Reporter.
list[str]
All the changelists which currently exist in the project
GetChangelistContents
nProjectHandle
changelists
reporter
Gets the objects of a set of changelists.
nProjectHandle (int) – The project handle.
changelists (list[str]) – The changelists.
reporter (SvnReporter) – The Reporter.
list[SvnObjectInfo]
All the objects currently contained in the named changelists.
GetChangelist
objectId
reporter
Gets the changelist of a given object, or null if the object is not member of a changelist.
objectId (SvnObjectId) – The object id.
reporter (SvnReporter) – The Reporter.
str
The changelist the object is member of.
GetPropertyList
objectId
revision
bRecursive
reporter
Gets the property list.
objectId (SvnObjectId) – The object id.
revision (SvnRevision) – The revision.
bRecursive (bool) – if set to True, all subobjects are processed recursively.
reporter (SvnReporter) – The reporter.
list[SvnPropertyList]
GetPropertyValues
objectId
revision
bRecursive
stPropertyName
reporter
Gets the property values.
objectId (SvnObjectId) – The object id.
revision (SvnRevision) – The revision.
bRecursive (bool) – if set to True, all subobjects are processed recursively.
stPropertyName (str) – Name of the st property.
reporter (SvnReporter) – The reporter.
dict(SvnObjectInfo, SvnPropertyValue)
SetPropertyValue
objectId
bRecursive
stPropertyName
propertyValue
reporter
Sets the property value.
objectId (SvnObjectId) – The object id.
bRecursive (bool) – if set to True, all subobjects are processed recursively.
stPropertyName (str) – Name of the st property.
propertyValue (SvnPropertyValue) – The property value.
reporter (SvnReporter) – The reporter.
DeleteProperty
objectId
bRecursive
stPropertyName
reporter
Deletes the property.
objectId (SvnObjectId) – The object id.
bRecursive (bool) – if set to True, all subobjects are processed recursively.
stPropertyName (str) – Name of the st property.
reporter (SvnReporter) – The reporter.
GetObjectAtRevision
objectRevisionContext
objectId
revision
mode
reporter
Gets the object at a given revision.
objectRevisionContext (Guid) – The object revision context.
objectId (SvnObjectId) – The object id.
revision (SvnRevision) – The revision.
mode (SvnObjectRevisionMode) – The mode to create the temporary object context.
reporter (SvnReporter) – The Reporter.
MetaObjectStub
The meta object stub.
GetDiffSummary
nProjectHandle
leftRevision
rightRevision
bIgnoreAncestry
reporter
Gets a diff summary.
nProjectHandle (int) – The project handle.
leftRevision (SvnRevision) – The left revision.
rightRevision (SvnRevision) – The right revision.
bIgnoreAncestry (bool) – if set to True, the ancestry is ignored.
reporter (SvnReporter) – The Reporter.
SvnDifference
The svn differences.
GetWcRootDir
nProjectHandle
Gets the working copy root directory.
nProjectHandle (int) – The project handle.
str
null if the project is not under source control.
IsVersioned
objectId
Determines whether the specified object is versioned.
objectId (SvnObjectId) – The object id.
bool
True if the specified object id is versioned; otherwise, False.
Add
objectIds
Adds the specified unversioned object ids to the version control.
objectIds (list[SvnObjectId]) – The object ids. To guarantee consistency, you should pass this selection through SvnProjectServices.VerifySelection before calling.
HasWorkingCopyData
nProjectHandle
Determines whether the given Project has a working copy data stream.
nProjectHandle (int) – The project handle.
bool
True if the project has working copy data; otherwise, False.
IsSubversionActive
nProjectHandle
Determines whether subversion is active for the specified project handle. This returns true when SvnProjectServices.GetWcRootDir returns a valid working directory.
nProjectHandle (int) – The project handle.
bool
True if subversion is active for the specified project handle; otherwise, False.
ActivateSubversion
nProjectHandle
reporter
Activates the subversion services for the given project.
nProjectHandle (int) – The project handle.
reporter (SvnReporter) – The reporter.
bool
True if the activation was successfull, false if it was already active. Throws “InvalidOperationException” if the project does not have a valid working copy data stream.
GetInfo
objectId
revision
depth
changeLists
reporter
Returns more information about an object in the working copy.
objectId (SvnObjectId) – The object id.
revision (SvnRevision) – The revision.
depth (SvnDepth) – The depth.
changeLists (list[str]) – The change lists.
reporter (SvnReporter) – The reporter.
list[SvnInfo]
HasTreeConflict
id
Determines whether the object has a tree conflict.
id (SvnObjectId) – The id.
bool
True if there is a tree conflict; otherwise, False.
GetLog
objectId
revisionRange
nLimit
bStopOnCopy
bRetrieveAllProperties
reporter
Queries subversion log entries.
objectId (SvnObjectId) – The object id for the object to query.
revisionRange (SvnRevisionRange) – The revision range.
nLimit (int) – The maximum number of log entries.
bStopOnCopy (bool) – if set to True, stop on copy operations.
bRetrieveAllProperties (bool) – if set to True, all revision properties are fetched.
reporter (SvnReporter) – The reporter.
list[SvnLogInfo]
The list of log entries.
ConnectProject
nProjectHandle
url
revision
bOmitExternals
reporter
Imports the project into an existing subversion repository.
nProjectHandle (int) – The handle of the project to import.
url (Uri) – The subversion URL where to import the project.
revision (SvnRevision) –
bOmitExternals (bool) – if set to True, externals are omitted.
reporter (SvnReporter) – The Reporter or null.
Merge
nProjectHandle
url
revisionRange
flags
reporter
Merges changes from a different branch.
nProjectHandle (int) – The handle.
url (Uri) – The URL.
revisionRange (list[SvnRevisionRange]) – The revision range. Do not pass any revisions for –reintegrate merges.
flags (SvnMergeFlags) – Flags for the merge.
reporter (SvnReporter) – The message view reporter.
VerifySelectionReported
action
ids
urlsAndRevisions
reporter
HelperMethod for VerifySelection: Verifies a given SvnObjectID, and reports occuring changes to the given ISvnReporter.
action (SvnSelectionVerificationAction) – The action.
ids (list[SvnObjectId]) – The ids.
urlsAndRevisions (SvnSelectionVerificationUrlAndRevisionData) – For SvnSelectionVerificationAction.IncludeExternals, the caller must provide an instance which is able to resolve Urls and revisions for all SvnObjectId instances given in ids. After the call, the variable will point to an instance which knows how to resolve all SvnObjectId instances in the returned. For other values of action, null has to be passed.
reporter (SvnReporter) – The reporter.
list[SvnObjectId]
The verified selection, or null if no solution was found.
GetProjectConfiguration
nProjectHandle
Gets the project specific configurations.
nProjectHandle (int) – The project handle.
The project specific configuration object. The returned instance remains valid as long as the project is open.
GetVersionSummary
nProjectHandle
trailUri=None
reporter=None
Gets the version summary.
nProjectHandle (int) – The n project handle.
trailUri (Uri) – If trailUri is non-NULL, use it to determine if local_abspath itself is switched. It should be any trailing portion of the working copy roots expected URL, long enough to include any parts that the caller considers might be changed by a switch. If it does not match the end of the working copy roots actual URL, then report a “switched” status.
reporter (SvnReporter) – The reporter.
SvnWorkingCopyVersionSummary
The version summary of the working copy.
CheckObjectsPreventingSafeMerge
nProjectHandle
reporter
Checks whether the working copy is in a “safe” state for merging.
nProjectHandle (int) – The project handle.
reporter (SvnReporter) – The reporter.
str
A string explaining why the project cannot be merged, or null if there is no obstacle.
GetSvnConflictsInfo
id
reporter
Gets the SVN conflicts info for a specific object (non-recursively).
id (SvnObjectId) – The id.
reporter (SvnReporter) – The reporter.
SvnConflictsInfo
GetStatus
objectId
flags=SvnGetStatusFlags.RetrieveAllEntries
depth=SvnDepth.Infinity
changeLists=None
reporter=None
Queries the subversion status.
objectId (SvnObjectId) – The object id.
flags (SvnGetStatusFlags) – The flags.
depth (SvnDepth) – The wanted subversion depth.
changeLists (list[str]) – The change lists. If set and not empty, only those child elements which are members of the
mentioned changelists are cinluded during recursive operations.
reporter (SvnReporter) – The Reporter.
list[SvnStatusInfo]
A list of all found Subversion status infos.
Commit
objectIds
stMessage
bKeepLocks
bKeepChangelists
depth
changeLists
reporter
Commits the specified objects in the given project.
objectIds (list[SvnObjectId]) – The object ids. To guarantee consistency, you should pass this selection through SvnProjectServices.VerifySelection before calling.
stMessage (str) – The commit message.
bKeepLocks (bool) – if set to True, local locks are kept.
bKeepChangelists (bool) – if set to True, changelists are kept.
depth (SvnDepth) – The depth.
changeLists (list[str]) – The change lists. If set and not empty, only those child elements which are members of the mentioned changelists are inluded during recursive operations.
reporter (SvnReporter) – The Reporter.
ChangeLocation
id
stNewLocation
reporter
Changes the location of an SvnItemType.ObjectDirectory to a different directory name via “svn move”.
id (SvnObjectId) – The id.
stNewLocation (str) – The new location.
reporter (SvnReporter) – The Reporter.
SvnObjectId
The object ID pointing to the new path.
CheckLocation
id
stNewLocation
reporter
Checks a new location for CheckLocation.
id (SvnObjectId) – The id.
stNewLocation (str) – The new location.
reporter (SvnReporter) – The Reporter.
Throws “Exception” explaining why the new location is not allowed.
VerifySelection
action
userWantsToSelect
userWantsToDeSelect
selectedBeforeUserChange
urlsAndRevisions
finalSelection
addedByHooks
removedByHooks
args
Verifies a selection for a working copy modifying operation. Some Plugins need to ensure conistency between multiple objects, and this requires that certain SVN operations can only be processed on specific groups of objects.
action (RcsSelectionVerificationAction) – The operation we want to verify the selection for.
userWantsToSelect (list[SvnObjectId]) – The initial selection of objects we want to verify, or the objects the user wants to add to the selection.
userWantsToDeSelect (list[SvnObjectId]) – The objects user wants to deselect, or empty.
selectedBeforeUserChange (list[SvnObjectId]) – The objects which have been selected before the user klicked to change the selection, or empty if no object was selected previously.
urlsAndRevisions (SvnSelectionVerificationUrlAndRevisionData) – For SvnSelectionVerificationAction.IncludeExternals, the caller must provide an instance which is able to resolve Urls and revisions for all SvnObjectId instances given in userWantsToSelect and selectedBeforeUserChange. After the call, the variable will point to an instance which knows how to resolve all SvnObjectId instances in the finalSelection collection. For other values of action, null has to be passed.
finalSelection (list[SvnObjectId]) – The final selection, or null if non non-colliding selection
was found.
addedByHooks (list[SvnObjectId]) – The objects added by hooks.
removedByHooks (list[SvnObjectId]) – The objects removed by hooks.
args (RcsSelectionVerificationArgs) – The args, for more fine-grained analysis.
DialogResult
DialogResult.OK if the initial selection was ok without changes. DialogResult.Yes if a non-colliding selection was found. DialogResult.Abort if no non-colliding solution was found.
CheckoutProject
url
revision
stProjectPath
stProjectName
flags
updateFlags
reporter
engineProjectAttributes
Creates a new project and fills it with the contents from the given Subversion URL.
url (Uri) – The Subversion URL where to find the projects contents.
revision (SvnRevision) – The revision to check out.
stProjectPath (str) – The project path for the project file to save.
stProjectName (str) – Name of the project.
flags (SvnCheckOutFlags) – The flags.
reporter (SvnReporter) – The Reporter.
updateFlags (SvnVersionUpdateFlags) – The update flags for the VersionCompatibilityManager2. This parameter is currently only effective if the datasource based mechanism is used on a primary project, and silently ignored otherwise.
engineProjectAttributes (list[Guid]) – Additional engine ProjectAttributes. Attributes conflicting with the flags may lead to an exception or otherwise undefined behaviour, ProjectAttributes.Primary is automatically set based on the flags.
bool
The project handle of the new project, or -1 if the user cancelled the checkout, for example when this would override an existing project. Throws “ArgumentOutOfRangeException” describing why the current combination of checkout flags is not allowed. Throws “Exception” for any other exception happening during the checkout.
property
DefaultCheckoutFlags
Gets the current default set of default checkout flags.
SvnCheckOutFlags
The default checkout flags.
ValidateCheckoutFlags
flags
Validates the checkout flags, giving a user readable representation of which flags will currently lead to a failure. E. G., SvnCheckoutFlags.ForceProjectSource will fail with a CODESYS version older than V3.5.4.0 (not providing the projectsource mechanism), and is mutually exclusive with SvnCheckoutFlags.ForceAddMultipleObjects.
flags (SvnCheckOutFlags) – The flags.
Throws “ArgumentOutOfRangeException” describing why the current combination of checkout flags is not allowed.
Lock
objectIds
stMessage
bStealLocks
bRecursive
reporter
Locks the specified object IDs.
objectIds (list[SvnObjectId]) – The object ids. To guarantee consistency, you should pass this selection through SvnProjectServices.VerifySelection before calling.
stMessage (str) – The lock message.
bStealLocks (bool) – if set to True, locks by others are broken / stolen.
bRecursive (bool) – if set to True, subnodes are recursively locked.
reporter (SvnReporter) – The Reporter.
Unlock
objectIds
bRecursive
reporter
Releases the locks for the specified objects.
objectIds (list[SvnObjectId]) – The object ids. To guarantee consistency, you should pass this selection through SvnProjectServices.VerifySelection before calling.
bRecursive (bool) – if set to True, subnodes are recursively unlocked.
reporter (SvnReporter) – The Reporter.
GetProjectAtRevision
objectRevisionContext
nProjectHandle
revision
reporter
Gets the project at a given revision.
objectRevisionContext (Guid) – The object revision context.
nProjectHandle (int) – The Project we need to get at the revision.
revision (SvnRevision) – The revision.
reporter (SvnReporter) – The Reporter.
bool
The projecthandle. (This may be the original projecthandle for SvnRevisionType.Working.)
GetRcsProjectTree
projectHandle
Gets an RCS project tree - this tree is a snapshot, and will get invalidated by the next SVN or CODESYS Object Manager operation on the same project.
projectHandle (int) – The project handle.
RcsVirtualProject
The current RCS Project tree.
GetObjectIdFor
node
Gets the object identifier for an RCs project node.
node (RcsVirtualProjectNode) – The node.
SvnObjectId
GetRcsVirtualNode
info
IsUpToDate
node
Determines whether the specified node is still up to date.
node (RcsVirtualProjectNode) – The node.
bool
True if the node is up to date.
GetObjectInfoFor
id
Gets the object identifier for an RCs project node.
id (SvnObjectId) – The object id.
SvnObjectInfo
GetPsNodeFor
id
Gets the ps node for a given object id. (This might be an SvnDeletedPSNode.)
id (SvnObjectId) – The identifier.
PSNode
CleanUp
nProjectHandle
whatToClean
reporter
Executes an SVN Cleanup on the working copy. In SVN 1.7 and newer, unfortunately, the pristine storages tends to bloat, and an explicit Cleanup is the only way to trim the working copy back to normal size. Currently, CleanUp(self) is implicitly called on project save operations.
nProjectHandle (int) – The project handle.
whatToClean (CleanUpFlags) – The flags designating which things to clean. Passing
CleanUpFlags.None here still tries to clean up the working queue of incomplete operations.
reporter (SvnReporter) – The Reporter.
Copy
nProjectHandle
newUrl
stCommitMessage
revision=None
reporter=None
Copies the specified project to a different location (create a branch or tag).
nProjectHandle (int) – The project handle.
newUrl (Uri) – The new URL.
stCommitMessage (str) – The commit message.
revision (SvnRevision) – The revision.
reporter (SvnReporter) – The reporter.
ResynchronizeProject
nProjectHandle
reporter=None
Resynchronizes the project. This can be used to repair inconsistencies. If this is necessary in reproducible situations, you should file a bug report.
nProjectHandle (int) – The project handle.
reporter (SvnReporter) – The reporter.
SynchronizeProjectProfile
nProjectHandle
forceRewrite=True
reporter=None
Forces resynchronization of the project storage profile file (“meta.profile”) and objects to the working copy. Might be necessary if one changes the storage profile at an uncommon time via AP interfaces, and wants to force the synchronization of the profile.
nProjectHandle (int) – The project handle.
forceRewrite (bool) – Forces the rewriting of all files. Set it to false to upgrade just the profile file.
reporter (SvnReporter) – The reporter.
SynchronizeProfileFileSchedule
nProjectHandle
reporter=None
Forces resynchronization of the SVN schedule of the project storage profile file (“meta.profile”) to the working copy. Might be necessary to make sure the svn status of the profile file is up to to date right now. (It will be automatically updated at certain points in time, including just before commit.)
nProjectHandle (int) – The project handle.
reporter (SvnReporter) – The reporter.
ImportProject
nProjectHandle
url
stMessage
versionInfoMode
reporter
Imports the project into an existing subversion repository.
non-existing directory with an existing parent directory. In the latter case, the directory will be created.
nProjectHandle (int) – The handle of the project to import.
url (Uri) – The subversion URL where to import the project.
stMessage (str) – The commit message for the import.
versionInfoMode (SvnVersionInfoMode) – The version info mode.
reporter (SvnReporter) – The Reporter or null.
VerifySelectionForUpdateReported
ids
revision
recursive=True
omitExternals=False
reporter=None
HelperMethod for VerifySelection: Verifies a given colleciton of SvnObjectIDs, and reports occuring changes to the given ISvnReporter. This method is specific for update operations, and will both verify local and remote dependencies.
ids (list[SvnObjectId]) – The object ids we want to update.
revision (SvnRevision) – The destination revision we want to update.
recursive (bool) – Whether the operation is recursive.
omitExternals (bool) – Whether externals are to be included.
reporter (SvnReporter) – The reporter. May be None for non-reported operation.
list[SvnObjectId]
The verified selection, or null if no non-conflicting solution was found.
Revert
objectIds
revision
reporter
recursively
Reverts the specified objects to a given revision.
objectIds (list[SvnObjectId]) – The object ids to revert. To guarantee consistency, you should pass this selection through SvnProjectServices.VerifySelection before calling.
revision (SvnRevision) – The revision to revert back to.
reporter (SvnReporter) – The Reporter.
recursively (bool) – Whether to revert child objects as well.
Update
objectIds
revision
depth=SvnDepth.Infinity
bOmitExternals=False
reporter=None
bThrowOnPredictedTreeConflict=False
Updates objects in a specified project.
objectIds (list[SvnObjectId]) – The object ids to update. To guarantee consistency, you should pass this selection through SvnProjectServices.VerifySelection before calling.
revision (SvnRevision) – The revision to update them.
reporter (SvnReporter) – The Reporter.
depth (SvnDepth) – The depth.
bOmitExternals (bool) – If set to True, externals are omitted.
bThrowOnPredictedTreeConflict (bool) – If set to True, we try to predict and avoid tree conflict by throwing a SvnTreeConflictImminentException.
RevertProjectToRevision
nProjectHandle
bReleaseLocks
revision
reporter
bThrowOnPredictedTreeConflict=False
Reverts the specified objects to a given revision.
nProjectHandle (int) – The handle of the project to revert.
revision (SvnRevision) – The revision to revert back to.
reporter (SvnReporter) – The Reporter.
bReleaseLocks (bool) – if set to True, the locks of the whole project are released. It is generally
a good idea to do this, so True is currently implied in the UI.
bThrowOnPredictedTreeConflict (bool) – If set to True, we try to predict and avoid tree conflict by throwing a SvnTreeConflictImminentException.
RevalidateRemoteLocks
objectIds
reporter
Updates remote lock status of objects from the server without releasing invalidated locks in the working copy. The main use case is recognition of stolen locks.
objectIds (list[SvnObjectId]) – The objects the remote lock status should be updated for.
reporter (SvnReporter) – The reporter.
class
ScriptSvnProjectServices.
SvnProjectConfiguration
Bases: object
Project specific configurations.
property
EffectiveConflictResolutionMode
Gets the effective conflict resolution mode. If the mode is not specifically configured for this project, the global setting is resolved.
SvnConflictResolutionMode
property
ProjectConflictResolutionMode
Gets or sets the project conflict specific resolution mode.
SvnConflictResolutionMode
The project resolution mode.
property
ProjectConflictResolutionUseMarkers
Gets or sets the default whether conflict resolution allows conflict markers.
SvnConflictUseMarkerMode
The default_conflict_resolution_use_markers.
property
EffectiveConflictResolutionUseMarkers
Gets or sets the default whether conflict resolution allows conflict markers.
SvnConflictUseMarkerMode
The effective project specific setting.
property
EffectiveAutoLockingMode
Gets the effective auto locking mode. If the mode is not specifically configured for this project, the global setting is resolved.
SvnAutoLockingMode
property
ProjectAutoLockingMode
Gets or sets the project specific auto locking mode.
SvnAutoLockingMode
The project_auto_locking_mode.
property
VersionInfoMode
Gets or sets the configuration for the SvnVersionInfoMode.
SvnVersionInfoMode
The SvnVersionInfoMode, or None if it was not explicitly
configured in this project yet.
property
EffectiveVersionInfoMode
Gets or sets the effective SvnVersionInfoMode.
SvnVersionInfoMode
The effective SvnVersionInfoMode.
SaveThrough
Writes the settings back to the object. This is sometimes necessary when modifying the settings via API.