Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: bITs.EA on April 13, 2016, 06:58:34 pm

Title: Scripting: versioncontrolCheckout
Post by: bITs.EA on April 13, 2016, 06:58:34 pm
Hi

I'm trying to do a checkout (in batch) via a script. It seems to work, but I don't understand why the "Import package dialogue box is shown instead of the normal "checkout" dialogue box.

1) Is this normal behaviour?
2) how can I do a "undo checkout" via scripting? (I can't find a function in the manual...)

Title: Re: Scripting: versioncontrolCheckout
Post by: Helmut Ortmann on April 14, 2016, 02:45:19 pm
Hi,

you can always execute a command for your Version Control system by script. Then with EA re-sync state of the package.

In the evening I'll look into my code. I think I have done some code for SVN and MKS around Version Control and some helpers to make work easy.

Helmut
Title: Re: Scripting: versioncontrolCheckout
Post by: Helmut Ortmann on April 18, 2016, 07:34:53 pm
Hi,

you can do an undo Version Control checkout by calling the API of your Version Control system like SVN for the envolved package / xml files.

To update EA Package state and package content you can use EA API (see user guide, api for package):
- VersionControlResynchPkgStatus
- VersionControlGetLatest
- ScanXMIAndReconcile() (read the documentation of VersionControlGetLatest, there is additional advice)

As I remember that works quite well. But take in account: Version Control sometimes offers surprises.

Helmut