ScriptSvnCommonServices¶
- class ScriptSvnCommonServices.SvnCommonServices¶
Bases:
object
Contains all services which work with local and remote SVN Objects.
- CreateRevision(time)¶
Factory function for ISvnRevision instances.
- Parameters:
time (
DateTime
) – The time.- Return type:
SvnRevision
- Returns:
The ISvnRevision instance.
- CreateRevisionRange(startRevision, endRevision)¶
Factory function for ISvnRevisionRange instances. :type startRevision:
SvnRevision
:param startRevision: The start revision.- Parameters:
endRevision (
SvnRevision
) – The end revision.- Return type:
SvnRevisionRange
- Returns:
The ISvnRevisionRange instance.
- GetObjectInfo(id)¶
Gets the object info for a given object.
- Parameters:
id (
SvnObjectId
) – The id.- Return type:
SvnObjectInfo
- Returns:
The ISvnObjectInfo instance.
- CreatePropertyValue(value)¶
Factory for a binary ISvnPropertyValue instances.
- Parameters:
value (list[int]) – The value.
- Return type:
SvnPropertyValue
- Returns:
The ISvnProperty value
- property IsAuthenticationDataExisting¶
Gets a value indicating whether cached authentication data is existing.
- Return type:
bool
- Returns:
True
if this instance has existing authentication data; otherwise,False
.
SvnCommonServices
.ExistingAuthenticationDataLocations
- property OfflineMode¶
Gets a value indicating whether the offline mode is active. Currently, the offline mode disables implicit locking, and deactivates all commands which need online access. (Only the commands will be deactivated, the API functions are still available!)
over time, we plan to abandon implicit locking eventually. This will allow us to get rid of the offline mode, or at least weaken its semantics by dropping the implicit locking (or limiting it to some specific types of objects).
- Return type:
bool
- Returns:
True
if [offline mode]; otherwise,False
.
- SetOfflineMode(bOffline)¶
Sets the offline mode.
- Parameters:
bOffline (bool) – if set to
True
[b offline].
- GetSiblings(id)¶
Gets the Siblings for an object.
- Parameters:
id (
SvnObjectId
) – The object we’re interested in.- Return type:
list[SvnObjectInfo]
- Returns:
The list of siblings.
- GetChildren(parentId)¶
Gets the Children for an object. You can pass the result of CreateObjectID(nProjectHandle, Guid.Empty) for the project top level nodes.
- Parameters:
parentId (
SvnObjectId
) – The parent we’re interested in.- Return type:
list[SvnObjectInfo]
- Returns:
The list of children.
- GetParentUrl(url)¶
Gets the parent Url. Handles subversion PEG revisions.
- Parameters:
url (
Uri
) – The Url.- Return type:
Uri
- Returns:
The parent Url, or null if the URL has no local path.
- CleanObjectAtRevisionContext(objectRevisionContext)¶
Cleans the temporary projects used for the object at revision context. This is used in
SvnProjectServices
.GetObjectAtRevision andSvnRemoteServices
.GetObjectAtRevision.- Parameters:
objectRevisionContext (
Guid
) – The object revision context.
- GetObjectIdType(id)¶
Gets the type of the object id.
- Parameters:
id (
SvnObjectId
) – The id.- Return type:
SvnItemType
- GetAnchorType(id)¶
Gets the type of the anchor.
- Parameters:
id (
SvnObjectId
) – The id.- Return type:
SvnObjectIdAnchorType
- GetObjectGuid(id, bResolve=False)¶
Gets the object GUID for a given object ID.
- Parameters:
id (
SvnObjectId
) – The id.bResolve (bool) – if set to
True
, allows resolving the object ID forSvnObjectIdAnchorType
.Location.
- Return type:
Guid
- Returns:
The GUID of the object ID, or Guid.Empty for the Root, or null.
- GetPsNode(id, bResolve=False)¶
Gets the PS Node for a given object ID.
- Parameters:
id (
SvnObjectId
) – The id.bResolve (bool) – if set to
True
, allows resolving the object ID forSvnObjectIdAnchorType
.Location.
- Return type:
PSNode
- Returns:
The PS Node (possibly
SvnRemotePSNode
) or null.
- GetObjectPath(id, bResolve=False)¶
Gets the object path.
- Parameters:
id (
SvnObjectId
) – The id.bResolve (bool) – if set to
True
, allows resolution of the path forSvnObjectIdAnchorType
.Node.
- Return type:
str
- Returns:
The local relative path of the object ID within the working copy, or the url for remote PS nodes, or the empty string for the Root, or null.
- GetOnDiskPathes(id, bResolve=False)¶
Gets the on disk pathes.
- Parameters:
id (
SvnObjectId
) – The id.bResolve (bool) – if set to
True
[b resolve].
- Return type:
list[str]
- Returns:
The list of on-disk pathes.
- CreateObjectId(nProjectHandle, stRelPath, type)¶
Creates an object id anchored at the given rel path using the given type.
- Parameters:
nProjectHandle (int) – The project handle.
stRelPath (str) – The rel path.
type (
SvnItemType
) – The type.
- Return type:
SvnObjectId
- Returns:
The object ID.
- IsLocal(id)¶
Determines whether the specified id is local.
- Parameters:
id (
SvnObjectId
) – The id.- Return type:
bool
- Returns:
True
if the specified id is local; otherwise,False
.
- GetParent(id)¶
Gets the parent.
- Parameters:
id (
SvnObjectId
) – The id.- Return type:
SvnObjectId
- Returns:
The parent Id, or null if the ID is a root ID.
- GetItemType(id)¶
Gets the type of the id.
- Parameters:
id (
SvnObjectId
) – The id.- Return type:
SvnItemType
- GetAnchorTypes(id)¶
Gets the anchor types.
- Parameters:
id (
SvnObjectId
) – The id.- Return type:
SvnObjectIdAchorType
- ConsolidateStatusInfos(infos, bKeepOriginalInfos=False)¶
Consolidates the status infos into exactly one per object. It merges Directory and file infos for the node, and removes infos for other artifacts (like conflict files). Use it for user display.
- Parameters:
infos (list[SvnStatusInfo]) – The list of status infos. This list may be enumerated multiple times.
bKeepOriginalInfos (bool) – if set to
True
, the original status infos which are used during synthesizing are not deleted, but returned together with the synthesized ones.
- Return type:
list[SvnStatusInfo]
- Returns:
The consolidated list of status infos.
- CreateSynthesized(id)¶
Creates the synthesized object ID for
SvnItemType
.ObjectData andSvnItemType
.ObjectDirectory IDs.- Parameters:
id (
SvnObjectId
) – The id.- Return type:
SvnObjectId
- Returns:
The synthesized object ID.
- CreateSvnTarget(urlWithoutPeg, revision=None)¶
Creates a new SVN target out of the given
urlWithoutPeg
andrevision
.- Parameters:
urlWithoutPeg (
Uri
) – The URL without peg.revision (
SvnRevision
) – The revision. This is optional, if it is omitted,SvnRevisionType
.None is used.
- Return type:
SvnUrlTarget
- Returns:
The SVN target.
- ParseUrlWithPegRevision(stUrlWithPeg)¶
Parses the URL with peg revision.
- Parameters:
stUrlWithPeg (str) – The URL string with peg.
- Return type:
SvnUrlTarget
- Returns:
A
SvnUrlTarget
object.
- ClearAuthenticationData(locations)¶
Clears the subversion authentication data from your machine. The next time the plugin contacts the Subversion repository, the credentials will be prompted again.
- Parameters:
locations (
AuthenticationDataCacheLocations
) – The locations of the cache to clear.
- property ExistingAuthenticationDataLocations¶
Gets a value indicating whether and where cached authentication data exists.
- Return type:
AuthenticationDataCacheLocations
- Returns:
The
AuthenticationDataCacheLocations
describing whether and where cached authentication data exists