Book a Demo

Author Topic: Automate Version Control Settings  (Read 14722 times)

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Automate Version Control Settings
« on: May 26, 2014, 11:26:27 pm »
I would like to automate the process of configuring EA with version control. (Project -> Version Control -> Version Control Settings window)

The API methods I've found are related to packages that were already  controlled or after the configuration are set. I would like to automate the step before.

Is there a way to do so via API or it must be done manually?

Thanks in advance!

Mauricio Moya (Arquesoft)

  • EA User
  • **
  • Posts: 344
  • Karma: +8/-4
  • EA Consulting and development in Spanish
    • View Profile
    • Arquehub Azure Module
Re: Automate Version Control Settings
« Reply #1 on: May 27, 2014, 02:57:36 am »
I think part of the configuration is stored in the model database, so you can insert the suitable data directly on the database. But another part of the settings is per user, so I suppose it is stored in a local file, so if you set the local file properly you can set the version control settings for a user.

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Automate Version Control Settings
« Reply #2 on: May 27, 2014, 03:09:45 pm »
You have to do four things to put a package under version control.

1. Set the unique ID in %APPDATA%\SPARX_Systems\EA\paths.txt
2. Use API VersionControlAdd(..)
3. Set the svn path in registry
    HKEY_CURRENT_USER\Software\SPARX Systems\EA400\EA\Options\VC_SVNExePath
4. svn Timeout in registry (VC_TIMEOUT)

I hope it's all.

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Re: Automate Version Control Settings
« Reply #3 on: May 27, 2014, 09:56:06 pm »
Thank you Helmut for your quick and detailed reply.

I followed the instructions you've posted and would like to get explication about the first step;

I set the unique id and configuration settings such as type and path to svn folder in the %APPDATA%\SPARX_Systems\EA\paths.txt file.

Then I checked if the action is reflected in EA, by selecting Settings -> Local Directories and Paths.
The new path ,indeed, exist.

But the path is still not set as a configuration:
It does not exist among the configurations defined manually- which can be displayed on Project -> Version Control -> Version Control Settings window.

Therefore, when I invoke the 'VersionControlAdd' method, the exception message I get is : "No version control configuration matches '<unique id>'.  "
 
What else should I do in order to set the local path as configuration?
Thanks in advance.

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Automate Version Control Settings
« Reply #4 on: May 27, 2014, 11:03:23 pm »
Hi,

the entry VCConfigs is set to:
<VCConfigs><Config><GUID>svn_ac4nns</GUID><LocalPath>%svn_ac4nns%</LocalPath><UserName/><Type>2</Type></Config></VCConfigs>

%svn_ac4nns% is my Unique Identifier.

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Re: Automate Version Control Settings
« Reply #5 on: May 27, 2014, 11:57:33 pm »

Should I create in addition a registry entry called 'VCConfigs' and set it with the appropriate value?

Thanks.

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Automate Version Control Settings
« Reply #6 on: May 28, 2014, 12:04:42 am »
If I understand it right in VCConfigs is an entry for each Unique ID.

If you have one unique ID you can simply change my values. If you have more try it by using the EA Configuration Dialog.

By the way I haven't it done with the registry yet.

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Re: Automate Version Control Settings
« Reply #7 on: May 28, 2014, 12:14:27 am »
I cannot find such an entry in the registry.
Should I  define one or I misunderstand something?

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Automate Version Control Settings
« Reply #8 on: May 28, 2014, 12:23:56 am »
If you set the Version Control settings with EA EA creates this entry and fills it with the configured UniqueIDs.

Just configure with EA and look in the registry. All the VC information is in EA400\EA\OPTIONS.

Here is the content for two Unique IDs.

<VCConfigs><Config><GUID>svn_ac4nns</GUID><LocalPath>%svn_ac4nns%</LocalPath><UserName/><Type>2</Type></Config><Config><GUID>test</GUID><LocalPath>%test%</LocalPath><UserName/><Type>2</Type></Config></VCConfigs>

Helmut

Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Re: Automate Version Control Settings
« Reply #9 on: May 28, 2014, 12:38:53 am »
Digging in the registry I found only 2 entries owned by EA400\EA\OPTIONS : CALENDAR and FILTERS.

Any ideas?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Automate Version Control Settings
« Reply #10 on: May 28, 2014, 12:51:24 am »
Create a SVN provider manually. Then search the registry for VC_SVNExePath

q.

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Automate Version Control Settings
« Reply #11 on: May 28, 2014, 12:56:02 am »
Looks peculiar. I deleted with EA one entry and nothing changed in the registry. May be it's a bit more complicated.

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Automate Version Control Settings
« Reply #12 on: May 28, 2014, 01:23:35 am »
Hu, yes. Deleting the registry entry and cleaning paths.txt still kept the entry. So where could that info be stored else?

q.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Automate Version Control Settings
« Reply #13 on: May 28, 2014, 01:30:12 am »
Found it: t_genopt holds an entry with AppliesTo = VCConfigs

That just leaves the question why it's also in the registry? Does not seem to make much sense if the repository holds a value which seems to supersede its meaning. Well, it's EA...

q.
« Last Edit: May 28, 2014, 01:32:16 am by qwerty »

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Re: Automate Version Control Settings
« Reply #14 on: May 28, 2014, 11:20:38 pm »
Trying to implement the above I want to set the t_genopt entry of VCConfig.

How can I access and update this VCConfig entry? It is the 5th entry retrieved from the following query:

Code: [Select]
SELECT t_genopt.Option FROM t_genopt
Thanks.
« Last Edit: May 29, 2014, 02:02:02 am by avoda234 »