%Studio.SourceControl.ISC
class %Studio.SourceControl.ISC extends %Studio.SourceControl.Base
This class is used internally by InterSystems. You should not make direct use of it within your applications. There is no guarantee made about either the behavior or future operation of this class.
Method Inventory
- AddClassesToSourceControl()
- AddItemsToSourceControl()
- AddPackagesToSourceControl()
- AddToSourceControl()
- AfterUserAction()
- BackupName()
- BaselineCSPDir()
- BaselineExport()
- BaselineExportEnsembleExclude()
- BaselineExportItem()
- CheckIn()
- CheckIndexes()
- CheckOut()
- ClearPerforceTicket()
- Compile()
- DSCheckpointExport()
- DefaultCredentialsDefined()
- DirectoryInventory()
- Disconnect()
- DisconnectItem()
- Disconnected()
- DisconnectedReconcile()
- ExportCSPFile()
- ExportDefaults()
- ExtName()
- ExternalName()
- GeneratePerforceTicket()
- GetCredentials()
- GetHistoryLink()
- GetLatest()
- GetSharedWorkspace()
- GetStatus()
- ImportCSPFile()
- InstanceVersion()
- InternalNameFromExtName()
- IsExcluded()
- IsGenerated()
- IsInSourceControl()
- IsMapped()
- IsSharedDevInstance()
- IsTrakCare()
- JobUpdateSources()
- Load()
- Lock()
- Locked()
- Login()
- Name()
- OnAfterCompile()
- OnAfterSave()
- OnAfterStorage()
- OnBeforeLoad()
- OnBeforeSave()
- OnBeforeTimestamp()
- OnMenuItem()
- OutputInfo()
- P4Cmd()
- ReadOnly()
- Reconnect()
- ReconnectItem()
- RemoveFromSourceControl()
- RunCmd()
- SecureP4Cmd()
- SecureRunCmd()
- SetCredentials()
- SetFileReadOnly()
- SetFileWriteable()
- SetSharedWorkspace()
- StorePerforceTicket()
- UndoCheckout()
- Unlock()
- UpdateSources()
- UserAction()
- ValidatePerforceTicket()
Parameters
Methods
- 0 - No
- 1 - Yes
- 2 - Cancel
At the time of CheckOut(), a local backup of the item in its existing state is written to the file system with a .bak extension. This file will be used on Disconnected systems to restore to the previous state when UndoCheckout() is called. It can also be used for diffs from the original file state.
This should be run from the terminal, and the user will be prompted as to whether they want to export to the current ^Sources location or an alternate location (alternate is recommended).
The method will then iterate through all Classes, Routines, Include files, CSP Application files and Projects and will export them to ^Sources based on the mappings in the ^Sources global.
NOTE - this does not export "Generated" classes.
Passing classesOnly as '1' will export only the baseline of the classes. This is useful for exporting all updated XML after changing to a new class compiler version.
Pass interactive as 0 in order to call this programmatically.
Pass targetDirectory to specify the directory for export (NOTE - this cannot equal ^Sources for TrakCare exports).
Pass boolean changeToReadOnly to control whether the files should be changed to read-only after export (defaults to true).
Pass boolean includeMapped to control whether items mapped from other databases should be included in the export (defaults to true). The default value for this argument will be the inverse of the source hooks LockMapped setting for this namespace (so if nothing is set, then Mapped will be included by default).
If ToReadOnly is true, then the files will be manually changed to ReadOnly afterwards (for use when exporting from LIVE and leaving items uneditable afterwards).
If CheckOut is true, then the Source Control CheckOut/AddToSourceControl logic is used.
If includeMapped is true, then items mapped from other DBs will be exported, otherwise they will be skipped. The default value for this argument will be the inverse of the source hooks LockMapped setting for this namespace (so if nothing is set, then Mapped will be included by default).
Following successful checkout, the copy of the file on disk is loaded into the Namespace, unless Load is false.
DSCheckpointExport() will check for the last time that DSCheckpointExport() was run, and will check out and export all changes DS II items since that timestamp. This should work for both Connected and Disconnected instances. If ListOnly is true, then a list will be displayed but nothing will actually be checked out.
If AddNew is true, then all items which are not yet on disk in the local workspace will be marked for 'add' and exported, otherwise, only those already on disk will be exported.
If ExportAll is true, then the timestamp from the previous export will be ignored and all DeepSee work that is in Source Control will be checked out.
If Interactive is true, then the user will be prompted for their Perforce password if it is a Connected instance.
NOTE - if there is no credentials data stored at all, the the assumption is made that this is a single-user system that relies on environment variables for Perforce access, and 'true' will be returned so that the user will not be prompted for credentials or told that none are defined. Credentials must be stored entirely in environment variables, or entirely in the DB for a given instance.
Values for 'Level' parameter are:
- 1: Instance is Disconnected but could connect at a future time (default)
- 2: Instance is Permanently Disconnected (no plans of ever connecting to Perforce)
Return values are:
- 0: Instance is Connected
- 1: Instance is Disconnected but could connect at a future time
- 2: Instance is Permanently Disconnected (no plans of ever connecting to Perforce)
Takes a Source directory and reconciles it with a Target directory which is under source control:
- Files in Source which do not exist in Target will be copied into the Target and AddToSourceControl() will be called
- Files in Source which exist as Writeable in Target will be skipped
- Files in Source which exist as ReadWrite in Target will call Checkout() and then copied from Source to Target
- After all processing, files in Target which are Readonly will call RemoveFromSourceControl()
This will only run if the Namespace is in Permanently Disconnected Mode; for Connected clients, use the p4 reconcile feature in p4V
If
If the
- If there is a user-specific set of credentials defined for the current $USERNAME, these credentials will be returned
- If a SharedWorkspace has been defined but there are no credentials for the current $USERSAME, then $USERNAME is returned as p4user assuming it's not a shipped username
- If a SharedWorkspace has been defined, then it will be returned in the p4workspace parameter; otherwise the workspace for the credential set will be returned
- If credentials exist for this specific $USERNAME, then p4passwd is returned from the the current studio process (the password stored in credentials is ignored)
- If there is no data at all in ^%SYS("SourceControl","Credentials"), then the method returns 'true', assuming the Environment variables are used to store the credentials
The method will check for the existence of a namespace-specific workspace, and will use that if it exists. If a namespace specific workspace is not defined, then it will look for an instance-wide Shared Workspace.
This also allows a user to retrieve the stored alternate workspace directory root (-d flag in P4)
This method checks the current status of the item, seeing whether or not it is in source control (based on an exported copy of the item on disk), and if it is in source control, whether it is currently checked out (based on whether the file is Readonly or not).
If the file is checked out, this method will check to find the value of $USERNAME for whomever performed CheckOut(). If the current $USERNAME does not match, then the user will not be permitted to edit the file as it has been checked out by another user.
If no item in the database can be found to map to the external filename, then if it is a CCR enabled namespace it will return the path translated into the /itemsetsourcelink(_*) import/export format.
Unless IgnorePercent argument is set to 0, any %-items will return "".
Unless IgnoreNonexistent argument is set to 0, if the item isn't found in the database, then "" will be returned.
Known Limitations (if the physical file doesn't exist):
- Due to this historical act of stripping '%' from the beginning of package names, if there exists both a %-item and a non-%-item which map to the same location, then "" will be returned as the result is indeterminate without having access to the source file.
- The method currently will not find matches for multi-tier mappings in ^Sources (e.g.
^Sources("HL7","*")="schema/hl7/"
, other than multi-tier mappings under /CSP/
NOTE: This is available as %RoutineMgr::IsMapped() in 2013.1 and later; it is included in this class to support the source hooks working on earlier versions.
It is considered a Shared development instance if one of the following is true:
- This is a Connected instance and there is a Shared Workspace defined for this instance or namespace
- This is a Permanently Disconnected Namespace (Permantently Disconnected means it is outside the InterSystems network and we always assume Shared)
The default setting will be "Locked". Passing a '1' for the Admin parameter will set the instance to AdminLocked.
See Locked() for more details.
Return values are:
- "": Instance has never been Locked or Unlocked (default)
- 0: Instance is Unlocked
- 1: Instance is Locked
- 2: Instance is AdminLocked
When the instance is Locked or AdminLocked, no changes can be made via Studio. It is possible to change from Locked to NotLocked via different UIs. When an instance is AdminLocked it should only be possible to unlock it via the Unlock() method.
Run a shell command and report any error message, return output with lines as subscripts of the array if stream is false (the default) but if stream is true then we will return the output as a stream to be read by the caller.
- If p4user is passed as a string, then it (along with the other arguments) will be the default for this instance
- If p4user is of the form $LB(cacheUser, p4user), then p4user only be used when $USERNAME=cacheUser, and all other arguments will be ignored. The workspace details should be set via SetSharedWorkspace(), and the user will be prompted for the p4passwd value at runtime
- If p4user is "" , then the default credentials will be cleared
- If p4user is of the form $LB(cacheUser,""), then the perforce username for cacheUser will be cleared
If the namespace argument is not passed, then the values will be set for the entire instance. If it is passed, then the workspace and alternate workspaace directory root will be used just for that specified workspace.
This also allows a user to set the alternate workspace directory root (-d flag in P4).
Important Note: Passing p4workspace as "" will clear out all of the shared worspace settings, and will merge them
into ^%SYS("SourceControl","PriorSharedWorkspace")
for future reference.
The Type argument values are:
- 0 : Server defined menu item selected
- 1 : Other Studio action
- 0 : User has tried to change a document that is locked in source control
- 1 : User has created a new document
- 2 : User has deleted a document
- 3 : User has opened a document
- 4 : User has closed a document
- 5 : User has connected to a new namespace
- 6 : User has selected to import comma delimetered list of documents
- 7 : User has saved a new document for the first time
- 0 : Do nothing, note that this method can still perform some action such as check an item out of source control, but Studio will not ask for user input.
- 1 : Display the default Studio dialog with a yes/no/cancel button. The text for this dialog is provided in the 'Target' return argument.
- 2 - Run a CSP page/Template. The Target is the full url to the CSP page/Template, as usual the page will be passed the current document name, any selected text, the project name, the namespace.
- 3 - Run an EXE on the client. The Target is the name of an executable file on the client machine. It is the responsibility of the customer to ensure this EXE is installed in a suitable location.
- 4 - Insert the text in Target in the current document at the current selection point.
- 5 - Studio will open the documents listed in Target. If there are multiple documents to open they will be separated with commas. If the document name is 'test.mac:label+10' it will open the document 'test.mac' and goto 'label+10'.
- 6 - Display an alert dialog in Studio with the text from the Target variable.
- 7 - Display a dialog with a textbox and Yes/No/Cancel buttons. The text for this dialog is provided by the 'Target' return argument. The initial text for the textbox is provided by the 'Msg' return argument.
Inherited Members
Inherited Properties
Inherited Methods
- %AddToSaveSet()
- %ClassIsLatestVersion()
- %ClassName()
- %ConstructClone()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %DispatchSetProperty()
- %Extends()
- %GetParameter()
- %IsA()
- %IsModified()
- %New()
- %NormalizeObject()
- %ObjectModified()
- %OnClose()
- %OnNew()
- %OriginalNamespace()
- %PackageName()
- %RemoveFromSaveSet()
- %SerializeObject()
- %SetModified()
- %ValidateObject()
- GetPortalPageOptions()
- IsReadOnly()
- ItemIconState()
- Logout()
- OnAfterAllClassCompile()
- OnAfterClassCompile()
- OnAfterDelete()
- OnAfterLoad()
- OnBeforeAllClassCompile()
- OnBeforeClassCompile()
- OnBeforeCompile()
- OnBeforeDelete()
- OnPortalCreate()